diff --git a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/1-fork.cy.js b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/1-fork.cy.js index 1d08db935..97a2e3f65 100644 --- a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/1-fork.cy.js +++ b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/1-fork.cy.js @@ -4,6 +4,7 @@ import { AdminBarCheck, DarkBGCheck, LightBGCheck, OptionsDetails } from "../wp- describe( 'SiteGen Fork Step', function () { before( () => { + cy.exec('npx wp-env run cli wp option delete nfd_module_onboarding_flow'); cy.exec(`npx wp-env run cli wp option set _transient_nfd_site_capabilities '{"hasAISiteGen": true, "canAccessAI": true}' --format=json`); cy.exec(`npx wp-env run cli wp option set _transient_timeout_nfd_site_capabilities 4102444800`); cy.wait(10000); @@ -49,13 +50,12 @@ describe( 'SiteGen Fork Step', function () { arr.each( () => { if(options == 0){ OptionsDetails(className,'Guided Configuration',options); - cy.url().should('include', 'get-started/welcome',{ - timeout: 10000, - } ); - cy.go('back'); }; if(options == 1){ OptionsDetails(className,'AI Website Creator',options); + cy.get(className) + .eq(options) + .click(); cy.url().should('include', 'sitegen/step/welcome',{ timeout: 10000, } ); diff --git a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/3-site-details.cy.js b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/3-site-details.cy.js index 254226ffd..b07ca89d1 100644 --- a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/3-site-details.cy.js +++ b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/3-site-details.cy.js @@ -22,7 +22,7 @@ describe( 'SiteGen Site Details Step', function () { } ); it( 'Check the Progress Bar Value', () => { - ProgressBarCheck('12.5%'); + ProgressBarCheck('14.2857%'); }); it( 'Check if the Next Button is disabled when no prompt is entered', () => { diff --git a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/4-site-logo.cy.js b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/4-site-logo.cy.js index be67644e4..131a81dc8 100644 --- a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/4-site-logo.cy.js +++ b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/4-site-logo.cy.js @@ -22,7 +22,7 @@ describe( 'SiteGen Site Logo Step', function() { } ); it( 'Check the Progress Bar Value', () => { - ProgressBarCheck( '37.5%' ); + ProgressBarCheck( '42.8571%' ); } ); it( 'Check for back button and go back', () => { @@ -30,11 +30,11 @@ describe( 'SiteGen Site Logo Step', function() { } ); it( 'Check if the heading is visible', () => { - cy.get( '.ai-heading' ).should( 'be.visible' ); + cy.get( '.ai-heading', {timeout:20000} ).should( 'be.visible' ); } ); - it( 'Check for the skip button and click', () => { - SkipButtonCheck( 'sitegen/step/site-logo' ); + it( 'Check for the skip button', () => { + SkipButtonCheck(); } ); it( 'Check if the Next Button is disabled when there is no logo', () => { @@ -61,6 +61,8 @@ describe( 'SiteGen Site Logo Step', function() { .scrollIntoView() .should( 'be.visible' ); } ); + cy.get( '.nfd-onboarding-button--site-gen-next' ) + .should( 'not.be.disabled' ); } ); it.skip( 'Check if the Next Button is enabled and go next', () => { diff --git a/tests/cypress/integration/wp-module-support/siteGen.cy.js b/tests/cypress/integration/wp-module-support/siteGen.cy.js index 1ec6e2068..cbd9e7a70 100644 --- a/tests/cypress/integration/wp-module-support/siteGen.cy.js +++ b/tests/cypress/integration/wp-module-support/siteGen.cy.js @@ -1,7 +1,7 @@ // export const AdminBarCheck = () => { - cy.get( '.nfd-onboarding-header__admin-bar', {timeout:60000} ).should('be.visible'); + cy.get( '.nfd-onboarding-header__admin-bar', {timeout:120000} ).should('be.visible'); }; export const DarkBGCheck = () => { @@ -23,16 +23,11 @@ export const LightBGCheck = () => { }; export const OptionsDetails = (className,textValue,optionsValue) => { - cy.get(className) + cy.get(className, {timeout:10000}) .eq(optionsValue) .find('.nfd-onboarding-sitegen-options__container__heading__title') .invoke( 'text' ) .should('contain', textValue); - if(optionsValue!=2){ // Excluding the Last Option as it takes to new tab, just validating the title text - cy.get(className) - .eq(optionsValue) - .click(); - }; }; export const ProgressBarCheck = ( WidthPercent ) => { @@ -53,13 +48,10 @@ export const BackButtonCheck = (currURL) => { cy.go('back'); }; -export const SkipButtonCheck = (currURL) => { +export const SkipButtonCheck = () => { cy.get('.skip-button') .should('be.visible') - .contains('Skip for now') - .click(); - cy.url().should('not.contain', currURL); - cy.go('back'); + .contains('Skip for now'); }; export const DisabledNextButton = () => {