From 6aceeec0899d0cf74bcc1dddcded074d2c988d0a Mon Sep 17 00:00:00 2001 From: Avneet Raj Date: Thu, 22 Feb 2024 16:05:54 +0530 Subject: [PATCH 1/7] fix existing failing tests --- .../1-Initial-steps/branding.cy.js | 6 +++ .../get-started-welcome.cy.js | 44 ++++++++++--------- .../get-started-welcome.cy.js | 44 ++++++++++--------- 3 files changed, 54 insertions(+), 40 deletions(-) diff --git a/tests/cypress/integration/1-Initial-steps/branding.cy.js b/tests/cypress/integration/1-Initial-steps/branding.cy.js index a45be4d90..57b550dd0 100644 --- a/tests/cypress/integration/1-Initial-steps/branding.cy.js +++ b/tests/cypress/integration/1-Initial-steps/branding.cy.js @@ -9,6 +9,12 @@ describe( 'Branding', function () { // since we are setting brand from plugin container, it will not be set to "newfold" // by default even if mm_brand option is deleted from the database it( 'Has ' + GetPluginId() + ' class when mm_brand does not exist.', () => { + if(cy.url().should('contains','fork')){ + cy.get('.nfd-onboarding-sitegen-options__container__options') + .eq(0) + .should('be.visible') + .click(); + }; cy.exec( 'npx wp-env run cli wp option delete mm_brand' ); cy.reload(); if(GetPluginId()=='hostgator'){ diff --git a/tests/cypress/integration/2-general-onboarding-flow/get-started-welcome.cy.js b/tests/cypress/integration/2-general-onboarding-flow/get-started-welcome.cy.js index 798f73227..68d2ecde7 100644 --- a/tests/cypress/integration/2-general-onboarding-flow/get-started-welcome.cy.js +++ b/tests/cypress/integration/2-general-onboarding-flow/get-started-welcome.cy.js @@ -32,19 +32,19 @@ describe( 'Get Started Welcome Page', function () { } ); } ); - it( 'Check Exit to Wordpress button is visible and clickable and continue flow', () => { - cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); - cy.get( '.nfd-onboarding-etw__buttons > .is-secondary' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); - } ); + // it( 'Check Exit to Wordpress button is visible and clickable and continue flow', () => { + // cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); + // cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); + // cy.get( '.nfd-onboarding-etw__buttons > .is-secondary' ).click(); + // cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); + // } ); - it( 'Check Exit to Wordpress button is visible and clickable and cancel', () => { - cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); - cy.get( '.components-modal__header > button' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); - } ); + // it( 'Check Exit to Wordpress button is visible and clickable and cancel', () => { + // cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); + // cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); + // cy.get( '.components-modal__header > button' ).click(); + // cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); + // } ); it( 'Check if the Suppressed Drawer does not open on clicking Toggle Button', () => { CheckDrawerDisabled(); @@ -84,8 +84,12 @@ describe( 'Get Started Welcome Page', function () { GetPluginName(); } ); - it( 'Check navigation back is not visible', () => { - cy.get( '.navigation-buttons_back' ).should( 'not.exist' ); + it( 'Check navigation back is visible and go one step back', () => { + cy.get( '.navigation-buttons_back' ) + .should( 'exist' ) + .click(); + cy.url().should('not.include','#/wp-setup/step/get-started/welcome' ); + cy.go('back'); } ); it( 'Check if next step loads on clicking navigation next', () => { @@ -94,10 +98,10 @@ describe( 'Get Started Welcome Page', function () { cy.get('.navigation-buttons_back').click(); } ); - it( 'Check Exit to Wordpress button is visible and clickable and exit flow', () => { - cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); - cy.get( '.nfd-onboarding-etw__buttons > .is-primary' ).click(); - cy.url().should( 'not.contain', '#/wp-setup/step/get-started/welcome' ); - } ); + // it( 'Check Exit to Wordpress button is visible and clickable and exit flow', () => { + // cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); + // cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); + // cy.get( '.nfd-onboarding-etw__buttons > .is-primary' ).click(); + // cy.url().should( 'not.contain', '#/wp-setup/step/get-started/welcome' ); + // } ); } ); diff --git a/tests/cypress/integration/3-ecommerce-onboarding-flow/get-started-welcome.cy.js b/tests/cypress/integration/3-ecommerce-onboarding-flow/get-started-welcome.cy.js index 0752c9380..78a728fc6 100644 --- a/tests/cypress/integration/3-ecommerce-onboarding-flow/get-started-welcome.cy.js +++ b/tests/cypress/integration/3-ecommerce-onboarding-flow/get-started-welcome.cy.js @@ -32,19 +32,19 @@ describe( 'Get Started Welcome Page', function () { } ); } ); - it( 'Check Exit to Wordpress button is visible and clickable and continue flow', () => { - cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); - cy.get( '.nfd-onboarding-etw__buttons > .is-secondary' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); - } ); + // it( 'Check Exit to Wordpress button is visible and clickable and continue flow', () => { + // cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); + // cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); + // cy.get( '.nfd-onboarding-etw__buttons > .is-secondary' ).click(); + // cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); + // } ); - it( 'Check Exit to Wordpress button is visible and clickable and cancel', () => { - cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); - cy.get( '.components-modal__header > button' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); - } ); + // it( 'Check Exit to Wordpress button is visible and clickable and cancel', () => { + // cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); + // cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); + // cy.get( '.components-modal__header > button' ).click(); + // cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); + // } ); it( 'Check if the Suppressed Drawer does not open on clicking Toggle Button', () => { CheckDrawerDisabled(); @@ -83,8 +83,12 @@ describe( 'Get Started Welcome Page', function () { GetPluginName(); } ); - it( 'Check navigation back is not visible', () => { - cy.get( '.navigation-buttons_back' ).should( 'not.exist' ); + it( 'Check navigation back is visible and go one step back', () => { + cy.get( '.navigation-buttons_back' ) + .should( 'exist' ) + .click(); + cy.url().should('not.include','#/wp-setup/step/get-started/welcome' ); + cy.go('back'); } ); it( 'Check if next step loads on clicking navigation next', () => { @@ -93,10 +97,10 @@ describe( 'Get Started Welcome Page', function () { cy.get('.navigation-buttons_back').click(); } ); - it( 'Check Exit to Wordpress button is visible and clickable and exit flow', () => { - cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); - cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); - cy.get( '.nfd-onboarding-etw__buttons > .is-primary' ).click(); - cy.url().should( 'not.contain', '#/wp-setup/step/get-started/welcome' ); - } ); + // it( 'Check Exit to Wordpress button is visible and clickable and exit flow', () => { + // cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); + // cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); + // cy.get( '.nfd-onboarding-etw__buttons > .is-primary' ).click(); + // cy.url().should( 'not.contain', '#/wp-setup/step/get-started/welcome' ); + // } ); } ); From b9d0b309bab4b609e3a2aa6da25688bf549570b5 Mon Sep 17 00:00:00 2001 From: Avneet Raj Date: Thu, 22 Feb 2024 17:11:25 +0530 Subject: [PATCH 2/7] add wait in branding step --- tests/cypress/integration/1-Initial-steps/branding.cy.js | 3 ++- .../2-general-onboarding-flow/get-started-welcome.cy.js | 8 ++------ .../3-ecommerce-onboarding-flow/get-started-welcome.cy.js | 8 ++------ 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/tests/cypress/integration/1-Initial-steps/branding.cy.js b/tests/cypress/integration/1-Initial-steps/branding.cy.js index 57b550dd0..76c4700da 100644 --- a/tests/cypress/integration/1-Initial-steps/branding.cy.js +++ b/tests/cypress/integration/1-Initial-steps/branding.cy.js @@ -10,7 +10,8 @@ describe( 'Branding', function () { // by default even if mm_brand option is deleted from the database it( 'Has ' + GetPluginId() + ' class when mm_brand does not exist.', () => { if(cy.url().should('contains','fork')){ - cy.get('.nfd-onboarding-sitegen-options__container__options') + cy.wait(5000); + cy.get('.nfd-onboarding-sitegen-options__container__options', {timeout:10000}) .eq(0) .should('be.visible') .click(); diff --git a/tests/cypress/integration/2-general-onboarding-flow/get-started-welcome.cy.js b/tests/cypress/integration/2-general-onboarding-flow/get-started-welcome.cy.js index 68d2ecde7..23991fea7 100644 --- a/tests/cypress/integration/2-general-onboarding-flow/get-started-welcome.cy.js +++ b/tests/cypress/integration/2-general-onboarding-flow/get-started-welcome.cy.js @@ -84,12 +84,8 @@ describe( 'Get Started Welcome Page', function () { GetPluginName(); } ); - it( 'Check navigation back is visible and go one step back', () => { - cy.get( '.navigation-buttons_back' ) - .should( 'exist' ) - .click(); - cy.url().should('not.include','#/wp-setup/step/get-started/welcome' ); - cy.go('back'); + it( 'Check navigation back is visible', () => { + cy.get( '.navigation-buttons_back' ).should('exist'); } ); it( 'Check if next step loads on clicking navigation next', () => { diff --git a/tests/cypress/integration/3-ecommerce-onboarding-flow/get-started-welcome.cy.js b/tests/cypress/integration/3-ecommerce-onboarding-flow/get-started-welcome.cy.js index 78a728fc6..9fd1c3c52 100644 --- a/tests/cypress/integration/3-ecommerce-onboarding-flow/get-started-welcome.cy.js +++ b/tests/cypress/integration/3-ecommerce-onboarding-flow/get-started-welcome.cy.js @@ -83,12 +83,8 @@ describe( 'Get Started Welcome Page', function () { GetPluginName(); } ); - it( 'Check navigation back is visible and go one step back', () => { - cy.get( '.navigation-buttons_back' ) - .should( 'exist' ) - .click(); - cy.url().should('not.include','#/wp-setup/step/get-started/welcome' ); - cy.go('back'); + it( 'Check navigation back is visible', () => { + cy.get( '.navigation-buttons_back' ).should( 'exist' ); } ); it( 'Check if next step loads on clicking navigation next', () => { From 81e66d3dd154d5fc035b6ce369271e4d32e0a697 Mon Sep 17 00:00:00 2001 From: Avneet Raj Date: Thu, 22 Feb 2024 18:00:07 +0530 Subject: [PATCH 3/7] update ai sitegen steps --- tests/cypress/integration/1-Initial-steps/branding.cy.js | 2 +- .../5-AI-SiteGen-onboarding-flow/{fork.cy.js => 1-fork.cy.js} | 4 ++++ .../{welcome.cy.js => 2-welcome.cy.js} | 0 .../{site-details.cy.js => 3-site-details.cy.js} | 0 .../{site-logo.cy.js => 4-site-logo.cy.js} | 0 .../{experience.cy.js => 5-experience.cy.js} | 0 .../{preview.cy.js => 6-preview.cy.js} | 0 7 files changed, 5 insertions(+), 1 deletion(-) rename tests/cypress/integration/5-AI-SiteGen-onboarding-flow/{fork.cy.js => 1-fork.cy.js} (89%) rename tests/cypress/integration/5-AI-SiteGen-onboarding-flow/{welcome.cy.js => 2-welcome.cy.js} (100%) rename tests/cypress/integration/5-AI-SiteGen-onboarding-flow/{site-details.cy.js => 3-site-details.cy.js} (100%) rename tests/cypress/integration/5-AI-SiteGen-onboarding-flow/{site-logo.cy.js => 4-site-logo.cy.js} (100%) rename tests/cypress/integration/5-AI-SiteGen-onboarding-flow/{experience.cy.js => 5-experience.cy.js} (100%) rename tests/cypress/integration/5-AI-SiteGen-onboarding-flow/{preview.cy.js => 6-preview.cy.js} (100%) diff --git a/tests/cypress/integration/1-Initial-steps/branding.cy.js b/tests/cypress/integration/1-Initial-steps/branding.cy.js index 76c4700da..73ba459af 100644 --- a/tests/cypress/integration/1-Initial-steps/branding.cy.js +++ b/tests/cypress/integration/1-Initial-steps/branding.cy.js @@ -11,7 +11,7 @@ describe( 'Branding', function () { it( 'Has ' + GetPluginId() + ' class when mm_brand does not exist.', () => { if(cy.url().should('contains','fork')){ cy.wait(5000); - cy.get('.nfd-onboarding-sitegen-options__container__options', {timeout:10000}) + cy.get('.nfd-onboarding-sitegen-options__container__options', {timeout:30000}) .eq(0) .should('be.visible') .click(); diff --git a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/fork.cy.js b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/1-fork.cy.js similarity index 89% rename from tests/cypress/integration/5-AI-SiteGen-onboarding-flow/fork.cy.js rename to tests/cypress/integration/5-AI-SiteGen-onboarding-flow/1-fork.cy.js index 68e664288..27bc39c34 100644 --- a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/fork.cy.js +++ b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/1-fork.cy.js @@ -4,9 +4,13 @@ import { AdminBarCheck, DarkBGCheck, LightBGCheck, OptionsDetails } from "../wp- describe( 'SiteGen Fork Step', function () { before( () => { + cy.exec( `npx wp-env run cli wp option set _transient_nfd_site_capabilities '{"isJarvis": true}' --format=json` ); + cy.exec( `npx wp-env run cli wp option set _transient_timeout_nfd_site_capabilities 4102444800` ); + cy.wait(10000); cy.visit( 'wp-admin/?page=nfd-onboarding#/wp-setup/step/fork' ); + cy.wait(5000); } ); it( 'Check for the header admin bar', () => { diff --git a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/welcome.cy.js b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/2-welcome.cy.js similarity index 100% rename from tests/cypress/integration/5-AI-SiteGen-onboarding-flow/welcome.cy.js rename to tests/cypress/integration/5-AI-SiteGen-onboarding-flow/2-welcome.cy.js diff --git a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/site-details.cy.js b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/3-site-details.cy.js similarity index 100% rename from tests/cypress/integration/5-AI-SiteGen-onboarding-flow/site-details.cy.js rename to tests/cypress/integration/5-AI-SiteGen-onboarding-flow/3-site-details.cy.js diff --git a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/site-logo.cy.js b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/4-site-logo.cy.js similarity index 100% rename from tests/cypress/integration/5-AI-SiteGen-onboarding-flow/site-logo.cy.js rename to tests/cypress/integration/5-AI-SiteGen-onboarding-flow/4-site-logo.cy.js diff --git a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/experience.cy.js b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/5-experience.cy.js similarity index 100% rename from tests/cypress/integration/5-AI-SiteGen-onboarding-flow/experience.cy.js rename to tests/cypress/integration/5-AI-SiteGen-onboarding-flow/5-experience.cy.js diff --git a/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/preview.cy.js b/tests/cypress/integration/5-AI-SiteGen-onboarding-flow/6-preview.cy.js similarity index 100% rename from tests/cypress/integration/5-AI-SiteGen-onboarding-flow/preview.cy.js rename to tests/cypress/integration/5-AI-SiteGen-onboarding-flow/6-preview.cy.js From cd8f7a2c30569c52dda3b523cb3228f645f5c14b Mon Sep 17 00:00:00 2001 From: Avneet Raj Date: Fri, 23 Feb 2024 14:14:29 +0530 Subject: [PATCH 4/7] Update tests --- .github/workflows/brand-plugin-test.yml | 1 + .../1-Initial-steps/branding.cy.js | 9 +---- .../basic-info.cy.js | 6 ++-- .../get-started-welcome.cy.js | 36 +++++++++---------- .../get-started-welcome.cy.js | 36 +++++++++---------- .../4-design-steps/colors-step.cy.js | 2 ++ .../5-AI-SiteGen-onboarding-flow/1-fork.cy.js | 3 +- 7 files changed, 44 insertions(+), 49 deletions(-) diff --git a/.github/workflows/brand-plugin-test.yml b/.github/workflows/brand-plugin-test.yml index 024e1e6e8..7d3b15445 100644 --- a/.github/workflows/brand-plugin-test.yml +++ b/.github/workflows/brand-plugin-test.yml @@ -39,6 +39,7 @@ jobs: needs: setup uses: newfold-labs/workflows/.github/workflows/module-plugin-test.yml@main with: + plugin-branch: 'fix/failing-onboarding-tests' module-repo: ${{ github.repository }} module-branch: ${{ needs.setup.outputs.branch }} plugin-repo: "newfold-labs/wp-plugin-hostgator" diff --git a/tests/cypress/integration/1-Initial-steps/branding.cy.js b/tests/cypress/integration/1-Initial-steps/branding.cy.js index 73ba459af..ba2a8f214 100644 --- a/tests/cypress/integration/1-Initial-steps/branding.cy.js +++ b/tests/cypress/integration/1-Initial-steps/branding.cy.js @@ -3,19 +3,12 @@ import { GetPluginId, GetPluginName } from '../wp-module-support/pluginID.cy'; describe( 'Branding', function () { before( () => { - cy.visit( 'wp-admin/index.php?page=nfd-onboarding' ); + cy.visit( 'wp-admin/index.php?page=nfd-onboarding#/wp-setup/step/get-started/welcome' ); } ); // since we are setting brand from plugin container, it will not be set to "newfold" // by default even if mm_brand option is deleted from the database it( 'Has ' + GetPluginId() + ' class when mm_brand does not exist.', () => { - if(cy.url().should('contains','fork')){ - cy.wait(5000); - cy.get('.nfd-onboarding-sitegen-options__container__options', {timeout:30000}) - .eq(0) - .should('be.visible') - .click(); - }; cy.exec( 'npx wp-env run cli wp option delete mm_brand' ); cy.reload(); if(GetPluginId()=='hostgator'){ diff --git a/tests/cypress/integration/2-general-onboarding-flow/basic-info.cy.js b/tests/cypress/integration/2-general-onboarding-flow/basic-info.cy.js index 09ae733bd..b22f05e3c 100644 --- a/tests/cypress/integration/2-general-onboarding-flow/basic-info.cy.js +++ b/tests/cypress/integration/2-general-onboarding-flow/basic-info.cy.js @@ -182,9 +182,9 @@ describe( 'Basic Info Page', function () { ); } else{ - cy.get( '.Tooltip-Wrapper', { timeout: 3000 } ).should( 'exist' ); - cy.get( '.Tooltip-Tip', { timeout: 3000 } ) - .should( 'be.visible' ); + cy.get( '.Tooltip-Tip', { timeout: 3000 } ).should( 'be.visible' ); + cy.get( '.navigation-buttons_next' ).click(); + cy.get( '.components-modal__content' ).should( 'be.visible' ); }; cy.get( '.components-modal__header button' , { timeout: customCommandTimeout } ).click(); diff --git a/tests/cypress/integration/2-general-onboarding-flow/get-started-welcome.cy.js b/tests/cypress/integration/2-general-onboarding-flow/get-started-welcome.cy.js index 23991fea7..c07993ab1 100644 --- a/tests/cypress/integration/2-general-onboarding-flow/get-started-welcome.cy.js +++ b/tests/cypress/integration/2-general-onboarding-flow/get-started-welcome.cy.js @@ -32,19 +32,19 @@ describe( 'Get Started Welcome Page', function () { } ); } ); - // it( 'Check Exit to Wordpress button is visible and clickable and continue flow', () => { - // cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); - // cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); - // cy.get( '.nfd-onboarding-etw__buttons > .is-secondary' ).click(); - // cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); - // } ); + it( 'Check Exit to Wordpress button is visible and clickable and continue flow', () => { + cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); + cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); + cy.get( '.nfd-onboarding-etw__buttons > .is-secondary' ).click(); + cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); + } ); - // it( 'Check Exit to Wordpress button is visible and clickable and cancel', () => { - // cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); - // cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); - // cy.get( '.components-modal__header > button' ).click(); - // cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); - // } ); + it( 'Check Exit to Wordpress button is visible and clickable and cancel', () => { + cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); + cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); + cy.get( '.components-modal__header > button' ).click(); + cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); + } ); it( 'Check if the Suppressed Drawer does not open on clicking Toggle Button', () => { CheckDrawerDisabled(); @@ -94,10 +94,10 @@ describe( 'Get Started Welcome Page', function () { cy.get('.navigation-buttons_back').click(); } ); - // it( 'Check Exit to Wordpress button is visible and clickable and exit flow', () => { - // cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); - // cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); - // cy.get( '.nfd-onboarding-etw__buttons > .is-primary' ).click(); - // cy.url().should( 'not.contain', '#/wp-setup/step/get-started/welcome' ); - // } ); + it( 'Check Exit to Wordpress button is visible and clickable and exit flow', () => { + cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); + cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); + cy.get( '.nfd-onboarding-etw__buttons > .is-primary' ).click(); + cy.url().should( 'not.contain', '#/wp-setup/step/get-started/welcome' ); + } ); } ); diff --git a/tests/cypress/integration/3-ecommerce-onboarding-flow/get-started-welcome.cy.js b/tests/cypress/integration/3-ecommerce-onboarding-flow/get-started-welcome.cy.js index 9fd1c3c52..6f24fc950 100644 --- a/tests/cypress/integration/3-ecommerce-onboarding-flow/get-started-welcome.cy.js +++ b/tests/cypress/integration/3-ecommerce-onboarding-flow/get-started-welcome.cy.js @@ -32,19 +32,19 @@ describe( 'Get Started Welcome Page', function () { } ); } ); - // it( 'Check Exit to Wordpress button is visible and clickable and continue flow', () => { - // cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); - // cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); - // cy.get( '.nfd-onboarding-etw__buttons > .is-secondary' ).click(); - // cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); - // } ); + it( 'Check Exit to Wordpress button is visible and clickable and continue flow', () => { + cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); + cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); + cy.get( '.nfd-onboarding-etw__buttons > .is-secondary' ).click(); + cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); + } ); - // it( 'Check Exit to Wordpress button is visible and clickable and cancel', () => { - // cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); - // cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); - // cy.get( '.components-modal__header > button' ).click(); - // cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); - // } ); + it( 'Check Exit to Wordpress button is visible and clickable and cancel', () => { + cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); + cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); + cy.get( '.components-modal__header > button' ).click(); + cy.get( '.components-modal__screen-overlay' ).should( 'not.exist' ); + } ); it( 'Check if the Suppressed Drawer does not open on clicking Toggle Button', () => { CheckDrawerDisabled(); @@ -93,10 +93,10 @@ describe( 'Get Started Welcome Page', function () { cy.get('.navigation-buttons_back').click(); } ); - // it( 'Check Exit to Wordpress button is visible and clickable and exit flow', () => { - // cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); - // cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); - // cy.get( '.nfd-onboarding-etw__buttons > .is-primary' ).click(); - // cy.url().should( 'not.contain', '#/wp-setup/step/get-started/welcome' ); - // } ); + it( 'Check Exit to Wordpress button is visible and clickable and exit flow', () => { + cy.get( '.nfd-onboarding-etw__trigger' ).should( 'be.visible' ).click(); + cy.get( '.components-modal__screen-overlay' ).should( 'be.visible' ); + cy.get( '.nfd-onboarding-etw__buttons > .is-primary' ).click(); + cy.url().should( 'not.contain', '#/wp-setup/step/get-started/welcome' ); + } ); } ); diff --git a/tests/cypress/integration/4-design-steps/colors-step.cy.js b/tests/cypress/integration/4-design-steps/colors-step.cy.js index 3d15da0da..96e4b18ee 100644 --- a/tests/cypress/integration/4-design-steps/colors-step.cy.js +++ b/tests/cypress/integration/4-design-steps/colors-step.cy.js @@ -11,6 +11,8 @@ import { describe( 'Colors Step Test', function () { before( () => { + cy.exec('npx wp-env run cli wp theme activate yith-wonder'); + cy.wait(5000); cy.visit( 'wp-admin/?page=nfd-onboarding#/wp-setup/step/design/colors' ); 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 27bc39c34..2621dd86d 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,8 +4,7 @@ import { AdminBarCheck, DarkBGCheck, LightBGCheck, OptionsDetails } from "../wp- describe( 'SiteGen Fork Step', function () { before( () => { - cy.exec( `npx wp-env run cli wp option set _transient_nfd_site_capabilities '{"isJarvis": true}' --format=json` ); - cy.exec( `npx wp-env run cli wp option set _transient_timeout_nfd_site_capabilities 4102444800` ); + cy.exec( `npx wp-env run cli wp transient set nfd_site_capabilities '{"hasAISitegGen": true, "canAccessAI": true}' --format=json 4102444800` ); cy.wait(10000); cy.visit( 'wp-admin/?page=nfd-onboarding#/wp-setup/step/fork' From 7a4c31755a93c17e994e7fc156b35b7bfc84316d Mon Sep 17 00:00:00 2001 From: Avneet Raj Date: Fri, 23 Feb 2024 16:20:29 +0530 Subject: [PATCH 5/7] update the exec command in the fork step --- .../integration/5-AI-SiteGen-onboarding-flow/1-fork.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2621dd86d..b20ec46d4 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,7 +4,7 @@ import { AdminBarCheck, DarkBGCheck, LightBGCheck, OptionsDetails } from "../wp- describe( 'SiteGen Fork Step', function () { before( () => { - cy.exec( `npx wp-env run cli wp transient set nfd_site_capabilities '{"hasAISitegGen": true, "canAccessAI": true}' --format=json 4102444800` ); + cy.exec(`npx wp-env run cli wp transient set nfd_site_capabilities '{\"hasAISitegGen\": true, \"canAccessAI\": true}' --format=json 4102444800`); cy.wait(10000); cy.visit( 'wp-admin/?page=nfd-onboarding#/wp-setup/step/fork' From 253649845e2913f5166f01b2122a72be4989bc7d Mon Sep 17 00:00:00 2001 From: Avneet Raj Date: Mon, 26 Feb 2024 12:08:48 +0530 Subject: [PATCH 6/7] update setting up the capabilities to use wp option cli --- .../integration/5-AI-SiteGen-onboarding-flow/1-fork.cy.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 b20ec46d4..3792754d7 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,7 +4,8 @@ import { AdminBarCheck, DarkBGCheck, LightBGCheck, OptionsDetails } from "../wp- describe( 'SiteGen Fork Step', function () { before( () => { - cy.exec(`npx wp-env run cli wp transient set nfd_site_capabilities '{\"hasAISitegGen\": true, \"canAccessAI\": true}' --format=json 4102444800`); + cy.exec(`npx wp-env run cli wp option set _transient_nfd_site_capabilities '{"hasAISitegGen": true, "canAccessAI": true}' --format=json`); + cy.exec(`npx wp-env run cli wp option set _transient_timeout_nfd_site_capabilities 4102444800`); cy.wait(10000); cy.visit( 'wp-admin/?page=nfd-onboarding#/wp-setup/step/fork' From 9d49653fecf7c439399fc1c1fea75fd01f3b4916 Mon Sep 17 00:00:00 2001 From: Avneet Raj Date: Mon, 26 Feb 2024 13:37:48 +0530 Subject: [PATCH 7/7] remove plugin-branch option for HG --- .github/workflows/brand-plugin-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/brand-plugin-test.yml b/.github/workflows/brand-plugin-test.yml index 7d3b15445..024e1e6e8 100644 --- a/.github/workflows/brand-plugin-test.yml +++ b/.github/workflows/brand-plugin-test.yml @@ -39,7 +39,6 @@ jobs: needs: setup uses: newfold-labs/workflows/.github/workflows/module-plugin-test.yml@main with: - plugin-branch: 'fix/failing-onboarding-tests' module-repo: ${{ github.repository }} module-branch: ${{ needs.setup.outputs.branch }} plugin-repo: "newfold-labs/wp-plugin-hostgator"