From 93cc06baf24a11a8be4e328c910cf67163a88a83 Mon Sep 17 00:00:00 2001 From: Avneet Raj Date: Fri, 12 Jan 2024 13:17:28 +0530 Subject: [PATCH] add welcome step tests --- .../welcome.cy.js | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 tests/cypress/integration/5-AI-SiteGen-onboarding-flow/welcome.cy.js diff --git a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/welcome.cy.js b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/welcome.cy.js new file mode 100644 index 000000000..82f824cf1 --- /dev/null +++ b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/welcome.cy.js @@ -0,0 +1,59 @@ +// + +import { AdminBarCheck, BackButtonCheck, DarkBGCheck, LightBGChcek, ProgressBarCheck} from "../wp-module-support/siteGen.cy"; + +describe( 'SiteGen Welcome Step', function () { + before( () => { + cy.visit( + 'wp-admin/?page=nfd-onboarding#/sitegen/step/welcome' + ); + } ); + + it( 'Check for the header admin bar', () => { + AdminBarCheck(); + } ); + + it( 'Check for the existing dark background', () => { + DarkBGCheck(); + } ); + + it( 'Check for the light background', () => { + LightBGChcek(); + } ); + + it( 'Check the Progress Bar Value', () => { + ProgressBarCheck('11.1111%'); + }); + + it( 'Check for back button and go back', () => { + BackButtonCheck('sitegen/step/welcome'); + } ); + + it( 'Check for the animation', () => { + cy.get( '.nfd-onboarding-step--site-gen__welcome__container__animation' ) + .should('be.visible'); + } ); + + it( 'Check for the heading title', () => { + cy.get( '.nfd-onboarding-step--site-gen__welcome__container__heading__text' ) + .should('be.visible') + .contains('WordPress'); + } ); + + it( 'Check for the subheading title', () => { + cy.get('.nfd-onboarding-step--site-gen__welcome__container__sub-heading') + .should('exist'); + cy.get( '.nfd-onboarding-step--site-gen__welcome__container__sub-heading__text' ) + .should('be.visible') + .contains('AI'); + } ); + + it( 'Check the Get Started button', () => { + cy.get( '.nfd-onboarding-button--site-gen-next' ) + .should('be.visible') + .should('have.text','Get Started') + .click(); + cy.wait(2000); + cy.url().should('not.contain', 'sitegen/step/welcome'); + } ); +});