-
Notifications
You must be signed in to change notification settings - Fork 1
/
searchANDfavorites.js
71 lines (50 loc) · 3.26 KB
/
searchANDfavorites.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
context('Project', () => {
it('login page', () => {
cy.visit('https://giphy.com/')
cy.xpath("(.//*[normalize-space(text()) and normalize-space(.)='Create'])[1]/following::a[1]").click()
cy.get('input[name="email"]').type('[email protected]')
cy.get('input[name="password"]').type('12341234')
//cy.xpath("(.//*[normalize-space(text()) and normalize-space(.)='or'])[1]/following::button[1]").click({force: true})
cy.contains('Log in').click({force: true})
//cy.wait(60000)
//cy.title().should('include', 'Account')
//-------------------------------------------
//cy.visit('https://giphy.com/')
cy.get('input[id="search-box"]').click();
cy.get('input[id="search-box"]').type('canada');
cy.xpath("(.//*[normalize-space(text()) and normalize-space(.)='Log Out'])[1]/following::img[1]").click({force: true})
cy.wait(300)
cy.xpath("(.//*[normalize-space(text()) and normalize-space(.)='Newest'])[1]/following::div[33]").click({force: true})
cy.xpath("(.//*[normalize-space(text()) and normalize-space(.)='oh canada'])[1]/following::div[5]").click({force: true})
//---------------setting and favourite----------------
cy.wait(5000)
cy.get('input[id="search-box"]').click();
cy.contains('Favorites').click({force: true});
cy.xpath("(.//*[normalize-space(text()) and normalize-space(.)='deal with it'])[1]/following::div[5]").click({force: true})
cy.xpath("(.//*[normalize-space(text()) and normalize-space(.)='Auto Play'])[1]/following::div[12]").click({force: true})
cy.contains('Settings').click({force: true});
cy.xpath("(.//*[normalize-space(text()) and normalize-space(.)='Public'])[1]/following::button[1]").click({force: true})
cy.xpath("(.//*[normalize-space(text()) and normalize-space(.)='Channel Privacy'])[1]/following::button[1]").click({force: true})
cy.xpath("(.//*[normalize-space(text()) and normalize-space(.)='Create'])[1]/following::span[3]").click({force: true})
//---------------upload photo----------------
cy.xpath("(.//*[normalize-space(text()) and normalize-space(.)='Copyright'])[1]/following::span[1]").click({force: true})
cy.xpath("(.//*[normalize-space(text()) and normalize-space(.)='Upload one or more GIFs'])[1]/following::input[1]").click({force: true})
//upload photo
it("upload photo", () => {
cy.fixture('Hello.gif', 'base64').then(fileContent =>{
cy.xpath("(.//*[normalize-space(text()) and normalize-space(.)='Upload one or more GIFs'])[1]/following::input[1]").upload({
fileContent,
fileName: 'Hello.png',
mimeType: 'image/gif'
},
{
uploadType: 'input'
}
)
})
})
//=======================================
cy.xpath("(.//*[normalize-space(text()) and normalize-space(.)='Add Tags'])[1]/following::input[1]").type('FQA test test')
cy.xpath("(.//*[normalize-space(text()) and normalize-space(.)='community guidelines'])[1]/following::button[1]").click({force: true})
})
})