Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added registration form automation test #518

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions cypress/e2e/registration.cy.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,38 @@
/// <reference types='cypress' />
/// <reference types="cypress" />

describe('Student Registration page', () => {
before(() => {

cy.visit('https://demoqa.com/automation-practice-form');
});

it('', () => {
it('fills in the registration form and submits it', () => {
cy.get('#firstName').type('John');
cy.get('#lastName').type('Doe');

cy.get('#userEmail').type('[email protected]');

cy.get('#genterWrapper').find('label').contains('Male').click();

cy.get('#userNumber').type('1234567890');

cy.get('#dateOfBirthInput').click();
cy.get('.react-datepicker__month-select').select('May');
cy.get('.react-datepicker__year-select').select('1990');
cy.get('.react-datepicker__day--015').click();

cy.get('#subjectsInput').type('Maths{enter}');

cy.get('#hobbiesWrapper').find('label').contains('Sports').click();

cy.get('#currentAddress').type('123 Main St, Cityville');

cy.get('#submit').click();

cy.get('.modal-content').should('be.visible');
cy.get('.table-responsive').should('contain', 'John Doe');
cy.get('.table-responsive').should('contain', '[email protected]');
cy.get('.table-responsive').should('contain', 'Male');
cy.get('.table-responsive').should('contain', '1234567890');
});
});