Skip to content

Commit

Permalink
Merge pull request #411 from newfold-labs/add-welcome-step-tests
Browse files Browse the repository at this point in the history
PRESS2-1485 Cypress Tests for SiteGen Welcome Step
  • Loading branch information
avneet-raj authored Jan 12, 2024
2 parents 6aa3c2a + 93cc06b commit 0a6e6af
Showing 1 changed file with 59 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// <reference types="Cypress" />

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');
} );
});

0 comments on commit 0a6e6af

Please sign in to comment.