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

PRESS2-1485 Cypress Tests for SiteGen Welcome Step #411

Merged
merged 1 commit into from
Jan 12, 2024
Merged
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
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');
} );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an assertion to verify if next step is site-detail step or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we don't require this. As, in future, if we have the order changes, the test will start to fail. So, this will be sufficient to test that we jump onto the next step.
We have used the same approach in the earlier onboarding flow also.

});