-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAssignment5_CreateUserScenario.cy.js
59 lines (53 loc) · 2.65 KB
/
Assignment5_CreateUserScenario.cy.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
///<reference types="cypress"/>
/*
Task 1 – Create new user and login with same user
Open https://ineuron-courses.vercel.app/
Click on Login Button
Click on New User link (use contains method)
Verify Sign up button is disabled before entering value
Enter Name, Email, Password
Select testing from checkbox
Select Gender
Select State as “Goa”
Click on Sign up
User above used details for login
Verify user is able to login
Click on Logout and verify user is able to see login page
*/
describe('New User Creation Scenario', () => {
it('Create new user and login with same user using CSS', () => {
cy.visit("https://ineuron-courses.vercel.app/")
cy.get('.navbar-menu-parent button').click()
cy.contains('New user? Signup').click()
cy.get('.submit-btn').should('be.disabled')
cy.get('#name').type('Misthi Deyol').should('contain.value','Misthi Deyol')
cy.get('#email').type('[email protected]').should('contain.value','misthi')
cy.get('#password').type('test@123')
cy.get("input[name='63076c4329bb13ec21816100']").check()
cy.get('input[value=Male]').check()
cy.get('select[name=state]').select('Goa')
cy.get('.submit-btn').click()
cy.get('#email1').type('[email protected]')
cy.get('#password1').type('test@123')
cy.get("button[type='submit']").click()
cy.get("div[class='navbar-menu-links'] button").click()
cy.get('#email1').should('be.empty')
});
it.only('Create new user and login with same user using XPATH', () => {
cy.visit("https://ineuron-courses.vercel.app/")
cy.xpath("//button[contains(text(),'Log in')]").click()
cy.contains('New user? Signup').click()
cy.xpath("//button[@type='submit']").should('be.disabled')
cy.xpath("//input[@id='name']").type('Misthi Deyol').should('contain.value','Misthi Deyol')
cy.xpath("//input[@id='email']").type('[email protected]').should('contain.value','Misthi')
cy.xpath("//input[@id='password']").type('test@123')
cy.xpath("//input[@name='63076c4329bb13ec21816100']").check()
cy.xpath("//input[@id='gender' and @value='Male']").check()
cy.xpath("//select[@id='state']").select('Goa')
cy.xpath("//button[@type='submit']").click()
cy.xpath("//input[@name='email1']").type('[email protected]')
cy.xpath("//input[@type='password']").type('test@123')
cy.xpath("//button[contains(.,'Sign in')]").click()
cy.xpath("//button[contains(.,'Sign out')]").click()
});
});