Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <reference types="cypress" />
- context("Actions", () => {
- beforeEach(() => {});
- // https://on.cypress.io/interacting-with-elements
- let loginPage = {
- textboxUserName: cy.get('#userName'),
- textboxUserEmail: cy.get('#userEmail'),
- textboxSubmit: cy.get('#submit'),
- }
- it("DEMO CYPRESS", () => {
- // https://on.cypress.io/type
- cy.visit("https://demoqa.com/automation-practice-form");
- cy.get("#firstName").type("Spas");
- cy.get("#lastName").type("Genov");
- cy.get("#userEmailNEW").type("spaz@mail.com");
- cy.get("#gender-radio-1").check({ force: true });
- cy.get("#userNumber").type("0888555555555");
- cy.get("#dateOfBirthInput").click();
- cy.get('div [aria-label="Choose Sunday, April 4th, 2021"]').click();
- cy.get("#subjectsContainer").type("TEST");
- cy.get("#hobbies-checkbox-1").check({ force: true });
- cy.get("#hobbies-checkbox-2").check({ force: true });
- cy.get("#currentAddress").type("test test test");
- cy.contains("Select State").click();
- cy.get("#react-select-3-option-2").click();
- cy.get("#submit").click();
- cy.get('.modal-header').should("contain", "Thanks for submitting the form")
- cy.get('.modal-header').should("be.visible")
- cy.get("tbody > tr").last().find("td").first().should("contain", "State and City")
- });
- it("DEMO CYPRESS2", () => {
- // https://on.cypress.io/type
- cy.visit("https://demoqa.com/automation-practice-form");
- cy.get("#firstName").type("Spas");
- cy.get("#lastName").type("Genov");
- cy.get("#userEmail").type("spaz@mail.com");
- cy.get("#gender-radio-1").check({ force: true });
- cy.get("#gender-radio-1").should("be.checked")
- });
- it("Validation text box", () => {
- // Page Object model
- cy.visit("https://demoqa.com/text-box");
- loginPage.textboxUserEmail.type("Spas")
- loginPage.textboxUserName.type("genov")
- loginPage.textboxSubmit.click()
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement