From 32b14b31a64e29a367fe4eb83456cfc780fe073b Mon Sep 17 00:00:00 2001 From: arunshenoy99 Date: Thu, 28 Sep 2023 13:44:34 +0530 Subject: [PATCH] Fix tests --- .../2-general-onboarding-flow/sitetype-primary.cy.js | 2 +- .../2-general-onboarding-flow/sitetype-secondary.cy.js | 2 +- .../2-general-onboarding-flow/top-priority.cy.js | 5 ++--- .../3-ecommerce-onboarding-flow/sitetype-primary.cy.js | 2 +- .../3-ecommerce-onboarding-flow/sitetype-secondary.cy.js | 2 +- tests/cypress/integration/wp-module-support/header.cy.js | 2 +- tests/cypress/integration/wp-module-support/sidebar.cy.js | 6 +++--- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/cypress/integration/2-general-onboarding-flow/sitetype-primary.cy.js b/tests/cypress/integration/2-general-onboarding-flow/sitetype-primary.cy.js index b37cb1af2..0586f895b 100644 --- a/tests/cypress/integration/2-general-onboarding-flow/sitetype-primary.cy.js +++ b/tests/cypress/integration/2-general-onboarding-flow/sitetype-primary.cy.js @@ -25,7 +25,7 @@ describe( 'Get Started Site Type Primary', function () { } ); it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__get-started-site-secondary', 'Site Type' ); + CheckIntroPanel( '__get-started-site-type', 'Site Type' ); CheckIllustrationPanel(); CheckInfoPanel(); CheckHelpPanelLinks(); diff --git a/tests/cypress/integration/2-general-onboarding-flow/sitetype-secondary.cy.js b/tests/cypress/integration/2-general-onboarding-flow/sitetype-secondary.cy.js index 0a3c57dec..8066822c5 100644 --- a/tests/cypress/integration/2-general-onboarding-flow/sitetype-secondary.cy.js +++ b/tests/cypress/integration/2-general-onboarding-flow/sitetype-secondary.cy.js @@ -25,7 +25,7 @@ describe( 'Get Started Site Type Secondary', function () { } ); it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__get-started-site-secondary', 'Site Type' ); + CheckIntroPanel( '__get-started-site-type', 'Site Type' ); CheckIllustrationPanel(); CheckInfoPanel(); CheckHelpPanelLinks(); diff --git a/tests/cypress/integration/2-general-onboarding-flow/top-priority.cy.js b/tests/cypress/integration/2-general-onboarding-flow/top-priority.cy.js index 76a887a7e..cb148d24b 100644 --- a/tests/cypress/integration/2-general-onboarding-flow/top-priority.cy.js +++ b/tests/cypress/integration/2-general-onboarding-flow/top-priority.cy.js @@ -45,11 +45,10 @@ describe( 'Top Priority Page', function () { cy.get( '.components-button.navigation-buttons.navigation-buttons_next.is-primary' ).click(); - cy.url().should( 'include', 'step/basic-info', { + cy.url().should( 'include', 'theme-styles/menu', { timeout: 30000, } ); - cy.wait(5000); - cy.go( 'back' ); + cy.get('.navigation-buttons_back').click(); cy.get( '.nfd-card__body.nfd-selected-card> .nfd-card__body_title' ).contains( $ele ); diff --git a/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-primary.cy.js b/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-primary.cy.js index c8acf6c73..c68040672 100644 --- a/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-primary.cy.js +++ b/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-primary.cy.js @@ -31,7 +31,7 @@ describe( 'Get Started Site Type Primary', function () { } ); it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__get-started-site-secondary', 'Store Type' ); + CheckIntroPanel( '__get-started-site-type', 'Store Type' ); CheckIllustrationPanel(); CheckInfoPanel(); CheckHelpPanelLinks(); diff --git a/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-secondary.cy.js b/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-secondary.cy.js index 0d8d90d8f..e1a9fa14d 100644 --- a/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-secondary.cy.js +++ b/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-secondary.cy.js @@ -31,7 +31,7 @@ describe( 'Get Started Site Type Secondary', function () { } ); it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { - CheckIntroPanel( '__get-started-site-secondary', 'Store Type' ); + CheckIntroPanel( '__get-started-site-type', 'Store Type' ); CheckIllustrationPanel(); CheckInfoPanel(); CheckHelpPanelLinks(); diff --git a/tests/cypress/integration/wp-module-support/header.cy.js b/tests/cypress/integration/wp-module-support/header.cy.js index 60b881849..39a4e915c 100644 --- a/tests/cypress/integration/wp-module-support/header.cy.js +++ b/tests/cypress/integration/wp-module-support/header.cy.js @@ -1,7 +1,7 @@ // export const CheckCardHeadingSubheading = ( question = false ) => { - cy.get( '.nfd-step-card-heading' ).should( 'be.visible' ); + cy.get( '.nfd-step-card-heading' ).scrollIntoView().should( 'be.visible' ); if ( question ) { cy.get( '.nfd-step-card-subheading-other' ).should( 'be.visible' ); cy.get( '.nfd-step-card-question' ).should( 'be.visible' ); diff --git a/tests/cypress/integration/wp-module-support/sidebar.cy.js b/tests/cypress/integration/wp-module-support/sidebar.cy.js index 49764c53e..d4b80f944 100644 --- a/tests/cypress/integration/wp-module-support/sidebar.cy.js +++ b/tests/cypress/integration/wp-module-support/sidebar.cy.js @@ -5,7 +5,7 @@ export const CheckIntroPanel = ( sidebarStep, headingText ) => { cy.get( '.nfd-onboarding-header__end > .components-button' ) .click() .and( 'have.class', 'is-pressed' ); - cy.get( prefixSidebarStep.concat( sidebarStep ) ).should( 'be.visible' ); + cy.get( prefixSidebarStep.concat( sidebarStep ) ).scrollIntoView().should( 'be.visible' ); const heading = prefixSidebarStep.concat( '--step-intro-panel__container' ); cy.get( heading.concat( '__icon' ) ).should( 'be.visible' ); cy.get( heading.concat( '__text__heading' ) ) @@ -47,12 +47,12 @@ export const CheckHelpPanelLinks = ( .scrollIntoView() .should( 'be.visible' ); if ( blueButton ) { - cy.get( '.nfd-onboarding-button--blue' ) + cy.get('.nfd-onboarding-sidebar-learn-more--help-panel__links > .nfd-onboarding-button--background') .should( 'have.text', '1-1 Expert Solutions & Coaching' ) .should( 'have.attr', 'type' ) .and( 'match', /button/ ); } - cy.get( '.nfd-onboarding-button--white' ) + cy.get('.nfd-onboarding-sidebar-learn-more--help-panel__links > .nfd-onboarding-button--white') .should( 'have.text', whiteButtonText ) .should( 'have.attr', 'type' ) .and( 'match', /button/ );