From fe4e84bfb7ecaf2dea967655114d20092b404cff Mon Sep 17 00:00:00 2001 From: Ramya krishna Date: Fri, 17 May 2024 15:20:58 +0530 Subject: [PATCH 01/37] change the option name according to newfold standards --- build/index.asset.php | 2 +- includes/ECommerce.php | 6 +++--- src/components/OnboardingScreen.js | 2 +- src/configs/OnboardingList.config.js | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build/index.asset.php b/build/index.asset.php index 3b9a024e..497b9b58 100644 --- a/build/index.asset.php +++ b/build/index.asset.php @@ -1 +1 @@ - array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '0b1e9d8648a860906e55'); + array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => 'befd0e22adb79ae95781'); diff --git a/includes/ECommerce.php b/includes/ECommerce.php index cfb26062..801546d8 100644 --- a/includes/ECommerce.php +++ b/includes/ECommerce.php @@ -67,7 +67,7 @@ class ECommerce { 'woocommerce_cheque_settings', 'onboarding_experience_level', 'yoast_seo_signup_status', - 'showMigrationSteps', + 'nfd_show_migration_steps', 'update_site_server_clicked', ); @@ -321,7 +321,7 @@ public function register_settings() { ); \register_setting( 'general', - 'showMigrationSteps', + 'nfd_show_migration_steps', array( 'show_in_rest' => true, 'type' => 'boolean', @@ -672,7 +672,7 @@ function check_url_match( $brand_name, $site_url ) { } } if ( check_url_match( $brand, $site_url ) ) { - update_option( 'showMigrationSteps', false ); + update_option( 'nfd_show_migration_steps', false ); } } } diff --git a/src/components/OnboardingScreen.js b/src/components/OnboardingScreen.js index 1d08cef2..f2119c51 100644 --- a/src/components/OnboardingScreen.js +++ b/src/components/OnboardingScreen.js @@ -65,7 +65,7 @@ export function OnboardingScreen({ useEffect(() => { WordPressSdk.settings.get().then((res) => { - setIsMigrationCompleted( res.showMigrationSteps || false ); + setIsMigrationCompleted( res.nfd_show_migration_steps || false ); setWebServersUpdated( res.update_site_server_clicked ); if (res?.page_on_front && res?.show_on_front === "page") { setEditUrl( diff --git a/src/configs/OnboardingList.config.js b/src/configs/OnboardingList.config.js index 6fbaeb5d..4a74f9a3 100644 --- a/src/configs/OnboardingList.config.js +++ b/src/configs/OnboardingList.config.js @@ -57,7 +57,7 @@ const updateMigrateViewGuide = () => { }; const updateStoreSetup = (setIsMigrationCompleted) => { - WordPressSdk.settings.put({ showMigrationSteps: false }).then(() => { + WordPressSdk.settings.put({ nfd_show_migration_steps: false }).then(() => { WordPressSdk.settings.get(); setIsMigrationCompleted(false); }); @@ -87,7 +87,7 @@ export function OnboardingListDefinition(props) { ), state: { isCompleted: (queries) => queries?.settings?.update_site_server_clicked || check_url_match(brandName), - isMigrated: (queries) => queries?.settings?.showMigrationSteps && props.isMigrationCompleted + isMigrated: (queries) => queries?.settings?.nfd_show_migration_steps && props.isMigrationCompleted }, shouldRender: (state) => (state.isMigrated), actions: { @@ -110,7 +110,7 @@ export function OnboardingListDefinition(props) { ), state: { isCompleted: () => check_url_match( brandName ), - isMigrated: (queries) => queries?.settings?.showMigrationSteps && props.isMigrationCompleted, + isMigrated: (queries) => queries?.settings?.nfd_show_migration_steps && props.isMigrationCompleted, }, "data-nfdhelpcenterquery": __( @@ -133,7 +133,7 @@ export function OnboardingListDefinition(props) { ), state: { isCompleted: (queries) => (queries?.settings?.update_site_server_clicked && check_url_match(brandName)) || check_url_match(brandName), - isMigrated: (queries) => queries?.settings?.showMigrationSteps, + isMigrated: (queries) => queries?.settings?.nfd_show_migration_steps, className: () => "nfd-bg-canvas", hideCheck: () => true, showText: () => View Guide @@ -154,7 +154,7 @@ export function OnboardingListDefinition(props) { ), state: { isCompleted: (queries) => !props.isMigrationCompleted, - isMigrated: (queries) => queries?.settings?.showMigrationSteps && (queries?.settings?.update_site_server_clicked || check_url_match(brandName)), + isMigrated: (queries) => queries?.settings?.nfd_show_migration_steps && (queries?.settings?.update_site_server_clicked || check_url_match(brandName)), }, shouldRender: (state) => state.isMigrated && !state.isCompleted, actions: { From 3c8b5ed9605dd45060d50ca28d8219dbc25ff570 Mon Sep 17 00:00:00 2001 From: Ramya krishna Date: Tue, 4 Jun 2024 12:18:51 +0530 Subject: [PATCH 02/37] updated the option in migration.cy.js --- tests/cypress/integration/Home/migration.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cypress/integration/Home/migration.cy.js b/tests/cypress/integration/Home/migration.cy.js index dec5479a..67719281 100644 --- a/tests/cypress/integration/Home/migration.cy.js +++ b/tests/cypress/integration/Home/migration.cy.js @@ -13,7 +13,7 @@ describe( 'Home page - post migration events with help center ', () => { if ( pluginId !== 'bluehost' ) { this.skip(); } - cy.exec( `npx wp-env run cli wp option set showMigrationSteps "true"` ); + cy.exec( `npx wp-env run cli wp option set nfd_show_migration_steps "true"` ); cy.exec( `npx wp-env run cli wp option delete _transient_nfd_site_capabilities`, { failOnNonZeroExit: false } From 291cc9f812823c5ccc4086b2193547e2af6004e0 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 11 Jun 2024 13:19:40 -0400 Subject: [PATCH 03/37] update site capability tests combine test sections and cli commands and enable test isolation lint cleanup --- .../Site-Capabilities/siteCapabilities.cy.js | 218 +++++++----------- .../integration/wp-module-support/utils.cy.js | 15 +- tests/cypress/support/commands.js | 106 ++++----- tests/cypress/support/index.js | 18 +- 4 files changed, 155 insertions(+), 202 deletions(-) diff --git a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js index dc774f4a..6af95397 100644 --- a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js +++ b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js @@ -6,141 +6,101 @@ const mediumWait = 30000; const pluginId = GetPluginId(); const appId = getAppId(); -describe( 'Verify Wondercart accessibility as per site capabilities', () => { - const cTBAndYithTrue = JSON.stringify( { - canAccessAI: true, - canAccessHelpCenter: true, - canAccessGlobalCTB: true, - hasEcomdash: false, - hasYithExtended: true, - isEcommerce: true, - isJarvis: true, - } ); +describe( + 'Verify Wondercart accessibility as per site capabilities', + { testIsolation: true }, + () => { + const cTBAndYithTrue = JSON.stringify( { + canAccessAI: true, + canAccessHelpCenter: true, + canAccessGlobalCTB: true, + hasEcomdash: false, + hasYithExtended: true, + isEcommerce: true, + isJarvis: true, + } ); - const cTBTrueYithFalse = JSON.stringify( { - canAccessAI: true, - canAccessHelpCenter: true, - canAccessGlobalCTB: true, - hasEcomdash: false, - hasYithExtended: false, - isEcommerce: false, - isJarvis: true, - } ); + const cTBTrueYithFalse = JSON.stringify( { + canAccessAI: true, + canAccessHelpCenter: true, + canAccessGlobalCTB: true, + hasEcomdash: false, + hasYithExtended: false, + isEcommerce: false, + isJarvis: true, + } ); - before( function () { - if ( pluginId !== 'bluehost' ) { - this.skip(); - } - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); - installWoo(); - } ); + before( function () { + if ( pluginId !== 'bluehost' ) { + this.skip(); + } + installWoo(); + } ); - beforeEach( () => { - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); - } ); + beforeEach( () => { + cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); + } ); - after( () => { - cy.exec( - `npx wp-env run cli wp option delete _transient_nfd_site_capabilities`, - { failOnNonZeroExit: false } - ); - } ); - - it( 'Verify if Sales and Discounts sub tab is displayed', () => { - cy.exec( - `npx wp-env run cli wp option delete _transient_nfd_site_capabilities`, - { failOnNonZeroExit: false } - ); - cy.exec( - `npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBAndYithTrue }' --format=json`, - { timeout: customCommandTimeout } - ); - cy.reload(); - cy.get( `.${ appId }-app-navitem-Store`, { - timeout: mediumWait, - } ).click(); - cy.get( `.${ appId }-app-subnavitem-Sales` ).should( 'exist' ); - } ); - - it( 'Verify Buy Now is shown when canAccessGlobalCTB is true and commerce addon is false', () => { - cy.exec( - `npx wp-env run cli wp option delete _transient_nfd_site_capabilities`, - { failOnNonZeroExit: false } - ); - cy.exec( - `npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBTrueYithFalse }' --format=json`, - { timeout: customCommandTimeout } - ); - cy.reload(); - cy.get( `.${ appId }-app-navitem-Store`, { - timeout: customCommandTimeout, - } ).click(); - cy.get( `.${ appId }-app-subnavitem-Sales` ) - .as( 'salesTab' ) - .should( 'exist' ); - cy.get( '@salesTab' ).click(); - cy.get( '#buynow-wondercart', { timeout: mediumWait } ).should( - 'exist' - ); - } ); + after( () => { + cy.exec( + `npx wp-env run cli wp transient delete nfd_site_capabilities`, + { failOnNonZeroExit: false } + ); + } ); - it( 'Verify clicking on Buy Now leads to cpanel login page', () => { - cy.reload(); - cy.get( `.${ appId }-app-navitem-Store`, { - timeout: customCommandTimeout, - } ).should( 'exist' ); - cy.get( `.${ appId }-app-navitem-Store`, { - timeout: customCommandTimeout, - } ).click(); - cy.get( `.${ appId }-app-subnavitem-Sales` ).click(); - cy.get( '#buynow-wondercart', { timeout: mediumWait } ).as( - 'buyButton' - ); + it( 'Verify Sales and Discounts sub tab content and functionality', () => { + cy.exec( + `npx wp-env run cli wp transient delete nfd_site_capabilities && npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBAndYithTrue }' --format=json`, + { timeout: customCommandTimeout } + ); + cy.reload(); + cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); - cy.get( '@buyButton' ).should( 'be.visible' ); - cy.get( '@buyButton' ) - .should( 'have.attr', 'href' ) - .and( - 'include', - 'https://my.bluehost.com/hosting/app?utm_source=wp-marketplace&utm_medium=brand-plugin&utm_campaign=wordpress-ad&utm_content=buynow#/marketplace/product' + // Verify Install Now exists when customer has ecommerce addon + cy.get( `.${ appId }-app-subnavitem-Sales`, { + timeout: mediumWait, + } ) + .as( 'salesTab' ) + .should( 'exist' ); + cy.get( '@salesTab' ).click(); + cy.get( '#installnow-wondercart', { timeout: mediumWait } ).should( + 'exist' ); - } ); - it( 'Verify Install Now is shown when customer has ecommerce addon', () => { - cy.exec( - `npx wp-env run cli wp option delete _transient_nfd_site_capabilities`, - { failOnNonZeroExit: false } - ); - cy.exec( - `npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBAndYithTrue }' --format=json`, - { timeout: customCommandTimeout } - ); - cy.reload(); - cy.get( `.${ appId }-app-navitem-Store`, { - timeout: customCommandTimeout, - } ).click(); - cy.get( `.${ appId }-app-subnavitem-Sales`, { timeout: mediumWait } ) - .as( 'salesTab' ) - .should( 'exist' ); - cy.get( '@salesTab' ).click(); - cy.get( '#installnow-wondercart', { timeout: mediumWait } ).should( - 'exist' - ); - } ); + // Verify clicking Install Now successfully installs Wonder Cart plugin + cy.get( '#installnow-wondercart', { timeout: mediumWait } ) + .scrollIntoView() + .click(); + cy.get( '.nfd-notification--success', { + timeout: customCommandTimeout, + } ).should( 'exist' ); + cy.get( '#wonder-cart-init', { timeout: mediumWait } ).should( + 'exist' + ); + } ); - it( 'Verify clicking Install Now successfully installs Wonder Cart plugin', () => { - cy.get( `.${ appId }-app-navitem-Store`, { - timeout: customCommandTimeout, - } ).click(); - cy.get( `.${ appId }-app-subnavitem-Sales` ).click(); - cy.get( '#installnow-wondercart', { timeout: mediumWait } ) - .scrollIntoView() - .click(); - cy.get( '.nfd-notification--success', { - timeout: customCommandTimeout, - } ).should( 'exist' ); - cy.get( '#wonder-cart-init', { timeout: mediumWait } ).should( - 'exist' - ); - } ); -} ); + it( 'Verify Buy Now is shown when canAccessGlobalCTB is true and commerce addon is false', () => { + cy.exec( + `npx wp-env run cli wp transient delete nfd_site_capabilities && npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBTrueYithFalse }' --format=json && npx wp-env run cli wp plugin deactivate wonder-cart yith-paypal-payments-for-woocommerce-extended yith-stripe-payments-for-woocommerce-extended`, + { timeout: customCommandTimeout } + ); + cy.reload(); + cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); + cy.get( `.${ appId }-app-subnavitem-Sales` ) + .as( 'salesTab' ) + .should( 'exist' ); + cy.get( '@salesTab' ).click(); + cy.get( '#buynow-wondercart', { timeout: mediumWait } ).as( + 'buyButton' + ); + cy.get( '@buyButton' ).scrollIntoView().should( 'be.visible' ); + // Verify Buy now button has correct link + cy.get( '@buyButton' ) + .should( 'have.attr', 'href' ) + .and( + 'include', + 'https://my.bluehost.com/hosting/app?utm_source=wp-marketplace&utm_medium=brand-plugin&utm_campaign=wordpress-ad&utm_content=buynow#/marketplace/product' + ); + } ); + } +); diff --git a/tests/cypress/integration/wp-module-support/utils.cy.js b/tests/cypress/integration/wp-module-support/utils.cy.js index bbf3c9fe..334d6391 100644 --- a/tests/cypress/integration/wp-module-support/utils.cy.js +++ b/tests/cypress/integration/wp-module-support/utils.cy.js @@ -39,14 +39,13 @@ export const comingSoon = ( shouldBeComingSoon ) => { }; export const installWoo = () => { - cy.exec( `npx wp-env run cli wp plugin install woocommerce`, { - timeout: longWait, - log: true, - } ); - - cy.exec( `npx wp-env run cli wp plugin activate woocommerce`, { - timeout: longWait, - } ); + cy.exec( + `npx wp-env run cli wp plugin install woocommerce --activate && npx wp-env run cli wp plugin deactivate wonder-cart yith-paypal-payments-for-woocommerce-extended yith-stripe-payments-for-woocommerce-extended`, + { + timeout: longWait, + log: true, + } + ); }; export const viewCompletedTasks = () => { diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index 9b955d7b..db5ebf91 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -28,63 +28,57 @@ import '@testing-library/cypress/add-commands'; -Cypress.Commands.add('login', (username, password) => { - cy - .getCookies() - .then(cookies => { - let hasMatch = false; - cookies.forEach((cookie) => { - if (cookie.name.substring(0, 20) === 'wordpress_logged_in_') { - hasMatch = true; - } - }); - if (!hasMatch) { - cy.visit('/wp-login.php').wait(1000); - cy.get('#user_login').type(username); - cy.get('#user_pass').type(`${password}{enter}`); +Cypress.Commands.add( 'login', ( username, password ) => { + cy.getCookies().then( ( cookies ) => { + let hasMatch = false; + cookies.forEach( ( cookie ) => { + if ( cookie.name.substring( 0, 20 ) === 'wordpress_logged_in_' ) { + hasMatch = true; } - }); -}); + } ); + if ( ! hasMatch ) { + cy.visit( '/wp-login.php' ).wait( 1000 ); + cy.get( '#user_login' ).type( username ); + cy.get( '#user_pass' ).type( `${ password }{enter}` ); + } + } ); +} ); -Cypress.Commands.add('logout', () => { - cy - .getCookies() - .then( - cookies => { - cookies.forEach( - cookie => { - cy.clearCookie(cookie.name); - } - ) - } - ); - }); +Cypress.Commands.add( 'logout', () => { + cy.getCookies().then( ( cookies ) => { + cookies.forEach( ( cookie ) => { + cy.clearCookie( cookie.name ); + } ); + } ); +} ); - /** -* @param {string} pluginName - The string -* Use deactivatePlugin('anyPluginName') from test to deactivate plugin -*/ - Cypress.Commands.add('deactivatePlugin', (pluginName) => { - if (pluginName.toLowerCase() === 'all') { - cy.exec('npx wp-env run cli wp plugin deactivate --all'); - } else { - cy.exec(`npx wp-env run cli wp plugin deactivate ${pluginName}`); - } - }); +/** + * Use deactivatePlugin('anyPluginName') from test to deactivate plugin + * + * @param {string} pluginName - The string + */ +Cypress.Commands.add( 'deactivatePlugin', ( pluginName ) => { + if ( pluginName.toLowerCase() === 'all' ) { + cy.exec( 'npx wp-env run cli wp plugin deactivate --all' ); + } else { + cy.exec( `npx wp-env run cli wp plugin deactivate ${ pluginName }` ); + } +} ); - /** - * @param {string} pluginName - The string - * Use activatePlugin('All') from test to activate all plugins - * Use activatePlugin('anyPluginName') from test to activate plugin - */ - Cypress.Commands.add('activatePlugin', (pluginName) => { - if (pluginName.toLowerCase() !== 'all') { - cy.exec(`npx wp-env run cli wp plugin activate ${pluginName}`, { - failOnNonZeroExit: false, - }); - } else { - cy.exec('npx wp-env run cli wp plugin activate --all', { - failOnNonZeroExit: false, - }); - } - }); +/** + * Use activatePlugin('All') from test to activate all plugins + * Use activatePlugin('anyPluginName') from test to activate plugin + * + * @param {string} pluginName - The string + */ +Cypress.Commands.add( 'activatePlugin', ( pluginName ) => { + if ( pluginName.toLowerCase() !== 'all' ) { + cy.exec( `npx wp-env run cli wp plugin activate ${ pluginName }`, { + failOnNonZeroExit: false, + } ); + } else { + cy.exec( 'npx wp-env run cli wp plugin activate --all', { + failOnNonZeroExit: false, + } ); + } +} ); diff --git a/tests/cypress/support/index.js b/tests/cypress/support/index.js index 369d8872..6450b047 100644 --- a/tests/cypress/support/index.js +++ b/tests/cypress/support/index.js @@ -15,16 +15,16 @@ import 'cypress-axe'; import './commands'; -require('@replayio/cypress/support'); +require( '@replayio/cypress/support' ); -const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/ -Cypress.on('uncaught:exception', (err) => { +const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/; +Cypress.on( 'uncaught:exception', ( err ) => { /* returning false here prevents Cypress from failing the test */ - if (resizeObserverLoopErrRe.test(err.message)) { - return false + if ( resizeObserverLoopErrRe.test( err.message ) ) { + return false; } -}) +} ); -before(() => { - cy.login(Cypress.env('wpUsername'), Cypress.env('wpPassword')); -}); +before( () => { + cy.login( Cypress.env( 'wpUsername' ), Cypress.env( 'wpPassword' ) ); +} ); From 9ab6ba60d80dc2ad47cd938ecc09ae11ebdaac83 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 11 Jun 2024 13:41:08 -0400 Subject: [PATCH 04/37] update store without woo test combine tests and implement testIsolation option lint cleanup --- src/components/WooCommerceUnavailable.js | 4 +- .../cypress/integration/Store/storePage.cy.js | 96 ++++++++++--------- 2 files changed, 51 insertions(+), 49 deletions(-) diff --git a/src/components/WooCommerceUnavailable.js b/src/components/WooCommerceUnavailable.js index efbf1d27..4e698334 100644 --- a/src/components/WooCommerceUnavailable.js +++ b/src/components/WooCommerceUnavailable.js @@ -14,10 +14,10 @@ export function WooCommerceUnavailable(props) {
- + <Title size="4" className="nfd-leading-normal" data-testid="nfd-nowoo-store-title"> {__("Add a store to your site", "wp-module-ecommerce")} - + {__( "Adding a store to your website is quick and easy!\nJust install WooCommerce and get ready to start making money!", "wp-module-ecommerce" diff --git a/tests/cypress/integration/Store/storePage.cy.js b/tests/cypress/integration/Store/storePage.cy.js index 264b3693..f0b7ce37 100644 --- a/tests/cypress/integration/Store/storePage.cy.js +++ b/tests/cypress/integration/Store/storePage.cy.js @@ -5,55 +5,57 @@ const pluginId = GetPluginId(); const appId = getAppId(); const customCommandTimeout = 30000; -describe( 'Store Page- WooCommerce is deactivated/uninstalled', () => { - before( () => { - cy.exec( `npx wp-env run cli wp plugin deactivate woocommerce`, { - failOnNonZeroExit: false, - } ); - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); - comingSoon( false ); - } ); - - beforeEach( () => { - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); - } ); - - it( 'Verify that Payments tab is not displayed', () => { - cy.reload(); - cy.get( `.${ appId }-app-navitem-Store`, { - timeout: customCommandTimeout, - } ) - .next() - .find( '.nfd-m-0' ) - .each( ( item, index, list ) => { - expect( list ).to.have.length( 2 ); +describe( + 'Store Page - WooCommerce is deactivated/uninstalled', + { testIsolation: true }, + () => { + it( 'Verify Store Page renders properly without Woo', () => { + cy.exec( `npx wp-env run cli wp plugin deactivate woocommerce`, { + failOnNonZeroExit: false, } ); - cy.get( `.${ appId }-app-subnavitem-Products` ).should( 'exist' ); - cy.get( `.${ appId }-app-subnavitem-Store` ).should( 'exist' ); - cy.get( `.${ appId }-app-subnavitem-Payments` ).should( 'not.exist' ); - } ); + comingSoon( false ); + cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); - it( 'Verify Store page title and sub titles', () => { - cy.get( '.nfd-app-section-header h2' ).should( 'exist' ); - cy.get( '.nfd-app-section-header' ) - .next() - .as( 'storeFlex' ) - .should( 'exist' ); - cy.get( '@storeFlex' ).find( 'span' ).should( 'exist' ); - } ); + // Payments tab is not displayed + cy.get( `.${ appId }-app-navitem-Store`, { + timeout: customCommandTimeout, + } ) + .next() + .find( '.nfd-m-0' ) + .each( ( item, index, list ) => { + expect( list ).to.have.length( 2 ); + } ); + cy.get( `.${ appId }-app-subnavitem-Products` ).should( 'exist' ); + cy.get( `.${ appId }-app-subnavitem-Store` ).should( 'exist' ); + cy.get( `.${ appId }-app-subnavitem-Payments` ).should( + 'not.exist' + ); - it( 'Verify Store and its sub tabs should have Install WooCommerce buttons', () => { - const storeNavElements = [ - `.${ appId }-app-navitem-Store`, - `.${ appId }-app-subnavitem-Products`, - `.${ appId }-app-subnavitem-Store`, - ]; + // Title and desctription elements display + // cy.get( '[data-testid="nfd-nowoo-store-title"]' ).should( 'exist' ); + // cy.get( '[data-testid="nfd-nowoo-store-description"]' ).should( + // 'exist' + // ); + cy.get( '.nfd-app-section-header h2' ).should( 'exist' ); + cy.get( '.nfd-app-section-header' ) + .next() + .as( 'storeFlex' ) + .should( 'exist' ); + cy.get( '@storeFlex' ).find( 'span' ).should( 'exist' ); - storeNavElements.forEach( ( ele ) => { - cy.get( ele, { timeout: customCommandTimeout } ).click(); - cy.get( '.nfd-button--upsell', { - timeout: customCommandTimeout, - } ).should( 'exist' ); + // Verify Store and its sub tabs should have Install WooCommerce buttons + const storeNavElements = [ + `.${ appId }-app-navitem-Store`, + `.${ appId }-app-subnavitem-Products`, + `.${ appId }-app-subnavitem-Store`, + ]; + + storeNavElements.forEach( ( ele ) => { + cy.get( ele, { timeout: customCommandTimeout } ).click(); + cy.get( '.nfd-button--upsell', { + timeout: customCommandTimeout, + } ).should( 'exist' ); + } ); } ); - } ); -} ); + } +); From be01d019242d1aab754a5d769a23ec2d1d349716 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 11 Jun 2024 14:06:43 -0400 Subject: [PATCH 05/37] remove unnecessary beforeEach --- .../integration/Site-Capabilities/siteCapabilities.cy.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js index 6af95397..c08a6c3a 100644 --- a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js +++ b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js @@ -37,10 +37,6 @@ describe( installWoo(); } ); - beforeEach( () => { - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); - } ); - after( () => { cy.exec( `npx wp-env run cli wp transient delete nfd_site_capabilities`, From 8171024a5a1d1dfe4c4401bff8f47b61d1162c32 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 11 Jun 2024 14:59:23 -0400 Subject: [PATCH 06/37] more minor cleanup --- .../Site-Capabilities/siteCapabilities.cy.js | 2 +- tests/cypress/integration/Store/storePage.cy.js | 14 +------------- .../integration/wp-module-support/utils.cy.js | 5 +---- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js index c08a6c3a..a2b21793 100644 --- a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js +++ b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js @@ -30,7 +30,7 @@ describe( isJarvis: true, } ); - before( function () { + before( () => { if ( pluginId !== 'bluehost' ) { this.skip(); } diff --git a/tests/cypress/integration/Store/storePage.cy.js b/tests/cypress/integration/Store/storePage.cy.js index f0b7ce37..c8a34a20 100644 --- a/tests/cypress/integration/Store/storePage.cy.js +++ b/tests/cypress/integration/Store/storePage.cy.js @@ -17,19 +17,7 @@ describe( cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); // Payments tab is not displayed - cy.get( `.${ appId }-app-navitem-Store`, { - timeout: customCommandTimeout, - } ) - .next() - .find( '.nfd-m-0' ) - .each( ( item, index, list ) => { - expect( list ).to.have.length( 2 ); - } ); - cy.get( `.${ appId }-app-subnavitem-Products` ).should( 'exist' ); - cy.get( `.${ appId }-app-subnavitem-Store` ).should( 'exist' ); - cy.get( `.${ appId }-app-subnavitem-Payments` ).should( - 'not.exist' - ); + cy.get( `.${ appId }-app-subnavitem-Payments` ).should( 'not.exist' ); // Title and desctription elements display // cy.get( '[data-testid="nfd-nowoo-store-title"]' ).should( 'exist' ); diff --git a/tests/cypress/integration/wp-module-support/utils.cy.js b/tests/cypress/integration/wp-module-support/utils.cy.js index 334d6391..2999b657 100644 --- a/tests/cypress/integration/wp-module-support/utils.cy.js +++ b/tests/cypress/integration/wp-module-support/utils.cy.js @@ -5,10 +5,7 @@ const customCommandTimeout = 30000; const longWait = 120000; export const comingSoon = ( shouldBeComingSoon ) => { - cy.get( `.${ appId }-app-navitem-Settings`, { - timeout: customCommandTimeout, - } ).click(); - + cy.visit( '/wp-admin/admin.php?page=' + Cypress.env('pluginId') + '#/settings' ); cy.get( '[data-id="coming-soon-toggle"]', { timeout: customCommandTimeout, } ).as( 'comingSoonToggle' ); From 155d13b16668f44455aa51cbba759a89f0bee10a Mon Sep 17 00:00:00 2001 From: ajayadav09 Date: Wed, 12 Jun 2024 11:59:00 +0530 Subject: [PATCH 07/37] PRESS0-631 | dismiss woocommerce notice --- includes/ECommerce.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/includes/ECommerce.php b/includes/ECommerce.php index 50c4f4f2..aed1260b 100644 --- a/includes/ECommerce.php +++ b/includes/ECommerce.php @@ -108,6 +108,8 @@ public function __construct( Container $container ) { add_action( 'auth_cookie_expired', array( $this, 'show_store_setup' ) ); add_action('admin_head', array( $this, 'hide_wp_pointer_with_css' ) ); add_action('admin_enqueue_scripts', array( $this, 'set_wpnav_collapse_setting')); + add_action( 'admin_init', array( $this, 'remove_woocommerce_ssl_notice' ) ); + if ( ( $container->plugin()->id === 'bluehost' && ( $canAccessGlobalCTB || $hasYithExtended ) ) || ( $container->plugin()->id === 'hostgator' && $hasYithExtended ) ) { add_filter( 'admin_menu', array( $this, 'custom_add_promotion_menu_item' ) ); @@ -586,6 +588,17 @@ public function hide_columns() { } } + /** + * Hide woocommerce ssl notice + * + * @return void + */ + public function remove_woocommerce_ssl_notice() { + if ( class_exists( 'WooCommerce' ) ) { + remove_action( 'admin_notices', array( 'WC_Admin_Notices', 'ssl_check' ) ); + } + } + /** * Add custom column header for post/page/product screen * From 646c086d8db9624850c54b50a669471c153dd11a Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Wed, 12 Jun 2024 11:49:36 -0400 Subject: [PATCH 08/37] add some logging and update typo in var name --- .../cypress/integration/wp-module-support/utils.cy.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/cypress/integration/wp-module-support/utils.cy.js b/tests/cypress/integration/wp-module-support/utils.cy.js index 2999b657..98b2ac6e 100644 --- a/tests/cypress/integration/wp-module-support/utils.cy.js +++ b/tests/cypress/integration/wp-module-support/utils.cy.js @@ -13,8 +13,9 @@ export const comingSoon = ( shouldBeComingSoon ) => { if ( shouldBeComingSoon ) { cy.get( '@comingSoonToggle' ) .invoke( 'attr', 'aria-checked' ) - .then( ( area_checked ) => { - if ( area_checked == 'false' ) { + .then( ( aria_checked ) => { + if ( aria_checked == 'false' ) { + cy.log( 'Enable Coming Soon Mode' ); cy.get( '@comingSoonToggle' ).click(); cy.get( '.nfd-notification--success', { timeout: customCommandTimeout, @@ -24,8 +25,9 @@ export const comingSoon = ( shouldBeComingSoon ) => { } else { cy.get( '@comingSoonToggle' ) .invoke( 'attr', 'aria-checked' ) - .then( ( area_checked ) => { - if ( area_checked == 'true' ) { + .then( ( aria_checked ) => { + if ( aria_checked == 'true' ) { + cy.log( 'Disable Coming Soon Mode' ); cy.get( '@comingSoonToggle' ).click(); cy.get( '.nfd-notification--success', { timeout: customCommandTimeout, @@ -36,6 +38,7 @@ export const comingSoon = ( shouldBeComingSoon ) => { }; export const installWoo = () => { + cy.log( 'Installing WooCommerce' ); cy.exec( `npx wp-env run cli wp plugin install woocommerce --activate && npx wp-env run cli wp plugin deactivate wonder-cart yith-paypal-payments-for-woocommerce-extended yith-stripe-payments-for-woocommerce-extended`, { From b2dc7dff673c470cd55c42688ac959a0eef53067 Mon Sep 17 00:00:00 2001 From: ajayadav09 Date: Thu, 13 Jun 2024 10:39:24 +0530 Subject: [PATCH 09/37] Modified the function to remove it from the the dom as it was not being removed via remove action. --- includes/ECommerce.php | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/includes/ECommerce.php b/includes/ECommerce.php index aed1260b..ca564ab1 100644 --- a/includes/ECommerce.php +++ b/includes/ECommerce.php @@ -108,8 +108,7 @@ public function __construct( Container $container ) { add_action( 'auth_cookie_expired', array( $this, 'show_store_setup' ) ); add_action('admin_head', array( $this, 'hide_wp_pointer_with_css' ) ); add_action('admin_enqueue_scripts', array( $this, 'set_wpnav_collapse_setting')); - add_action( 'admin_init', array( $this, 'remove_woocommerce_ssl_notice' ) ); - + add_action('admin_footer', array( $this, 'remove_woocommerce_ssl_notice' ), 20); if ( ( $container->plugin()->id === 'bluehost' && ( $canAccessGlobalCTB || $hasYithExtended ) ) || ( $container->plugin()->id === 'hostgator' && $hasYithExtended ) ) { add_filter( 'admin_menu', array( $this, 'custom_add_promotion_menu_item' ) ); @@ -589,13 +588,36 @@ public function hide_columns() { } /** - * Hide woocommerce ssl notice + * Hide WooCommerce SSL notice * * @return void */ + public function remove_woocommerce_ssl_notice() { - if ( class_exists( 'WooCommerce' ) ) { - remove_action( 'admin_notices', array( 'WC_Admin_Notices', 'ssl_check' ) ); + + // Check if WooCommerce is active. + if (!class_exists('WooCommerce')) { + return; + } + + if (!is_ssl()) { + // Check if there are any WooCommerce admin notices, find the one with ssl notice link and hide it. + ?> + + Date: Fri, 14 Jun 2024 11:19:39 -0400 Subject: [PATCH 10/37] remove testIsolation --- .../Site-Capabilities/siteCapabilities.cy.js | 168 +++++++++--------- .../cypress/integration/Store/storePage.cy.js | 5 +- 2 files changed, 85 insertions(+), 88 deletions(-) diff --git a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js index a2b21793..2fb36de0 100644 --- a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js +++ b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js @@ -6,97 +6,93 @@ const mediumWait = 30000; const pluginId = GetPluginId(); const appId = getAppId(); -describe( - 'Verify Wondercart accessibility as per site capabilities', - { testIsolation: true }, - () => { - const cTBAndYithTrue = JSON.stringify( { - canAccessAI: true, - canAccessHelpCenter: true, - canAccessGlobalCTB: true, - hasEcomdash: false, - hasYithExtended: true, - isEcommerce: true, - isJarvis: true, - } ); +describe( 'Verify Wondercart accessibility as per site capabilities', () => { + const cTBAndYithTrue = JSON.stringify( { + canAccessAI: true, + canAccessHelpCenter: true, + canAccessGlobalCTB: true, + hasEcomdash: false, + hasYithExtended: true, + isEcommerce: true, + isJarvis: true, + } ); - const cTBTrueYithFalse = JSON.stringify( { - canAccessAI: true, - canAccessHelpCenter: true, - canAccessGlobalCTB: true, - hasEcomdash: false, - hasYithExtended: false, - isEcommerce: false, - isJarvis: true, - } ); + const cTBTrueYithFalse = JSON.stringify( { + canAccessAI: true, + canAccessHelpCenter: true, + canAccessGlobalCTB: true, + hasEcomdash: false, + hasYithExtended: false, + isEcommerce: false, + isJarvis: true, + } ); - before( () => { - if ( pluginId !== 'bluehost' ) { - this.skip(); - } - installWoo(); - } ); + before( () => { + if ( pluginId !== 'bluehost' ) { + this.skip(); + } + installWoo(); + } ); - after( () => { - cy.exec( - `npx wp-env run cli wp transient delete nfd_site_capabilities`, - { failOnNonZeroExit: false } - ); - } ); + after( () => { + cy.exec( + `npx wp-env run cli wp transient delete nfd_site_capabilities`, + { failOnNonZeroExit: false } + ); + } ); - it( 'Verify Sales and Discounts sub tab content and functionality', () => { - cy.exec( - `npx wp-env run cli wp transient delete nfd_site_capabilities && npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBAndYithTrue }' --format=json`, - { timeout: customCommandTimeout } - ); - cy.reload(); - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); + it( 'Verify Sales and Discounts sub tab content and functionality', () => { + cy.exec( + `npx wp-env run cli wp transient delete nfd_site_capabilities && npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBAndYithTrue }' --format=json`, + { timeout: customCommandTimeout } + ); + cy.reload(); + cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); - // Verify Install Now exists when customer has ecommerce addon - cy.get( `.${ appId }-app-subnavitem-Sales`, { - timeout: mediumWait, - } ) - .as( 'salesTab' ) - .should( 'exist' ); - cy.get( '@salesTab' ).click(); - cy.get( '#installnow-wondercart', { timeout: mediumWait } ).should( - 'exist' - ); + // Verify Install Now exists when customer has ecommerce addon + cy.get( `.${ appId }-app-subnavitem-Sales`, { + timeout: mediumWait, + } ) + .as( 'salesTab' ) + .should( 'exist' ); + cy.get( '@salesTab' ).click(); + cy.get( '#installnow-wondercart', { timeout: mediumWait } ).should( + 'exist' + ); - // Verify clicking Install Now successfully installs Wonder Cart plugin - cy.get( '#installnow-wondercart', { timeout: mediumWait } ) - .scrollIntoView() - .click(); - cy.get( '.nfd-notification--success', { - timeout: customCommandTimeout, - } ).should( 'exist' ); - cy.get( '#wonder-cart-init', { timeout: mediumWait } ).should( - 'exist' - ); - } ); + // Verify clicking Install Now successfully installs Wonder Cart plugin + cy.get( '#installnow-wondercart', { timeout: mediumWait } ) + .scrollIntoView() + .click(); + cy.get( '.nfd-notification--success', { + timeout: customCommandTimeout, + } ).should( 'exist' ); + cy.get( '#wonder-cart-init', { timeout: mediumWait } ).should( + 'exist' + ); + } ); - it( 'Verify Buy Now is shown when canAccessGlobalCTB is true and commerce addon is false', () => { - cy.exec( - `npx wp-env run cli wp transient delete nfd_site_capabilities && npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBTrueYithFalse }' --format=json && npx wp-env run cli wp plugin deactivate wonder-cart yith-paypal-payments-for-woocommerce-extended yith-stripe-payments-for-woocommerce-extended`, - { timeout: customCommandTimeout } - ); - cy.reload(); - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); - cy.get( `.${ appId }-app-subnavitem-Sales` ) - .as( 'salesTab' ) - .should( 'exist' ); - cy.get( '@salesTab' ).click(); - cy.get( '#buynow-wondercart', { timeout: mediumWait } ).as( - 'buyButton' + it( 'Verify Buy Now is shown when canAccessGlobalCTB is true and commerce addon is false', () => { + cy.exec( + `npx wp-env run cli wp transient delete nfd_site_capabilities && npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBTrueYithFalse }' --format=json && npx wp-env run cli wp plugin deactivate wonder-cart yith-paypal-payments-for-woocommerce-extended yith-stripe-payments-for-woocommerce-extended`, + { timeout: customCommandTimeout } + ); + cy.reload(); + cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); + cy.get( `.${ appId }-app-subnavitem-Sales` ) + .as( 'salesTab' ) + .should( 'exist' ); + cy.get( '@salesTab' ).click(); + cy.get( '#buynow-wondercart', { timeout: mediumWait } ).as( + 'buyButton' + ); + cy.get( '@buyButton' ).scrollIntoView().should( 'be.visible' ); + // Verify Buy now button has correct link + cy.get( '@buyButton' ) + .should( 'have.attr', 'href' ) + .and( + 'include', + 'https://my.bluehost.com/hosting/app?utm_source=wp-marketplace&utm_medium=brand-plugin&utm_campaign=wordpress-ad&utm_content=buynow#/marketplace/product' ); - cy.get( '@buyButton' ).scrollIntoView().should( 'be.visible' ); - // Verify Buy now button has correct link - cy.get( '@buyButton' ) - .should( 'have.attr', 'href' ) - .and( - 'include', - 'https://my.bluehost.com/hosting/app?utm_source=wp-marketplace&utm_medium=brand-plugin&utm_campaign=wordpress-ad&utm_content=buynow#/marketplace/product' - ); - } ); - } -); + } ); +} ); diff --git a/tests/cypress/integration/Store/storePage.cy.js b/tests/cypress/integration/Store/storePage.cy.js index c8a34a20..3a4be881 100644 --- a/tests/cypress/integration/Store/storePage.cy.js +++ b/tests/cypress/integration/Store/storePage.cy.js @@ -7,7 +7,6 @@ const customCommandTimeout = 30000; describe( 'Store Page - WooCommerce is deactivated/uninstalled', - { testIsolation: true }, () => { it( 'Verify Store Page renders properly without Woo', () => { cy.exec( `npx wp-env run cli wp plugin deactivate woocommerce`, { @@ -17,7 +16,9 @@ describe( cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); // Payments tab is not displayed - cy.get( `.${ appId }-app-subnavitem-Payments` ).should( 'not.exist' ); + cy.get( `.${ appId }-app-subnavitem-Payments` ).should( + 'not.exist' + ); // Title and desctription elements display // cy.get( '[data-testid="nfd-nowoo-store-title"]' ).should( 'exist' ); From 95c807b736a5d2cb745f3532005b2e468fc924e0 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Mon, 17 Jun 2024 15:08:04 -0400 Subject: [PATCH 11/37] add id and data-testid to onboarding list and items for more clear selection in tests --- src/components/OnboardingList.js | 3 ++- src/configs/OnboardingList.config.js | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/components/OnboardingList.js b/src/components/OnboardingList.js index 14e917c4..6ec4336d 100644 --- a/src/components/OnboardingList.js +++ b/src/components/OnboardingList.js @@ -34,6 +34,7 @@ function OnboardingCheckListItem({ children, actions, state, ...props }) { "nfd-py-4 nfd-px-5", "nfd-text-sm nfd-no-underline" )} + data-testid={props.id} target={state?.target || "_self"} href={state.url} {...(actions.manage && !manageAction.isMutating @@ -124,7 +125,7 @@ export function OnboardingList(props) {
)} {itemsToDisplay.length > 0 && ( - + {itemsToDisplay.map((item) => ( ))} diff --git a/src/configs/OnboardingList.config.js b/src/configs/OnboardingList.config.js index 6fbaeb5d..3d22484b 100644 --- a/src/configs/OnboardingList.config.js +++ b/src/configs/OnboardingList.config.js @@ -81,6 +81,7 @@ export function OnboardingListDefinition(props) { cards: [ { name: "Update your website nameservers", + id: "nameservers", text: __( "Update your website nameservers", "wp-module-ecommerce" @@ -104,6 +105,7 @@ export function OnboardingListDefinition(props) { }, { name: "Connect this site to your domain", + id: "domain", text: __( "Connect this site to your domain", "wp-module-ecommerce" @@ -127,6 +129,7 @@ export function OnboardingListDefinition(props) { }, { name: "Need help with these steps?", + id: "help", text: __( "Need help with these steps?", "wp-module-ecommerce" @@ -148,6 +151,7 @@ export function OnboardingListDefinition(props) { }, { name: "Continue with store setup", + id: "continue", text: __( "Continue with store setup", "wp-module-ecommerce" @@ -166,6 +170,7 @@ export function OnboardingListDefinition(props) { }, { name: "Sign up for Bluehost WordPress Academy", + id: "academy", text: __( "Sign up for Bluehost WordPress Academy", "wp-module-ecommerce" @@ -187,6 +192,7 @@ export function OnboardingListDefinition(props) { }, { name: "New Order Received", + id: "neworder", text: __( "New Order Received", "wp-module-ecommerce" @@ -204,6 +210,7 @@ export function OnboardingListDefinition(props) { }, { name: "Add your store info", + id: "storeinfo", text: __("Add your store info", "wp-module-ecommerce"), state: { isAvailable: (queries) => queries?.plugins?.isWCActive, @@ -219,6 +226,7 @@ export function OnboardingListDefinition(props) { }, { name: "Connect a payment processor", + id: "paymentprocessor", text: __("Connect a payment processor", "wp-module-ecommerce"), state: { isAvailable: (queries) => @@ -243,6 +251,7 @@ export function OnboardingListDefinition(props) { }, { name: "Setup shipping options", + id: "shipping", text: __("Setup shipping options", "wp-module-ecommerce"), state: { isAvailable: (queries) => @@ -263,6 +272,7 @@ export function OnboardingListDefinition(props) { }, { name: "Configure tax settings", + id: "tax", text: __("Configure tax settings", "wp-module-ecommerce"), state: { isAvailable: (queries) => queries?.plugins?.isWCActive, @@ -278,6 +288,7 @@ export function OnboardingListDefinition(props) { }, { name: "Add a product", + id: "addproduct", text: __("Add a product", "wp-module-ecommerce"), state: { isActive: (queries) => queries?.plugins?.isWCActive, @@ -294,6 +305,7 @@ export function OnboardingListDefinition(props) { }, { name: "Sign up for Yoast SEO Academy", + id: "seoacademy", text: __("Sign up for Yoast SEO Academy", "wp-module-ecommerce"), state: { isAvailable: (queries) => queries?.settings?.isNovice, @@ -310,6 +322,7 @@ export function OnboardingListDefinition(props) { }, { name: "Add a new page to your site", + id: "newpage", text: NewfoldRuntime.hasCapability("isEcommerce") ? __("Add a new page to your store", "wp-module-ecommerce") : __("Add a new page to your site", "wp-module-ecommerce"), @@ -332,6 +345,7 @@ export function OnboardingListDefinition(props) { }, { name: "Upload media to your site", + id: "media", text: __("Upload media to your site", "wp-module-ecommerce"), state: { isCompleted: (queries) => queries?.media, @@ -350,6 +364,7 @@ export function OnboardingListDefinition(props) { }, { name: "Connect to your social media accounts", + id: "social", text: __( "Connect to your social media accounts", "wp-module-ecommerce" @@ -374,6 +389,7 @@ export function OnboardingListDefinition(props) { }, { name: "Enable Jetpack to connect to your social media accounts", + id: "jetpack", text: __( "Enable Jetpack to connect to your social media accounts", "wp-module-ecommerce" From ff0bca1ccd8488ad261ae0f2f523e4acce5cb40c Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Mon, 17 Jun 2024 15:08:56 -0400 Subject: [PATCH 12/37] use new selectors and add testIsolation --- .../cypress/integration/Home/migration.cy.js | 117 +++++++++--------- .../Site-Capabilities/siteCapabilities.cy.js | 4 +- .../cypress/integration/Store/storePage.cy.js | 23 ++-- .../integration/wp-module-support/utils.cy.js | 9 +- 4 files changed, 82 insertions(+), 71 deletions(-) diff --git a/tests/cypress/integration/Home/migration.cy.js b/tests/cypress/integration/Home/migration.cy.js index dec5479a..94d54381 100644 --- a/tests/cypress/integration/Home/migration.cy.js +++ b/tests/cypress/integration/Home/migration.cy.js @@ -8,63 +8,66 @@ const helpCenter = JSON.stringify( { canAccessHelpCenter: true, } ); -describe( 'Home page - post migration events with help center ', () => { - before( function () { - if ( pluginId !== 'bluehost' ) { - this.skip(); - } - cy.exec( `npx wp-env run cli wp option set showMigrationSteps "true"` ); - cy.exec( - `npx wp-env run cli wp option delete _transient_nfd_site_capabilities`, - { failOnNonZeroExit: false } - ); - cy.exec( - `npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ helpCenter }' --format=json`, - { timeout: customCommandTimeout } - ); - cy.reload(); - } ); +describe( + 'Home page - post migration events with help center ', + { testIsolation: true }, + () => { + beforeEach( function () { + if ( pluginId !== 'bluehost' ) { + this.skip(); + } + cy.exec( + `npx wp-env run cli wp option set showMigrationSteps "true"` + ); + cy.exec( + `npx wp-env run cli wp option delete _transient_nfd_site_capabilities`, + { failOnNonZeroExit: false } + ); + cy.exec( + `npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ helpCenter }' --format=json`, + { timeout: customCommandTimeout } + ); + cy.reload(); + cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); + } ); - beforeEach( () => { - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); - } ); + it( 'Verify when update nameserver clicked', () => { + cy.intercept( APIList.update_nameserver ).as( 'events' ); + cy.get( '#onboarding-list [data-testid="nameservers"]', { timeout: customCommandTimeout } ) + .scrollIntoView() + .should( 'exist' ) + .click(); + EventsAPI( APIList.update_nameserver, pluginId ); + cy.get( '.nfd-help-center', { + timeout: customCommandTimeout, + } ).should( 'be.visible' ); + cy.get( '.close-button' ).click(); + } ); - it( 'Verify when update nameserver clicked', () => { - cy.get( '.nfd-grid.nfd-gap-4', { timeout: customCommandTimeout } ) - .scrollIntoView() - .should( 'exist' ); - cy.intercept( APIList.update_nameserver ).as( 'events' ); - cy.get( '.nfd-grid.nfd-gap-4 ul li a' ).eq( 0 ).click(); - EventsAPI( APIList.update_nameserver, pluginId ); - cy.get( '.nfd-help-center', { timeout: customCommandTimeout } ).should( - 'be.visible' - ); - cy.get( '.close-button' ).click(); - } ); + it( 'Verify when connect domain to site clicked', () => { + cy.intercept( APIList.connect_domain ).as( 'events' ); + cy.get( '#onboarding-list [data-testid="domain"]', { timeout: customCommandTimeout } ) + .scrollIntoView() + .should( 'exist' ) + .click(); + EventsAPI( APIList.connect_domain, pluginId ); + cy.get( '.nfd-help-center', { + timeout: customCommandTimeout, + } ).should( 'be.visible' ); + cy.get( '.close-button' ).click(); + } ); - it( 'Verify when connect domain to site clicked', () => { - cy.get( '.nfd-grid.nfd-gap-4', { timeout: customCommandTimeout } ) - .scrollIntoView() - .should( 'exist' ); - cy.intercept( APIList.connect_domain ).as( 'events' ); - cy.get( '.nfd-grid.nfd-gap-4 ul li a' ).eq( 1 ).click(); - EventsAPI( APIList.connect_domain, pluginId ); - cy.get( '.nfd-help-center', { timeout: customCommandTimeout } ).should( - 'be.visible' - ); - cy.get( '.close-button' ).click(); - } ); - - it( 'Verify when continue with store setup clicked', () => { - cy.get( '.nfd-grid.nfd-gap-4', { timeout: customCommandTimeout } ) - .scrollIntoView() - .should( 'exist' ); - cy.get( '.nfd-grid.nfd-gap-4 ul li a' ).eq( 2 ).click(); - cy.get( '#next-steps-section', { timeout: customCommandTimeout } ) - .scrollIntoView() - .should( 'exist' ); - cy.get( '#add-a-product', { timeout: customCommandTimeout } ).should( - 'exist' - ); - } ); -} ); + it( 'Verify when continue with store setup clicked', () => { + cy.get( '#onboarding-list [data-testid="continue"]', { timeout: customCommandTimeout } ) + .scrollIntoView() + .should( 'exist' ) + .click(); + cy.get( '#next-steps-section', { timeout: customCommandTimeout } ) + .scrollIntoView() + .should( 'exist' ); + cy.get( '#add-a-product', { + timeout: customCommandTimeout, + } ).should( 'exist' ); + } ); + } +); diff --git a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js index 2fb36de0..ec6b6a61 100644 --- a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js +++ b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js @@ -6,7 +6,9 @@ const mediumWait = 30000; const pluginId = GetPluginId(); const appId = getAppId(); -describe( 'Verify Wondercart accessibility as per site capabilities', () => { +describe( 'Verify Wondercart accessibility as per site capabilities', + { testIsolation: true }, + () => { const cTBAndYithTrue = JSON.stringify( { canAccessAI: true, canAccessHelpCenter: true, diff --git a/tests/cypress/integration/Store/storePage.cy.js b/tests/cypress/integration/Store/storePage.cy.js index 3a4be881..973e740b 100644 --- a/tests/cypress/integration/Store/storePage.cy.js +++ b/tests/cypress/integration/Store/storePage.cy.js @@ -1,5 +1,5 @@ import { GetPluginId, getAppId } from '../wp-module-support/pluginID.cy'; -import { comingSoon } from '../wp-module-support/utils.cy'; +import { comingSoon, uninstallPlugins } from '../wp-module-support/utils.cy'; const pluginId = GetPluginId(); const appId = getAppId(); @@ -7,7 +7,12 @@ const customCommandTimeout = 30000; describe( 'Store Page - WooCommerce is deactivated/uninstalled', + { testIsolation: true }, () => { + before( () => { + uninstallPlugins(); + }); + it( 'Verify Store Page renders properly without Woo', () => { cy.exec( `npx wp-env run cli wp plugin deactivate woocommerce`, { failOnNonZeroExit: false, @@ -20,17 +25,11 @@ describe( 'not.exist' ); - // Title and desctription elements display - // cy.get( '[data-testid="nfd-nowoo-store-title"]' ).should( 'exist' ); - // cy.get( '[data-testid="nfd-nowoo-store-description"]' ).should( - // 'exist' - // ); - cy.get( '.nfd-app-section-header h2' ).should( 'exist' ); - cy.get( '.nfd-app-section-header' ) - .next() - .as( 'storeFlex' ) - .should( 'exist' ); - cy.get( '@storeFlex' ).find( 'span' ).should( 'exist' ); + // Title and description elements display + cy.get( '[data-testid="nfd-nowoo-store-title"]' ).should( 'exist' ); + cy.get( '[data-testid="nfd-nowoo-store-description"]' ).should( + 'exist' + ); // Verify Store and its sub tabs should have Install WooCommerce buttons const storeNavElements = [ diff --git a/tests/cypress/integration/wp-module-support/utils.cy.js b/tests/cypress/integration/wp-module-support/utils.cy.js index 98b2ac6e..086ec919 100644 --- a/tests/cypress/integration/wp-module-support/utils.cy.js +++ b/tests/cypress/integration/wp-module-support/utils.cy.js @@ -40,7 +40,7 @@ export const comingSoon = ( shouldBeComingSoon ) => { export const installWoo = () => { cy.log( 'Installing WooCommerce' ); cy.exec( - `npx wp-env run cli wp plugin install woocommerce --activate && npx wp-env run cli wp plugin deactivate wonder-cart yith-paypal-payments-for-woocommerce-extended yith-stripe-payments-for-woocommerce-extended`, + `npx wp-env run cli wp plugin install woocommerce --activate`, { timeout: longWait, log: true, @@ -48,6 +48,13 @@ export const installWoo = () => { ); }; +export const uninstallPlugins = () => { + cy.log( 'Uninstalling plugins' ); + cy.exec( + 'npx wp-env run cli wp plugin uninstall --all --deactivate --exclude=bluehost-wordpress-plugin,wp-plugin-hostgator,wp-plugin-crazy-domains,wp-plugin-web,wp-plugin-mojo' + ); +}; + export const viewCompletedTasks = () => { cy.get( '.nfd-card.nfd-p-0', { timeout: customCommandTimeout, From 1bd84c5f396343b2e7ee561844c67d2b7748fe59 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Mon, 17 Jun 2024 15:48:21 -0400 Subject: [PATCH 13/37] add login before isolated tests --- .../cypress/integration/Home/migration.cy.js | 17 +- .../Site-Capabilities/siteCapabilities.cy.js | 173 +++++++++--------- .../cypress/integration/Store/storePage.cy.js | 6 +- 3 files changed, 110 insertions(+), 86 deletions(-) diff --git a/tests/cypress/integration/Home/migration.cy.js b/tests/cypress/integration/Home/migration.cy.js index 94d54381..d9714ef0 100644 --- a/tests/cypress/integration/Home/migration.cy.js +++ b/tests/cypress/integration/Home/migration.cy.js @@ -13,6 +13,11 @@ describe( { testIsolation: true }, () => { beforeEach( function () { + cy.login( + Cypress.env( 'wpUsername' ), + Cypress.env( 'wpPassword' ) + ); + if ( pluginId !== 'bluehost' ) { this.skip(); } @@ -33,7 +38,9 @@ describe( it( 'Verify when update nameserver clicked', () => { cy.intercept( APIList.update_nameserver ).as( 'events' ); - cy.get( '#onboarding-list [data-testid="nameservers"]', { timeout: customCommandTimeout } ) + cy.get( '#onboarding-list [data-testid="nameservers"]', { + timeout: customCommandTimeout, + } ) .scrollIntoView() .should( 'exist' ) .click(); @@ -46,7 +53,9 @@ describe( it( 'Verify when connect domain to site clicked', () => { cy.intercept( APIList.connect_domain ).as( 'events' ); - cy.get( '#onboarding-list [data-testid="domain"]', { timeout: customCommandTimeout } ) + cy.get( '#onboarding-list [data-testid="domain"]', { + timeout: customCommandTimeout, + } ) .scrollIntoView() .should( 'exist' ) .click(); @@ -58,7 +67,9 @@ describe( } ); it( 'Verify when continue with store setup clicked', () => { - cy.get( '#onboarding-list [data-testid="continue"]', { timeout: customCommandTimeout } ) + cy.get( '#onboarding-list [data-testid="continue"]', { + timeout: customCommandTimeout, + } ) .scrollIntoView() .should( 'exist' ) .click(); diff --git a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js index ec6b6a61..de6c9ed6 100644 --- a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js +++ b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js @@ -6,95 +6,104 @@ const mediumWait = 30000; const pluginId = GetPluginId(); const appId = getAppId(); -describe( 'Verify Wondercart accessibility as per site capabilities', +describe( + 'Verify Wondercart accessibility as per site capabilities', { testIsolation: true }, () => { - const cTBAndYithTrue = JSON.stringify( { - canAccessAI: true, - canAccessHelpCenter: true, - canAccessGlobalCTB: true, - hasEcomdash: false, - hasYithExtended: true, - isEcommerce: true, - isJarvis: true, - } ); + const cTBAndYithTrue = JSON.stringify( { + canAccessAI: true, + canAccessHelpCenter: true, + canAccessGlobalCTB: true, + hasEcomdash: false, + hasYithExtended: true, + isEcommerce: true, + isJarvis: true, + } ); - const cTBTrueYithFalse = JSON.stringify( { - canAccessAI: true, - canAccessHelpCenter: true, - canAccessGlobalCTB: true, - hasEcomdash: false, - hasYithExtended: false, - isEcommerce: false, - isJarvis: true, - } ); + const cTBTrueYithFalse = JSON.stringify( { + canAccessAI: true, + canAccessHelpCenter: true, + canAccessGlobalCTB: true, + hasEcomdash: false, + hasYithExtended: false, + isEcommerce: false, + isJarvis: true, + } ); - before( () => { - if ( pluginId !== 'bluehost' ) { - this.skip(); - } - installWoo(); - } ); + beforeEach( () => { + cy.login( + Cypress.env( 'wpUsername' ), + Cypress.env( 'wpPassword' ) + ); + } ); - after( () => { - cy.exec( - `npx wp-env run cli wp transient delete nfd_site_capabilities`, - { failOnNonZeroExit: false } - ); - } ); + before( () => { + if ( pluginId !== 'bluehost' ) { + this.skip(); + } + installWoo(); + } ); - it( 'Verify Sales and Discounts sub tab content and functionality', () => { - cy.exec( - `npx wp-env run cli wp transient delete nfd_site_capabilities && npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBAndYithTrue }' --format=json`, - { timeout: customCommandTimeout } - ); - cy.reload(); - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); + after( () => { + cy.exec( + `npx wp-env run cli wp transient delete nfd_site_capabilities`, + { failOnNonZeroExit: false } + ); + } ); - // Verify Install Now exists when customer has ecommerce addon - cy.get( `.${ appId }-app-subnavitem-Sales`, { - timeout: mediumWait, - } ) - .as( 'salesTab' ) - .should( 'exist' ); - cy.get( '@salesTab' ).click(); - cy.get( '#installnow-wondercart', { timeout: mediumWait } ).should( - 'exist' - ); + it( 'Verify Sales and Discounts sub tab content and functionality', () => { + cy.exec( + `npx wp-env run cli wp transient delete nfd_site_capabilities && npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBAndYithTrue }' --format=json`, + { timeout: customCommandTimeout } + ); + cy.reload(); + cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); - // Verify clicking Install Now successfully installs Wonder Cart plugin - cy.get( '#installnow-wondercart', { timeout: mediumWait } ) - .scrollIntoView() - .click(); - cy.get( '.nfd-notification--success', { - timeout: customCommandTimeout, - } ).should( 'exist' ); - cy.get( '#wonder-cart-init', { timeout: mediumWait } ).should( - 'exist' - ); - } ); + // Verify Install Now exists when customer has ecommerce addon + cy.get( `.${ appId }-app-subnavitem-Sales`, { + timeout: mediumWait, + } ) + .as( 'salesTab' ) + .should( 'exist' ); + cy.get( '@salesTab' ).click(); + cy.get( '#installnow-wondercart', { timeout: mediumWait } ).should( + 'exist' + ); - it( 'Verify Buy Now is shown when canAccessGlobalCTB is true and commerce addon is false', () => { - cy.exec( - `npx wp-env run cli wp transient delete nfd_site_capabilities && npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBTrueYithFalse }' --format=json && npx wp-env run cli wp plugin deactivate wonder-cart yith-paypal-payments-for-woocommerce-extended yith-stripe-payments-for-woocommerce-extended`, - { timeout: customCommandTimeout } - ); - cy.reload(); - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); - cy.get( `.${ appId }-app-subnavitem-Sales` ) - .as( 'salesTab' ) - .should( 'exist' ); - cy.get( '@salesTab' ).click(); - cy.get( '#buynow-wondercart', { timeout: mediumWait } ).as( - 'buyButton' - ); - cy.get( '@buyButton' ).scrollIntoView().should( 'be.visible' ); - // Verify Buy now button has correct link - cy.get( '@buyButton' ) - .should( 'have.attr', 'href' ) - .and( - 'include', - 'https://my.bluehost.com/hosting/app?utm_source=wp-marketplace&utm_medium=brand-plugin&utm_campaign=wordpress-ad&utm_content=buynow#/marketplace/product' + // Verify clicking Install Now successfully installs Wonder Cart plugin + cy.get( '#installnow-wondercart', { timeout: mediumWait } ) + .scrollIntoView() + .click(); + cy.get( '.nfd-notification--success', { + timeout: customCommandTimeout, + } ).should( 'exist' ); + cy.get( '#wonder-cart-init', { timeout: mediumWait } ).should( + 'exist' + ); + } ); + + it( 'Verify Buy Now is shown when canAccessGlobalCTB is true and commerce addon is false', () => { + cy.exec( + `npx wp-env run cli wp transient delete nfd_site_capabilities && npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBTrueYithFalse }' --format=json && npx wp-env run cli wp plugin deactivate wonder-cart yith-paypal-payments-for-woocommerce-extended yith-stripe-payments-for-woocommerce-extended`, + { timeout: customCommandTimeout } + ); + cy.reload(); + cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); + cy.get( `.${ appId }-app-subnavitem-Sales` ) + .as( 'salesTab' ) + .should( 'exist' ); + cy.get( '@salesTab' ).click(); + cy.get( '#buynow-wondercart', { timeout: mediumWait } ).as( + 'buyButton' ); - } ); -} ); + cy.get( '@buyButton' ).scrollIntoView().should( 'be.visible' ); + // Verify Buy now button has correct link + cy.get( '@buyButton' ) + .should( 'have.attr', 'href' ) + .and( + 'include', + 'https://my.bluehost.com/hosting/app?utm_source=wp-marketplace&utm_medium=brand-plugin&utm_campaign=wordpress-ad&utm_content=buynow#/marketplace/product' + ); + } ); + } +); diff --git a/tests/cypress/integration/Store/storePage.cy.js b/tests/cypress/integration/Store/storePage.cy.js index 973e740b..d4a545da 100644 --- a/tests/cypress/integration/Store/storePage.cy.js +++ b/tests/cypress/integration/Store/storePage.cy.js @@ -10,8 +10,12 @@ describe( { testIsolation: true }, () => { before( () => { + cy.login( + Cypress.env( 'wpUsername' ), + Cypress.env( 'wpPassword' ) + ); uninstallPlugins(); - }); + } ); it( 'Verify Store Page renders properly without Woo', () => { cy.exec( `npx wp-env run cli wp plugin deactivate woocommerce`, { From 359e679d2e7b21a7d0015557a4b3f9a958039ae6 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Mon, 17 Jun 2024 16:02:58 -0400 Subject: [PATCH 14/37] remove redundant cli command for storePage test --- tests/cypress/integration/Store/storePage.cy.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/cypress/integration/Store/storePage.cy.js b/tests/cypress/integration/Store/storePage.cy.js index d4a545da..8670993f 100644 --- a/tests/cypress/integration/Store/storePage.cy.js +++ b/tests/cypress/integration/Store/storePage.cy.js @@ -15,15 +15,10 @@ describe( Cypress.env( 'wpPassword' ) ); uninstallPlugins(); + cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); } ); it( 'Verify Store Page renders properly without Woo', () => { - cy.exec( `npx wp-env run cli wp plugin deactivate woocommerce`, { - failOnNonZeroExit: false, - } ); - comingSoon( false ); - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); - // Payments tab is not displayed cy.get( `.${ appId }-app-subnavitem-Payments` ).should( 'not.exist' From f5fdd789a5e4ab6b53e1fe6977a12955c4a581ca Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Mon, 17 Jun 2024 16:39:09 -0400 Subject: [PATCH 15/37] ensure fresh reload after uninstall plugins --- tests/cypress/integration/Store/storePage.cy.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/cypress/integration/Store/storePage.cy.js b/tests/cypress/integration/Store/storePage.cy.js index 8670993f..1092d60d 100644 --- a/tests/cypress/integration/Store/storePage.cy.js +++ b/tests/cypress/integration/Store/storePage.cy.js @@ -1,5 +1,5 @@ import { GetPluginId, getAppId } from '../wp-module-support/pluginID.cy'; -import { comingSoon, uninstallPlugins } from '../wp-module-support/utils.cy'; +import { uninstallPlugins } from '../wp-module-support/utils.cy'; const pluginId = GetPluginId(); const appId = getAppId(); @@ -19,6 +19,7 @@ describe( } ); it( 'Verify Store Page renders properly without Woo', () => { + cy.reload(); // Payments tab is not displayed cy.get( `.${ appId }-app-subnavitem-Payments` ).should( 'not.exist' From 63182f0ae6534599e6493b415effe65b096cbb24 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Mon, 17 Jun 2024 17:52:10 -0400 Subject: [PATCH 16/37] update test to simplify long cli command --- .../integration/Site-Capabilities/siteCapabilities.cy.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js index de6c9ed6..731acd4c 100644 --- a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js +++ b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js @@ -1,5 +1,5 @@ import { GetPluginId, getAppId } from '../wp-module-support/pluginID.cy'; -import { installWoo } from '../wp-module-support/utils.cy'; +import { uninstallPlugins, installWoo } from '../wp-module-support/utils.cy'; const customCommandTimeout = 60000; const mediumWait = 30000; @@ -35,13 +35,15 @@ describe( Cypress.env( 'wpUsername' ), Cypress.env( 'wpPassword' ) ); + uninstallPlugins(); + installWoo(); + cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); } ); before( () => { if ( pluginId !== 'bluehost' ) { this.skip(); } - installWoo(); } ); after( () => { @@ -84,7 +86,7 @@ describe( it( 'Verify Buy Now is shown when canAccessGlobalCTB is true and commerce addon is false', () => { cy.exec( - `npx wp-env run cli wp transient delete nfd_site_capabilities && npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBTrueYithFalse }' --format=json && npx wp-env run cli wp plugin deactivate wonder-cart yith-paypal-payments-for-woocommerce-extended yith-stripe-payments-for-woocommerce-extended`, + `npx wp-env run cli wp transient delete nfd_site_capabilities && npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBTrueYithFalse }' --format=json`, { timeout: customCommandTimeout } ); cy.reload(); From ce15563aab3102cb60ab7b2cd215768bbe5e9c54 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 18 Jun 2024 15:19:38 -0400 Subject: [PATCH 17/37] split out long tests into files and start testIsolation --- build/index.asset.php | 2 +- .../Home/ecommerce-coming-soon.cy.js | 88 +++++++++++++ .../integration/Home/ecommerce-live.cy.js | 39 ++++++ ...ePage.cy.js => ecommerce-next-steps.cy.js} | 123 +----------------- .../integration/Home/homePageWithWoo.cy.js | 12 +- 5 files changed, 140 insertions(+), 124 deletions(-) create mode 100644 tests/cypress/integration/Home/ecommerce-coming-soon.cy.js create mode 100644 tests/cypress/integration/Home/ecommerce-live.cy.js rename tests/cypress/integration/Home/{commerceHomePage.cy.js => ecommerce-next-steps.cy.js} (63%) diff --git a/build/index.asset.php b/build/index.asset.php index b68f6dde..2d040723 100644 --- a/build/index.asset.php +++ b/build/index.asset.php @@ -1 +1 @@ - array('lodash', 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '82fc366b1c64c71eb887'); + array('lodash', 'moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => 'fcffdffca026344a7b49'); diff --git a/tests/cypress/integration/Home/ecommerce-coming-soon.cy.js b/tests/cypress/integration/Home/ecommerce-coming-soon.cy.js new file mode 100644 index 00000000..a1f64c83 --- /dev/null +++ b/tests/cypress/integration/Home/ecommerce-coming-soon.cy.js @@ -0,0 +1,88 @@ +import { GetPluginId } from '../wp-module-support/pluginID.cy'; +import { comingSoon, uninstallPlugins } from '../wp-module-support/utils.cy'; +import { EventsAPI, APIList } from '../wp-module-support/eventsAPIs.cy'; + +const customCommandTimeout = 20000; +const pluginId = GetPluginId(); +const hg_region = 'br'; + +describe( + 'e-commerce Home Page- Coming soon mode', + { testIsolation: true }, + () => { + beforeEach( () => { + cy.login( + Cypress.env( 'wpUsername' ), + Cypress.env( 'wpPassword' ) + ); + uninstallPlugins(); + comingSoon( true ); + cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); + } ); + + it( 'Verify Congrats on your new site message, coming soon alert', () => { + cy.get( '.nfd-gap-4 .nfd-title.nfd-title--2', { + timeout: customCommandTimeout, + } ) + .eq( 0 ) + .should( 'exist' ); + cy.get( '.nfd-alert.nfd-alert--warning', { + timeout: customCommandTimeout, + } ) + .as( 'comingsoonalert' ) + .should( 'exist' ); + cy.get( '@comingsoonalert' ) + .find( '.nfd-validation-icon' ) + .should( 'exist' ); + cy.get( '@comingsoonalert' ) + .find( '.nfd-validation-message' ) + .should( 'exist' ); + } ); + + it( 'Verify Site Preview flex and View your site option', () => { + cy.get( '.nfd-justify-start > .nfd-flex-col > .nfd-absolute', { + timeout: customCommandTimeout, + } ) + .as( 'sitePreviewFlex' ) + .should( 'exist' ); + cy.get( '@sitePreviewFlex' ) + .trigger( 'mouseover' ) + .find( '[data-cy="view-site"]' ) + .should( 'exist' ) + .invoke( 'removeAttr', 'target' ) + .click(); + cy.url().should( 'eq', Cypress.config().baseUrl + '/' ); + cy.go( 'back' ); + } ); + + it( 'Verify presense of Ready to go to live? canvas', () => { + cy.get( '.nfd-px-4', { timeout: customCommandTimeout } ) + .as( 'readyToGoNextLevel' ) + .should( 'exist' ); + cy.get( '@readyToGoNextLevel', { timeout: customCommandTimeout } ) + .find( '.nfd-flex-1 h1' ) + .should( 'exist' ); + cy.get( '@readyToGoNextLevel' ) + .find( '.nfd-flex-1 span' ) + .should( 'exist' ); + cy.get( '@readyToGoNextLevel', { timeout: customCommandTimeout } ) + .find( '#view-site' ) + .should( 'exist' ); + cy.get( '@readyToGoNextLevel' ) + .find( '#launch-site' ) + .should( 'exist' ); + } ); + + it( 'Verify Visit your site and Launch your site functionality', () => { + cy.get( '.nfd-flex-none > .nfd-button--secondary', { + timeout: customCommandTimeout, + } ) + .invoke( 'removeAttr', 'target' ) + .click(); + cy.url().should( 'eq', Cypress.config().baseUrl + '/' ); + cy.go( 'back' ); + cy.get( '.nfd-flex-none > .nfd-button--upsell' ).click(); + cy.get( '.nfd-notification--success' ).should( 'exist' ); + } ); + } +); diff --git a/tests/cypress/integration/Home/ecommerce-live.cy.js b/tests/cypress/integration/Home/ecommerce-live.cy.js new file mode 100644 index 00000000..d2346af3 --- /dev/null +++ b/tests/cypress/integration/Home/ecommerce-live.cy.js @@ -0,0 +1,39 @@ +import { GetPluginId } from '../wp-module-support/pluginID.cy'; +import { + comingSoon, + uninstallPlugins, +} from '../wp-module-support/utils.cy'; + +const customCommandTimeout = 20000; +const pluginId = GetPluginId(); + +describe( 'e-commerce Home Page- Live Mode', { testIsolation: true }, () => { + beforeEach( () => { + cy.login( Cypress.env( 'wpUsername' ), Cypress.env( 'wpPassword' ) ); + uninstallPlugins(); + comingSoon( false ); + cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); + } ); + + it( 'Verify presense of Ready to go to next level? canvas', () => { + cy.get( '.nfd-flex.nfd-gap-4', { timeout: customCommandTimeout } ) + .eq( 2 ) + .as( 'readyToGoNextLevel' ) + .should( 'exist' ); + cy.get( '@readyToGoNextLevel', { timeout: customCommandTimeout } ) + .find( 'h1' ) + .should( 'exist' ); + cy.get( '@readyToGoNextLevel' ).find( 'div span' ).should( 'exist' ); + } ); + + it( 'Verify by default View Site option should be displayed', () => { + cy.get( '.nfd-button--primary', { + timeout: customCommandTimeout, + } ) + .eq( 1 ) + .should( 'exist' ) + .invoke( 'removeAttr', 'target' ) + .click(); + cy.url().should( 'eq', Cypress.config().baseUrl + '/' ); + } ); +} ); diff --git a/tests/cypress/integration/Home/commerceHomePage.cy.js b/tests/cypress/integration/Home/ecommerce-next-steps.cy.js similarity index 63% rename from tests/cypress/integration/Home/commerceHomePage.cy.js rename to tests/cypress/integration/Home/ecommerce-next-steps.cy.js index 1e2d2c73..68b17edb 100644 --- a/tests/cypress/integration/Home/commerceHomePage.cy.js +++ b/tests/cypress/integration/Home/ecommerce-next-steps.cy.js @@ -2,7 +2,7 @@ import { GetPluginId } from '../wp-module-support/pluginID.cy'; import { comingSoon, viewCompletedTasks, - viewRemainingTasks + viewRemainingTasks, } from '../wp-module-support/utils.cy'; import { EventsAPI, APIList } from '../wp-module-support/eventsAPIs.cy'; @@ -10,122 +10,7 @@ const customCommandTimeout = 20000; const pluginId = GetPluginId(); const hg_region = 'br'; -describe( 'Commerce Home Page- Coming soon mode', () => { - before( () => { - cy.exec( `npx wp-env run cli wp plugin deactivate woocommerce`, { - failOnNonZeroExit: false, - } ); - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); - comingSoon( true ); - } ); - - beforeEach( () => { - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); - } ); - - it( 'Verify Congrats on your new site message, coming soon alert', () => { - cy.get( '.nfd-gap-4 .nfd-title.nfd-title--2', { - timeout: customCommandTimeout, - } ) - .eq( 0 ) - .should( 'exist' ); - cy.get( '.nfd-alert.nfd-alert--warning', { - timeout: customCommandTimeout, - } ) - .as( 'comingsoonalert' ) - .should( 'exist' ); - cy.get( '@comingsoonalert' ) - .find( '.nfd-validation-icon' ) - .should( 'exist' ); - cy.get( '@comingsoonalert' ) - .find( '.nfd-validation-message' ) - .should( 'exist' ); - } ); - - it( 'Verify Site Preview flex and View your site option', () => { - cy.get( '.nfd-justify-start > .nfd-flex-col > .nfd-absolute', { - timeout: customCommandTimeout, - } ) - .as( 'sitePreviewFlex' ) - .should( 'exist' ); - cy.get( '@sitePreviewFlex' ) - .trigger( 'mouseover' ) - .find( '[data-cy="view-site"]' ) - .should( 'exist' ) - .invoke( 'removeAttr', 'target' ) - .click(); - cy.url().should( 'eq', Cypress.config().baseUrl + '/' ); - cy.go( 'back' ); - } ); - - it( 'Verify presense of Ready to go to live? canvas', () => { - cy.get( '.nfd-px-4', { timeout: customCommandTimeout } ) - .as( 'readyToGoNextLevel' ) - .should( 'exist' ); - cy.get( '@readyToGoNextLevel', { timeout: customCommandTimeout } ) - .find( '.nfd-flex-1 h1' ) - .should( 'exist' ); - cy.get( '@readyToGoNextLevel' ) - .find( '.nfd-flex-1 span' ) - .should( 'exist' ); - cy.get( '@readyToGoNextLevel', { timeout: customCommandTimeout } ) - .find( '#view-site' ) - .should( 'exist' ) - cy.get( '@readyToGoNextLevel' ) - .find( '#launch-site' ) - .should( 'exist' ) - } ); - - it( 'Verify Visit your site and Launch your site functionality', () => { - cy.get( '.nfd-flex-none > .nfd-button--secondary', { - timeout: customCommandTimeout, - } ) - .invoke( 'removeAttr', 'target' ) - .click(); - cy.url().should( 'eq', Cypress.config().baseUrl + '/' ); - cy.go( 'back' ); - cy.get( '.nfd-flex-none > .nfd-button--upsell' ).click(); - cy.get( '.nfd-notification--success' ).should( 'exist' ); - } ); -} ); - -describe( 'Commerce Home Page- Live Mode', () => { - before( () => { - cy.exec( `npx wp-env run cli wp plugin deactivate woocommerce`, { - failOnNonZeroExit: false, - } ); - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); - comingSoon( false ); - } ); - - beforeEach( () => { - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); - } ); - - it( 'Verify presense of Ready to go to next level? canvas', () => { - cy.get( '.nfd-flex.nfd-gap-4', { timeout: customCommandTimeout } ) - .eq( 2 ) - .as( 'readyToGoNextLevel' ) - .should( 'exist' ); - cy.get( '@readyToGoNextLevel', { timeout: customCommandTimeout } ) - .find( 'h1' ) - .should( 'exist' ); - cy.get( '@readyToGoNextLevel' ).find( 'div span' ).should( 'exist' ); - } ); - - it( 'Verify by default View Site option should be displayed', () => { - cy.get( '.nfd-button--primary', { - timeout: customCommandTimeout, - } ) - .eq( 1 ) - .should( 'exist' ) - .invoke( 'removeAttr', 'target' ) - .click(); - cy.url().should( 'eq', Cypress.config().baseUrl + '/' ); - } ); -} ); - -describe( 'Commerce Home Page- Next Steps', () => { +describe( 'e-commerce Home Page- Next Steps', () => { const step_id = [ 'add-a-new-page-to-your-site', 'upload-media-to-your-site', @@ -202,6 +87,10 @@ describe( 'Commerce Home Page- Next Steps', () => { } ).click( { force: true } ); cy.get( '.navigation-buttons_next' ).click( { force: true } ); cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); + cy.exec( `npx wp-env run cli wp plugin deactivate woocommerce`, { + failOnNonZeroExit: false, + } ); + cy.wait( 2000 ); cy.reload(); cy.get( '#next-steps-section', { timeout: customCommandTimeout } ) .as( 'nextSteps' ) diff --git a/tests/cypress/integration/Home/homePageWithWoo.cy.js b/tests/cypress/integration/Home/homePageWithWoo.cy.js index 04aa4d7b..380f2459 100644 --- a/tests/cypress/integration/Home/homePageWithWoo.cy.js +++ b/tests/cypress/integration/Home/homePageWithWoo.cy.js @@ -5,20 +5,20 @@ import { viewCompletedTasks, viewRemainingTasks, waitForNextSteps, + uninstallPlugins, } from '../wp-module-support/utils.cy'; const customCommandTimeout = 20000; const pluginId = GetPluginId(); const appId = getAppId(); -describe( 'Commerce Home Page- When WooCommerce is installed', () => { - before( () => { - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); +describe( 'Commerce Home Page- When WooCommerce is installed', + { testIsolation: true }, + () => { + beforeEach( () => { + uninstallPlugins(); installWoo(); comingSoon( true ); - } ); - - beforeEach( () => { cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); } ); From 056e1099c4eedc2faf8b1337e46050d9b515d146 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 18 Jun 2024 16:52:52 -0400 Subject: [PATCH 18/37] simplify tests, update cli command to use option update and remove extraneous cli command --- .../Site-Capabilities/siteCapabilities.cy.js | 30 ++++++++----------- .../integration/wp-module-support/utils.cy.js | 8 +++++ 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js index 8fb167ee..8d4f25dc 100644 --- a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js +++ b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js @@ -1,5 +1,8 @@ import { GetPluginId, getAppId } from '../wp-module-support/pluginID.cy'; -import { uninstallPlugins, installWoo } from '../wp-module-support/utils.cy'; +import { + uninstallPlugins, + installWoo, +} from '../wp-module-support/utils.cy'; const customCommandTimeout = 60000; const mediumWait = 30000; @@ -7,10 +10,10 @@ const pluginId = GetPluginId(); const appId = getAppId(); describe( - 'Verify Wondercart accessibility as per site capabilities', + 'Verify Wondercart follows site capabilities', { testIsolation: true }, () => { - const cTBAndYithTrue = JSON.stringify( { + const CTBAndYithTrue = JSON.stringify( { canAccessAI: true, canAccessHelpCenter: true, canAccessGlobalCTB: true, @@ -20,7 +23,7 @@ describe( isJarvis: true, } ); - const cTBTrueYithFalse = JSON.stringify( { + const CTBTrueYithFalse = JSON.stringify( { canAccessAI: true, canAccessHelpCenter: true, canAccessGlobalCTB: true, @@ -37,10 +40,6 @@ describe( ); uninstallPlugins(); installWoo(); - cy.exec( - `npx wp-env run cli wp transient delete nfd_site_capabilities`, - { failOnNonZeroExit: false } - ); cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); } ); @@ -50,16 +49,11 @@ describe( } } ); - after( () => { - cy.exec( - `npx wp-env run cli wp transient delete nfd_site_capabilities`, - { failOnNonZeroExit: false } - ); - } ); - it( 'Verify Sales and Discounts sub tab content and functionality', () => { + // Install button is displayed when capabilities are true + cy.log( 'Update capabilities transient: CTBAndYithTrue' ); cy.exec( - `npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBAndYithTrue }' --format=json`, + `npx wp-env run cli wp option update _transient_nfd_site_capabilities '${ CTBAndYithTrue }' --format=json`, { timeout: customCommandTimeout } ); cy.reload(); @@ -89,8 +83,10 @@ describe( } ); it( 'Verify Buy Now is shown when canAccessGlobalCTB is true and commerce addon is false', () => { + // Buy now button is displayed when capabilities are false. + cy.log( 'Update capabilities transient: CTBTrueYithFalse' ); cy.exec( - `npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBTrueYithFalse }' --format=json`, + `npx wp-env run cli wp option update _transient_nfd_site_capabilities '${ CTBTrueYithFalse }' --format=json`, { timeout: customCommandTimeout } ); cy.reload(); diff --git a/tests/cypress/integration/wp-module-support/utils.cy.js b/tests/cypress/integration/wp-module-support/utils.cy.js index 086ec919..029b7099 100644 --- a/tests/cypress/integration/wp-module-support/utils.cy.js +++ b/tests/cypress/integration/wp-module-support/utils.cy.js @@ -77,3 +77,11 @@ export const waitForNextSteps = () => { .scrollIntoView() .should( 'exist' ); }; + +export const deleteCapabilitiesTransient = () => { + cy.log( 'Deleting capabilities transient' ); + cy.exec( + `npx wp-env run cli wp transient delete nfd_site_capabilities`, + { failOnNonZeroExit: false } + ); +}; \ No newline at end of file From 4b476a0014f72f8fe3fe14fddde39e88860bbb41 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 18 Jun 2024 16:53:31 -0400 Subject: [PATCH 19/37] remove irrelevant coming soon toggle in home test --- .../integration/Home/homePageWithWoo.cy.js | 360 +++++++++--------- 1 file changed, 184 insertions(+), 176 deletions(-) diff --git a/tests/cypress/integration/Home/homePageWithWoo.cy.js b/tests/cypress/integration/Home/homePageWithWoo.cy.js index 380f2459..df95090b 100644 --- a/tests/cypress/integration/Home/homePageWithWoo.cy.js +++ b/tests/cypress/integration/Home/homePageWithWoo.cy.js @@ -1,6 +1,5 @@ import { GetPluginId, getAppId } from '../wp-module-support/pluginID.cy'; import { - comingSoon, installWoo, viewCompletedTasks, viewRemainingTasks, @@ -12,194 +11,203 @@ const customCommandTimeout = 20000; const pluginId = GetPluginId(); const appId = getAppId(); -describe( 'Commerce Home Page- When WooCommerce is installed', +describe( + 'e-commerce Home Page - When WooCommerce is installed', { testIsolation: true }, () => { - beforeEach( () => { - uninstallPlugins(); - installWoo(); - comingSoon( true ); - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); - } ); - - after( () => { - cy.exec(`npx wp-env run cli wp plugin deactivate woocommerce`, { - failOnNonZeroExit: false, + beforeEach( () => { + cy.login( + Cypress.env( 'wpUsername' ), + Cypress.env( 'wpPassword' ) + ); + uninstallPlugins(); + installWoo(); + cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); + } ); + + after( () => { + uninstallPlugins(); + } ); + + it( 'Verify next steps "Add your store info"', () => { + waitForNextSteps(); + cy.get( '#add-your-store-info a', { + timeout: customCommandTimeout, + } ) + .as( 'storeInfoStep' ) + .should( 'exist' ) + .scrollIntoView() + .click(); + cy.get( `.${ appId }-app-subnavitem-Store.active` ).should( + 'exist' + ); + cy.get( 'h2' ).should( 'exist' ); + cy.get( '.nfd-border-t .nfd-button--primary' ).should( + 'be.disabled' + ); + + // Select country + cy.get( '[data-id="store-country-select"]' ).click(); + cy.contains( '.nfd-select__option', 'United States (US)' ).click(); + // Enter city + cy.get( '[name="woocommerce_store_address"]' ).type( + 'Sunflower Canal' + ); + cy.get( '[name="woocommerce_store_city"]' ).type( 'Safford' ); + // Select state + cy.get( '[data-id="state-select"]' ).click(); + cy.contains( '.nfd-select__option', 'Arizona' ).click(); + // Enter postcode + cy.get( '[name="woocommerce_store_postcode"]' ).type( '85546' ); + // Select Currency + cy.get( '[data-id="currency"]' ).click(); + cy.contains( + '.nfd-select__option', + 'United States (US) dollar ($)' + ).click(); + + cy.get( '.nfd-border-t .nfd-button--primary' ) + .should( 'not.be.disabled' ) + .click(); + + cy.get( + '.nfd-notifications--bottom-left .nfd-notification--success', + { + timeout: customCommandTimeout, + } + ).should( 'exist' ); + cy.get( '.nfd-w-0 p' ).should( 'exist' ); + + cy.get( `.${ appId }-app-navitem-Home` ).click(); + waitForNextSteps(); + cy.get( '@storeInfoStep', { + timeout: customCommandTimeout, + } ).should( 'not.exist' ); + viewCompletedTasks(); + cy.get( '@storeInfoStep' ).should( 'exist' ); + viewRemainingTasks(); } ); - cy.visit('/wp-admin/admin.php?page=' + pluginId + '#/home'); - } ); - - it( 'Verify next steps "Add your store info"', () => { - waitForNextSteps(); - cy.get( '#add-your-store-info a', { - timeout: customCommandTimeout, - } ) - .as( 'storeInfoStep' ) - .should( 'exist' ) - .scrollIntoView() - .click(); - cy.get( `.${ appId }-app-subnavitem-Store.active` ).should( 'exist' ); - cy.get( 'h2' ).should( 'exist' ); - cy.get( '.nfd-border-t .nfd-button--primary' ).should( 'be.disabled' ); - - // Select country - cy.get( '[data-id="store-country-select"]' ).click(); - cy.contains( '.nfd-select__option', 'United States (US)' ).click(); - // Enter city - cy.get( '[name="woocommerce_store_address"]' ).type( - 'Sunflower Canal' - ); - cy.get( '[name="woocommerce_store_city"]' ).type( 'Safford' ); - // Select state - cy.get( '[data-id="state-select"]' ).click(); - cy.contains( '.nfd-select__option', 'Arizona' ).click(); - // Enter postcode - cy.get( '[name="woocommerce_store_postcode"]' ).type( '85546' ); - // Select Currency - cy.get( '[data-id="currency"]' ).click(); - cy.contains( - '.nfd-select__option', - 'United States (US) dollar ($)' - ).click(); - - cy.get( '.nfd-border-t .nfd-button--primary' ) - .should( 'not.be.disabled' ) - .click(); - - cy.get( '.nfd-notifications--bottom-left .nfd-notification--success', { - timeout: customCommandTimeout, - } ).should( 'exist' ); - cy.get( '.nfd-w-0 p' ).should( 'exist' ); - - cy.get( `.${ appId }-app-navitem-Home` ).click(); - waitForNextSteps(); - cy.get( '@storeInfoStep', { timeout: customCommandTimeout } ).should( - 'not.exist' - ); - viewCompletedTasks(); - cy.get( '@storeInfoStep' ).should( 'exist' ); - viewRemainingTasks(); - } ); - - it( 'Verify next step "Connect a payment processor"', () => { - cy.reload(); - waitForNextSteps(); - cy.get( '#connect-a-payment-processor a', { - timeout: customCommandTimeout, - } ) - .as( 'paymentStep' ) - .should( 'exist' ) - .scrollIntoView() - .click(); - cy.get( `.${ appId }-app-subnavitem-Payments.active`, { - timeout: customCommandTimeout, - } ).should( 'exist' ); - cy.get( '#razorpay-section' ).as( 'razorpayBlock' ); - cy.get( '@razorpayBlock' ).find( '#install-razorpay' ).click(); - - cy.get( '[data-id="rzpTestModeToggle"]', { - timeout: customCommandTimeout, - } ).should( 'exist' ); - cy.get( '[data-id="rzpTestModeToggle"]' ).click(); - cy.get( '[name="key_id"]' ).type( 'rzp_test_qn0AnShxeczQr4' ); - cy.get( '[name="key_secret"]' ).type( 'rzp_test_qn0AnShxeczQr4' ); - - cy.get( '.nfd-border-t .nfd-button--primary' ).click(); - - cy.get( '@razorpayBlock', { timeout: customCommandTimeout } ) - .find( '.nfd-badge--upsell', { timeout: customCommandTimeout } ) - .should( 'exist' ); - - cy.get( `.${ appId }-app-navitem-Home` ).click(); - waitForNextSteps(); - cy.get( '@paymentStep' ).should( 'not.exist' ); - viewCompletedTasks(); - cy.get( '@paymentStep' ).should( 'exist' ); - viewRemainingTasks(); - - // Delete razorpay settings from DB - cy.exec( - `npx wp-env run cli wp option delete nfd-ecommerce-captive-flow-razorpay` - ); - cy.exec( - `npx wp-env run cli wp option delete woocommerce_razorpay_settings` - ); - } ); - - it( ' Verify next step "Set up Shipping options" ', () => { - if ( pluginId == 'bluehost' ) { + + it( 'Verify next step "Connect a payment processor"', () => { + cy.reload(); waitForNextSteps(); - cy.get( '#setup-shipping-options a', { + cy.get( '#connect-a-payment-processor a', { timeout: customCommandTimeout, } ) .as( 'paymentStep' ) .should( 'exist' ) .scrollIntoView() .click(); + cy.get( `.${ appId }-app-subnavitem-Payments.active`, { + timeout: customCommandTimeout, + } ).should( 'exist' ); + cy.get( '#razorpay-section' ).as( 'razorpayBlock' ); + cy.get( '@razorpayBlock' ).find( '#install-razorpay' ).click(); - cy.get( '#install-shippo', { + cy.get( '[data-id="rzpTestModeToggle"]', { timeout: customCommandTimeout, - } ).click(); - cy.get( '#installing-shippo' ).should( 'not.exist' ); + } ).should( 'exist' ); + cy.get( '[data-id="rzpTestModeToggle"]' ).click(); + cy.get( '[name="key_id"]' ).type( 'rzp_test_qn0AnShxeczQr4' ); + cy.get( '[name="key_secret"]' ).type( 'rzp_test_qn0AnShxeczQr4' ); - cy.window().then( ( win ) => { - cy.spy( win, 'open', ( url ) => { - win.location.href = - 'https://goshippo.com/oauth/register?next=/oauth/authorize'; - } ).as( 'windowOpen' ); - } ); + cy.get( '.nfd-border-t .nfd-button--primary' ).click(); - cy.get( '#connect-to-shippo-btn', { + cy.get( '@razorpayBlock', { timeout: customCommandTimeout } ) + .find( '.nfd-badge--upsell', { timeout: customCommandTimeout } ) + .should( 'exist' ); + + cy.get( `.${ appId }-app-navitem-Home` ).click(); + waitForNextSteps(); + cy.get( '@paymentStep' ).should( 'not.exist' ); + viewCompletedTasks(); + cy.get( '@paymentStep' ).should( 'exist' ); + viewRemainingTasks(); + + // Delete razorpay settings from DB + cy.exec( + `npx wp-env run cli wp option delete nfd-ecommerce-captive-flow-razorpay woocommerce_razorpay_settings` + ); + } ); + + it( ' Verify next step "Set up Shipping options" ', () => { + if ( pluginId == 'bluehost' ) { + waitForNextSteps(); + cy.get( '#setup-shipping-options a', { + timeout: customCommandTimeout, + } ) + .as( 'paymentStep' ) + .should( 'exist' ) + .scrollIntoView() + .click(); + + cy.get( '#install-shippo', { + timeout: customCommandTimeout, + } ).click(); + cy.get( '#installing-shippo' ).should( 'not.exist' ); + + cy.window().then( ( win ) => { + cy.spy( win, 'open', ( url ) => { + win.location.href = + 'https://goshippo.com/oauth/register?next=/oauth/authorize'; + } ).as( 'windowOpen' ); + } ); + + cy.get( '#connect-to-shippo-btn', { + timeout: customCommandTimeout, + } ).click(); + cy.get( '@windowOpen', { + timeout: customCommandTimeout, + } ).should( 'be.called' ); + } + } ); + + it( 'Verify next step "Configure tax settings"', () => { + waitForNextSteps(); + cy.get( '#configure-tax-settings a', { + timeout: customCommandTimeout, + } ) + .as( 'taxStep' ) + .should( 'exist' ) + .scrollIntoView() + .click(); + cy.get( `.${ appId }-app-subnavitem-Store.active`, { timeout: customCommandTimeout, - } ).click(); - cy.get( '@windowOpen', { timeout: customCommandTimeout } ).should( - 'be.called' + } ).should( 'exist' ); + cy.get( '#tax-yes' ).click(); + cy.get( '.nfd-border-t .nfd-button--primary' ).click(); + + cy.get( + '.nfd-notifications--bottom-left .nfd-notification--success', + { + timeout: customCommandTimeout, + } + ).should( 'exist' ); + cy.get( '.nfd-w-0 p' ).should( 'exist' ); + + cy.get( `.${ appId }-app-navitem-Home` ).click(); + cy.reload(); + waitForNextSteps(); + cy.get( '@taxStep', { timeout: 30000 } ).should( 'not.exist' ); + viewCompletedTasks(); + cy.get( '@taxStep' ).should( 'exist' ); + viewRemainingTasks(); + } ); + + it( 'Verify next step "Add a Product"', () => { + waitForNextSteps(); + cy.get( '#add-a-product a', { + timeout: customCommandTimeout, + } ) + .as( 'addProduct' ) + .should( 'exist' ) + .click(); + cy.url().should( + 'eq', + Cypress.config().baseUrl + + '/wp-admin/post-new.php?post_type=product&return_to_nfd=%2Fhome' ); - } - } ); - - it( 'Verify next step "Configure tax settings"', () => { - waitForNextSteps(); - cy.get( '#configure-tax-settings a', { - timeout: customCommandTimeout, - } ) - .as( 'taxStep' ) - .should( 'exist' ) - .scrollIntoView() - .click(); - cy.get( `.${ appId }-app-subnavitem-Store.active`, { - timeout: customCommandTimeout, - } ).should( 'exist' ); - cy.get( '#tax-yes' ).click(); - cy.get( '.nfd-border-t .nfd-button--primary' ).click(); - - cy.get( '.nfd-notifications--bottom-left .nfd-notification--success', { - timeout: customCommandTimeout, - } ).should( 'exist' ); - cy.get( '.nfd-w-0 p' ).should( 'exist' ); - - cy.get( `.${ appId }-app-navitem-Home` ).click(); - cy.reload(); - waitForNextSteps(); - cy.get( '@taxStep', { timeout: 30000 } ).should( 'not.exist' ); - viewCompletedTasks(); - cy.get( '@taxStep' ).should( 'exist' ); - viewRemainingTasks(); - } ); - - it( 'Verify next step "Add a Product"', () => { - waitForNextSteps(); - cy.get( '#add-a-product a', { - timeout: customCommandTimeout, - } ) - .as( 'addProduct' ) - .should( 'exist' ) - .click(); - cy.url().should( - 'eq', - Cypress.config().baseUrl + - '/wp-admin/post-new.php?post_type=product&return_to_nfd=%2Fhome' - ); - cy.go( 'back' ); - } ); -} ); + cy.go( 'back' ); + } ); + } +); From 7a70105d9a9f64e21954beef25531b1ce9b011e4 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 18 Jun 2024 17:09:05 -0400 Subject: [PATCH 20/37] remove extra spaces in test definition --- tests/cypress/integration/Home/homePageWithWoo.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cypress/integration/Home/homePageWithWoo.cy.js b/tests/cypress/integration/Home/homePageWithWoo.cy.js index df95090b..f68371ad 100644 --- a/tests/cypress/integration/Home/homePageWithWoo.cy.js +++ b/tests/cypress/integration/Home/homePageWithWoo.cy.js @@ -130,7 +130,7 @@ describe( ); } ); - it( ' Verify next step "Set up Shipping options" ', () => { + it( 'Verify next step "Set up Shipping options"', () => { if ( pluginId == 'bluehost' ) { waitForNextSteps(); cy.get( '#setup-shipping-options a', { From 9c03ec058481a01abc422c99d1ce9a680bcfcabc Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 18 Jun 2024 17:09:28 -0400 Subject: [PATCH 21/37] try reload after page visit --- .../integration/Site-Capabilities/siteCapabilities.cy.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js index 8d4f25dc..27fab1b5 100644 --- a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js +++ b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js @@ -56,8 +56,8 @@ describe( `npx wp-env run cli wp option update _transient_nfd_site_capabilities '${ CTBAndYithTrue }' --format=json`, { timeout: customCommandTimeout } ); - cy.reload(); cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); + cy.reload(); // Verify Install Now exists when customer has ecommerce addon cy.get( `.${ appId }-app-subnavitem-Sales`, { @@ -89,8 +89,9 @@ describe( `npx wp-env run cli wp option update _transient_nfd_site_capabilities '${ CTBTrueYithFalse }' --format=json`, { timeout: customCommandTimeout } ); - cy.reload(); cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); + cy.reload(); + cy.get( `.${ appId }-app-subnavitem-Sales` ) .as( 'salesTab' ) .should( 'exist' ); From 9a9e04a8d59c2e601f0f35b433f9c8d205bd1d44 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 18 Jun 2024 18:07:48 -0400 Subject: [PATCH 22/37] use utils wpLogin method --- .../Home/ecommerce-coming-soon.cy.js | 11 ++-- .../integration/Home/ecommerce-live.cy.js | 3 +- .../integration/Home/homePageWithWoo.cy.js | 6 +- .../cypress/integration/Home/migration.cy.js | 7 +- .../Site-Capabilities/siteCapabilities.cy.js | 64 +++++++++---------- .../cypress/integration/Store/storePage.cy.js | 7 +- .../integration/wp-module-support/utils.cy.js | 4 ++ 7 files changed, 49 insertions(+), 53 deletions(-) diff --git a/tests/cypress/integration/Home/ecommerce-coming-soon.cy.js b/tests/cypress/integration/Home/ecommerce-coming-soon.cy.js index a1f64c83..e0574e72 100644 --- a/tests/cypress/integration/Home/ecommerce-coming-soon.cy.js +++ b/tests/cypress/integration/Home/ecommerce-coming-soon.cy.js @@ -1,5 +1,9 @@ import { GetPluginId } from '../wp-module-support/pluginID.cy'; -import { comingSoon, uninstallPlugins } from '../wp-module-support/utils.cy'; +import { + wpLogin, + comingSoon, + uninstallPlugins, +} from '../wp-module-support/utils.cy'; import { EventsAPI, APIList } from '../wp-module-support/eventsAPIs.cy'; const customCommandTimeout = 20000; @@ -11,10 +15,7 @@ describe( { testIsolation: true }, () => { beforeEach( () => { - cy.login( - Cypress.env( 'wpUsername' ), - Cypress.env( 'wpPassword' ) - ); + wpLogin(); uninstallPlugins(); comingSoon( true ); cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); diff --git a/tests/cypress/integration/Home/ecommerce-live.cy.js b/tests/cypress/integration/Home/ecommerce-live.cy.js index d2346af3..9ff3d278 100644 --- a/tests/cypress/integration/Home/ecommerce-live.cy.js +++ b/tests/cypress/integration/Home/ecommerce-live.cy.js @@ -1,5 +1,6 @@ import { GetPluginId } from '../wp-module-support/pluginID.cy'; import { + wpLogin, comingSoon, uninstallPlugins, } from '../wp-module-support/utils.cy'; @@ -9,7 +10,7 @@ const pluginId = GetPluginId(); describe( 'e-commerce Home Page- Live Mode', { testIsolation: true }, () => { beforeEach( () => { - cy.login( Cypress.env( 'wpUsername' ), Cypress.env( 'wpPassword' ) ); + wpLogin(); uninstallPlugins(); comingSoon( false ); cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); diff --git a/tests/cypress/integration/Home/homePageWithWoo.cy.js b/tests/cypress/integration/Home/homePageWithWoo.cy.js index f68371ad..b8058554 100644 --- a/tests/cypress/integration/Home/homePageWithWoo.cy.js +++ b/tests/cypress/integration/Home/homePageWithWoo.cy.js @@ -1,5 +1,6 @@ import { GetPluginId, getAppId } from '../wp-module-support/pluginID.cy'; import { + wpLogin, installWoo, viewCompletedTasks, viewRemainingTasks, @@ -16,10 +17,7 @@ describe( { testIsolation: true }, () => { beforeEach( () => { - cy.login( - Cypress.env( 'wpUsername' ), - Cypress.env( 'wpPassword' ) - ); + wpLogin(); uninstallPlugins(); installWoo(); cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); diff --git a/tests/cypress/integration/Home/migration.cy.js b/tests/cypress/integration/Home/migration.cy.js index 3cc4f745..35d3cb8c 100644 --- a/tests/cypress/integration/Home/migration.cy.js +++ b/tests/cypress/integration/Home/migration.cy.js @@ -1,6 +1,6 @@ import { GetPluginId } from '../wp-module-support/pluginID.cy'; import { EventsAPI, APIList } from '../wp-module-support/eventsAPIs.cy'; - +import { wpLogin } from '../wp-module-support/utils.cy'; const customCommandTimeout = 20000; const pluginId = GetPluginId(); const helpCenter = JSON.stringify( { @@ -13,10 +13,7 @@ describe( { testIsolation: true }, () => { beforeEach( function () { - cy.login( - Cypress.env( 'wpUsername' ), - Cypress.env( 'wpPassword' ) - ); + wpLogin(); if ( pluginId !== 'bluehost' ) { this.skip(); diff --git a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js index 27fab1b5..1ff41835 100644 --- a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js +++ b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js @@ -1,5 +1,6 @@ import { GetPluginId, getAppId } from '../wp-module-support/pluginID.cy'; import { + wpLogin, uninstallPlugins, installWoo, } from '../wp-module-support/utils.cy'; @@ -34,13 +35,10 @@ describe( } ); beforeEach( () => { - cy.login( - Cypress.env( 'wpUsername' ), - Cypress.env( 'wpPassword' ) - ); + wpLogin(); uninstallPlugins(); installWoo(); - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); + cy.visit( '/wp-admin/admin.php?page=' + pluginId ); } ); before( () => { @@ -49,6 +47,33 @@ describe( } } ); + it( 'Verify Buy Now is shown when canAccessGlobalCTB is true and commerce addon is false', () => { + // Buy now button is displayed when capabilities are false. + cy.log( 'Update capabilities transient: CTBTrueYithFalse' ); + cy.exec( + `npx wp-env run cli wp option update _transient_nfd_site_capabilities '${ CTBTrueYithFalse }' --format=json`, + { timeout: customCommandTimeout } + ); + cy.reload(); + cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); + + cy.get( `.${ appId }-app-subnavitem-Sales` ) + .as( 'salesTab' ) + .should( 'exist' ); + cy.get( '@salesTab' ).click(); + cy.get( '#buynow-wondercart', { timeout: mediumWait } ).as( + 'buyButton' + ); + cy.get( '@buyButton' ).scrollIntoView().should( 'be.visible' ); + // Verify Buy now button has correct link + cy.get( '@buyButton' ) + .should( 'have.attr', 'href' ) + .and( + 'include', + 'https://my.bluehost.com/hosting/app?utm_source=wp-marketplace&utm_medium=brand-plugin&utm_campaign=wordpress-ad&utm_content=buynow#/marketplace/product' + ); + } ); + it( 'Verify Sales and Discounts sub tab content and functionality', () => { // Install button is displayed when capabilities are true cy.log( 'Update capabilities transient: CTBAndYithTrue' ); @@ -56,8 +81,8 @@ describe( `npx wp-env run cli wp option update _transient_nfd_site_capabilities '${ CTBAndYithTrue }' --format=json`, { timeout: customCommandTimeout } ); - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); cy.reload(); + cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); // Verify Install Now exists when customer has ecommerce addon cy.get( `.${ appId }-app-subnavitem-Sales`, { @@ -81,32 +106,5 @@ describe( 'exist' ); } ); - - it( 'Verify Buy Now is shown when canAccessGlobalCTB is true and commerce addon is false', () => { - // Buy now button is displayed when capabilities are false. - cy.log( 'Update capabilities transient: CTBTrueYithFalse' ); - cy.exec( - `npx wp-env run cli wp option update _transient_nfd_site_capabilities '${ CTBTrueYithFalse }' --format=json`, - { timeout: customCommandTimeout } - ); - cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); - cy.reload(); - - cy.get( `.${ appId }-app-subnavitem-Sales` ) - .as( 'salesTab' ) - .should( 'exist' ); - cy.get( '@salesTab' ).click(); - cy.get( '#buynow-wondercart', { timeout: mediumWait } ).as( - 'buyButton' - ); - cy.get( '@buyButton' ).scrollIntoView().should( 'be.visible' ); - // Verify Buy now button has correct link - cy.get( '@buyButton' ) - .should( 'have.attr', 'href' ) - .and( - 'include', - 'https://my.bluehost.com/hosting/app?utm_source=wp-marketplace&utm_medium=brand-plugin&utm_campaign=wordpress-ad&utm_content=buynow#/marketplace/product' - ); - } ); } ); diff --git a/tests/cypress/integration/Store/storePage.cy.js b/tests/cypress/integration/Store/storePage.cy.js index 1092d60d..b07c0df2 100644 --- a/tests/cypress/integration/Store/storePage.cy.js +++ b/tests/cypress/integration/Store/storePage.cy.js @@ -1,5 +1,5 @@ import { GetPluginId, getAppId } from '../wp-module-support/pluginID.cy'; -import { uninstallPlugins } from '../wp-module-support/utils.cy'; +import { wpLogin, uninstallPlugins } from '../wp-module-support/utils.cy'; const pluginId = GetPluginId(); const appId = getAppId(); @@ -10,10 +10,7 @@ describe( { testIsolation: true }, () => { before( () => { - cy.login( - Cypress.env( 'wpUsername' ), - Cypress.env( 'wpPassword' ) - ); + wpLogin(); uninstallPlugins(); cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); } ); diff --git a/tests/cypress/integration/wp-module-support/utils.cy.js b/tests/cypress/integration/wp-module-support/utils.cy.js index 029b7099..aca2ed9e 100644 --- a/tests/cypress/integration/wp-module-support/utils.cy.js +++ b/tests/cypress/integration/wp-module-support/utils.cy.js @@ -84,4 +84,8 @@ export const deleteCapabilitiesTransient = () => { `npx wp-env run cli wp transient delete nfd_site_capabilities`, { failOnNonZeroExit: false } ); +}; + +export const wpLogin = () => { + cy.login( Cypress.env( 'wpUsername' ), Cypress.env( 'wpPassword' ) ); }; \ No newline at end of file From a16b78c0e6af5015617e28833f4354c2efabaf3a Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 18 Jun 2024 18:27:05 -0400 Subject: [PATCH 23/37] allow wondercart init longer to init --- .../integration/Site-Capabilities/siteCapabilities.cy.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js index 1ff41835..d4627fcd 100644 --- a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js +++ b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js @@ -102,7 +102,9 @@ describe( cy.get( '.nfd-notification--success', { timeout: customCommandTimeout, } ).should( 'exist' ); - cy.get( '#wonder-cart-init', { timeout: mediumWait } ).should( + + // Verify wonder cart content displays + cy.get( '#wonder-cart-init', { timeout: customCommandTimeout } ).should( 'exist' ); } ); From 442a93b3892d2e3d9683c0507151132d56ca191f Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 18 Jun 2024 18:40:03 -0400 Subject: [PATCH 24/37] try a reload for wondercart test --- .../integration/Site-Capabilities/siteCapabilities.cy.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js index d4627fcd..e95cf489 100644 --- a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js +++ b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js @@ -102,11 +102,11 @@ describe( cy.get( '.nfd-notification--success', { timeout: customCommandTimeout, } ).should( 'exist' ); - + cy.reload(); // Verify wonder cart content displays - cy.get( '#wonder-cart-init', { timeout: customCommandTimeout } ).should( - 'exist' - ); + cy.get( '#wonder-cart-init', { + timeout: customCommandTimeout, + } ).should( 'exist' ); } ); } ); From c50368c95145d2228451d5941b6028b274ed6c23 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 18 Jun 2024 18:59:10 -0400 Subject: [PATCH 25/37] always use wpLogin utility method and remove index before login as is now redundant --- tests/cypress/integration/Home/ecommerce-next-steps.cy.js | 2 ++ tests/cypress/support/index.js | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/cypress/integration/Home/ecommerce-next-steps.cy.js b/tests/cypress/integration/Home/ecommerce-next-steps.cy.js index 68b17edb..8293cb16 100644 --- a/tests/cypress/integration/Home/ecommerce-next-steps.cy.js +++ b/tests/cypress/integration/Home/ecommerce-next-steps.cy.js @@ -1,5 +1,6 @@ import { GetPluginId } from '../wp-module-support/pluginID.cy'; import { + wpLogin, comingSoon, viewCompletedTasks, viewRemainingTasks, @@ -30,6 +31,7 @@ describe( 'e-commerce Home Page- Next Steps', () => { ]; before( () => { + wpLogin(); cy.exec( `npx wp-env run cli wp plugin deactivate woocommerce`, { failOnNonZeroExit: false, } ); diff --git a/tests/cypress/support/index.js b/tests/cypress/support/index.js index 6450b047..bd36195e 100644 --- a/tests/cypress/support/index.js +++ b/tests/cypress/support/index.js @@ -24,7 +24,3 @@ Cypress.on( 'uncaught:exception', ( err ) => { return false; } } ); - -before( () => { - cy.login( Cypress.env( 'wpUsername' ), Cypress.env( 'wpPassword' ) ); -} ); From 0bd0377d8566454e9a0b5097b74c06afb9bc9a8d Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 18 Jun 2024 19:00:07 -0400 Subject: [PATCH 26/37] validate wonder-cart is installed for some reason the runner stalls out on the install and the site is stuck, verify the plugin is installed via cli command instead --- .../Site-Capabilities/siteCapabilities.cy.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js index e95cf489..85976a4f 100644 --- a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js +++ b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js @@ -103,10 +103,17 @@ describe( timeout: customCommandTimeout, } ).should( 'exist' ); cy.reload(); + // display installed plugins for debugging + cy.exec( `npx wp-env run cli wp plugin list`, { + failOnNonZeroExit: false, + } ).then( ( result ) => { + cy.log( result.stdout ); + expect( result.stdout ).to.contains('wonder-cart'); + } ); // Verify wonder cart content displays - cy.get( '#wonder-cart-init', { - timeout: customCommandTimeout, - } ).should( 'exist' ); + // cy.get( '#wonder-cart-init', { + // timeout: customCommandTimeout, + // } ).should( 'exist' ); } ); } ); From 907230c4538b1c9d9fb970a5ea44e84522b9a164 Mon Sep 17 00:00:00 2001 From: Ramya krishna Date: Fri, 21 Jun 2024 16:15:52 +0530 Subject: [PATCH 27/37] fixes --- src/components/SiteStatus.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/SiteStatus.js b/src/components/SiteStatus.js index debd6fbd..1b2747bf 100644 --- a/src/components/SiteStatus.js +++ b/src/components/SiteStatus.js @@ -44,6 +44,11 @@ export function SiteStatus({ comingSoon, toggleComingSoon, notify }) { $statusText.style.setProperty("color", "var(--nfd-ecommerce-text-dark-success)"); } }); + + if (!comingSoon) { + return null; + } + return (
Date: Mon, 24 Jun 2024 15:05:17 +0530 Subject: [PATCH 28/37] cypress update --- src/components/SiteStatus.js | 1 + tests/cypress/integration/Home/commerceHomePage.cy.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/components/SiteStatus.js b/src/components/SiteStatus.js index 1b2747bf..af770ec8 100644 --- a/src/components/SiteStatus.js +++ b/src/components/SiteStatus.js @@ -51,6 +51,7 @@ export function SiteStatus({ comingSoon, toggleComingSoon, notify }) { return (
{ cy.url().should( 'eq', Cypress.config().baseUrl + '/' ); cy.go( 'back' ); cy.get( '.nfd-flex-none > .nfd-button--upsell' ).click(); + cy.get('[data-testid="siteStatus"]').should('not.be.visible'); cy.get( '.nfd-notification--success' ).should( 'exist' ); } ); } ); From f6b8b735c6daf377688cde1ac770bdbed6ed6291 Mon Sep 17 00:00:00 2001 From: Ramya krishna Date: Mon, 24 Jun 2024 15:55:04 +0530 Subject: [PATCH 29/37] not.exist --- tests/cypress/integration/Home/commerceHomePage.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cypress/integration/Home/commerceHomePage.cy.js b/tests/cypress/integration/Home/commerceHomePage.cy.js index 2f27946b..47ea9623 100644 --- a/tests/cypress/integration/Home/commerceHomePage.cy.js +++ b/tests/cypress/integration/Home/commerceHomePage.cy.js @@ -85,7 +85,7 @@ describe( 'Commerce Home Page- Coming soon mode', () => { cy.url().should( 'eq', Cypress.config().baseUrl + '/' ); cy.go( 'back' ); cy.get( '.nfd-flex-none > .nfd-button--upsell' ).click(); - cy.get('[data-testid="siteStatus"]').should('not.be.visible'); + cy.get('[data-testid="siteStatus"]').should('not.exist'); cy.get( '.nfd-notification--success' ).should( 'exist' ); } ); } ); From 242c2cd87cd7b92850393f95956c241c61377ebf Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 25 Jun 2024 11:07:13 -0400 Subject: [PATCH 30/37] lint fixes --- .../integration/wp-module-support/utils.cy.js | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/tests/cypress/integration/wp-module-support/utils.cy.js b/tests/cypress/integration/wp-module-support/utils.cy.js index aca2ed9e..64bad108 100644 --- a/tests/cypress/integration/wp-module-support/utils.cy.js +++ b/tests/cypress/integration/wp-module-support/utils.cy.js @@ -5,7 +5,9 @@ const customCommandTimeout = 30000; const longWait = 120000; export const comingSoon = ( shouldBeComingSoon ) => { - cy.visit( '/wp-admin/admin.php?page=' + Cypress.env('pluginId') + '#/settings' ); + cy.visit( + '/wp-admin/admin.php?page=' + Cypress.env( 'pluginId' ) + '#/settings' + ); cy.get( '[data-id="coming-soon-toggle"]', { timeout: customCommandTimeout, } ).as( 'comingSoonToggle' ); @@ -39,13 +41,10 @@ export const comingSoon = ( shouldBeComingSoon ) => { export const installWoo = () => { cy.log( 'Installing WooCommerce' ); - cy.exec( - `npx wp-env run cli wp plugin install woocommerce --activate`, - { - timeout: longWait, - log: true, - } - ); + cy.exec( `npx wp-env run cli wp plugin install woocommerce --activate`, { + timeout: longWait, + log: true, + } ); }; export const uninstallPlugins = () => { @@ -80,12 +79,11 @@ export const waitForNextSteps = () => { export const deleteCapabilitiesTransient = () => { cy.log( 'Deleting capabilities transient' ); - cy.exec( - `npx wp-env run cli wp transient delete nfd_site_capabilities`, - { failOnNonZeroExit: false } - ); + cy.exec( `npx wp-env run cli wp transient delete nfd_site_capabilities`, { + failOnNonZeroExit: false, + } ); }; export const wpLogin = () => { cy.login( Cypress.env( 'wpUsername' ), Cypress.env( 'wpPassword' ) ); -}; \ No newline at end of file +}; From c0a0df31f65be480eb6a76df3b7a519a02e8d74a Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 25 Jun 2024 11:09:13 -0400 Subject: [PATCH 31/37] change arrow to function() to make use of `this` --- .../integration/Site-Capabilities/siteCapabilities.cy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js index 85976a4f..7c25491d 100644 --- a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js +++ b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js @@ -41,7 +41,7 @@ describe( cy.visit( '/wp-admin/admin.php?page=' + pluginId ); } ); - before( () => { + before( function () { if ( pluginId !== 'bluehost' ) { this.skip(); } @@ -108,7 +108,7 @@ describe( failOnNonZeroExit: false, } ).then( ( result ) => { cy.log( result.stdout ); - expect( result.stdout ).to.contains('wonder-cart'); + expect( result.stdout ).to.contains( 'wonder-cart' ); } ); // Verify wonder cart content displays // cy.get( '#wonder-cart-init', { From 9d9a8aa8cd514d1c7315daf4e257ac4354f901b1 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 25 Jun 2024 11:15:04 -0400 Subject: [PATCH 32/37] reintroduce wonder cart init now that features issue is resolved and app renders properly --- .../integration/Site-Capabilities/siteCapabilities.cy.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js index 7c25491d..0b80e3b9 100644 --- a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js +++ b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js @@ -111,9 +111,9 @@ describe( expect( result.stdout ).to.contains( 'wonder-cart' ); } ); // Verify wonder cart content displays - // cy.get( '#wonder-cart-init', { - // timeout: customCommandTimeout, - // } ).should( 'exist' ); + cy.get( '#wonder-cart-init', { + timeout: customCommandTimeout, + } ).should( 'exist' ); } ); } ); From ea1679ff2c00192e687c6b3a2d333b2009bffeff Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 25 Jun 2024 11:16:20 -0400 Subject: [PATCH 33/37] place before ahead of beforeEach for better visibility --- .../Site-Capabilities/siteCapabilities.cy.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js index 0b80e3b9..a29e4010 100644 --- a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js +++ b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js @@ -34,6 +34,12 @@ describe( isJarvis: true, } ); + before( function () { + if ( pluginId !== 'bluehost' ) { + this.skip(); + } + } ); + beforeEach( () => { wpLogin(); uninstallPlugins(); @@ -41,12 +47,6 @@ describe( cy.visit( '/wp-admin/admin.php?page=' + pluginId ); } ); - before( function () { - if ( pluginId !== 'bluehost' ) { - this.skip(); - } - } ); - it( 'Verify Buy Now is shown when canAccessGlobalCTB is true and commerce addon is false', () => { // Buy now button is displayed when capabilities are false. cy.log( 'Update capabilities transient: CTBTrueYithFalse' ); From 41e2cb4f6e9148cc42398e08b6bdf1b853612468 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Tue, 25 Jun 2024 11:26:35 -0400 Subject: [PATCH 34/37] run full plugin tests in workflow after module tests to ensure nothing breaks --- .github/workflows/brand-plugin-test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/brand-plugin-test.yml b/.github/workflows/brand-plugin-test.yml index 88ad7d60..fcb489da 100644 --- a/.github/workflows/brand-plugin-test.yml +++ b/.github/workflows/brand-plugin-test.yml @@ -29,7 +29,6 @@ jobs: needs: setup uses: newfold-labs/workflows/.github/workflows/module-plugin-test.yml@main with: - only-module-tests: true module-repo: ${{ github.repository }} module-branch: ${{ needs.setup.outputs.branch }} plugin-repo: 'bluehost/bluehost-wordpress-plugin' @@ -41,7 +40,6 @@ jobs: needs: setup uses: newfold-labs/workflows/.github/workflows/module-plugin-test.yml@main with: - only-module-tests: true module-repo: ${{ github.repository }} module-branch: ${{ needs.setup.outputs.branch }} plugin-repo: 'newfold-labs/wp-plugin-hostgator' @@ -53,7 +51,6 @@ jobs: needs: setup uses: newfold-labs/workflows/.github/workflows/module-plugin-test.yml@main with: - only-module-tests: true module-repo: ${{ github.repository }} module-branch: ${{ needs.setup.outputs.branch }} plugin-repo: 'newfold-labs/wp-plugin-crazy-domains' From 3599ee73f1f1e2747d711201d68480067895f555 Mon Sep 17 00:00:00 2001 From: Ramya krishna Date: Wed, 26 Jun 2024 14:55:46 +0530 Subject: [PATCH 35/37] test cases added --- .../cypress/integration/Store/storePage.cy.js | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/cypress/integration/Store/storePage.cy.js b/tests/cypress/integration/Store/storePage.cy.js index be1c35b0..d0162c7d 100644 --- a/tests/cypress/integration/Store/storePage.cy.js +++ b/tests/cypress/integration/Store/storePage.cy.js @@ -7,6 +7,15 @@ const customCommandTimeout = 30000; const longWait = 60000; describe( 'Store Page- WooCommerce is deactivated/uninstalled', () => { + const cTBAndYithTrue = JSON.stringify( { + canAccessAI: true, + canAccessHelpCenter: true, + canAccessGlobalCTB: true, + hasEcomdash: false, + hasYithExtended: true, + isEcommerce: true, + isJarvis: true, + } ); before( () => { cy.exec( `npx wp-env run cli wp plugin deactivate woocommerce`, { failOnNonZeroExit: false, @@ -60,4 +69,21 @@ describe( 'Store Page- WooCommerce is deactivated/uninstalled', () => { } ).should( 'exist' ); } ); } ); + + it( 'Verify Visit your site and Launch your site functionality', () => { + cy.exec( + `npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBAndYithTrue }' --format=json`, + { timeout: customCommandTimeout } + ); + cy.get( '.nfd-flex-none > .nfd-button--secondary', { + timeout: customCommandTimeout, + } ) + .invoke( 'removeAttr', 'target' ) + .click(); + cy.url().should( 'eq', Cypress.config().baseUrl + '/' ); + cy.go( 'back' ); + cy.get( '.nfd-flex-none > .nfd-button--upsell' ).click(); + cy.get('[data-testid="siteStatus"]').should('not.exist'); + cy.get( '.nfd-notification--success' ).should( 'exist' ); + } ); } ); From b2e2427585c0cc6570bbd9c30029408723bf1f78 Mon Sep 17 00:00:00 2001 From: Ramya krishna Date: Wed, 26 Jun 2024 14:57:50 +0530 Subject: [PATCH 36/37] changes --- .../cypress/integration/Store/storePage.cy.js | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/tests/cypress/integration/Store/storePage.cy.js b/tests/cypress/integration/Store/storePage.cy.js index d0162c7d..be1c35b0 100644 --- a/tests/cypress/integration/Store/storePage.cy.js +++ b/tests/cypress/integration/Store/storePage.cy.js @@ -7,15 +7,6 @@ const customCommandTimeout = 30000; const longWait = 60000; describe( 'Store Page- WooCommerce is deactivated/uninstalled', () => { - const cTBAndYithTrue = JSON.stringify( { - canAccessAI: true, - canAccessHelpCenter: true, - canAccessGlobalCTB: true, - hasEcomdash: false, - hasYithExtended: true, - isEcommerce: true, - isJarvis: true, - } ); before( () => { cy.exec( `npx wp-env run cli wp plugin deactivate woocommerce`, { failOnNonZeroExit: false, @@ -69,21 +60,4 @@ describe( 'Store Page- WooCommerce is deactivated/uninstalled', () => { } ).should( 'exist' ); } ); } ); - - it( 'Verify Visit your site and Launch your site functionality', () => { - cy.exec( - `npx wp-env run cli wp option set _transient_nfd_site_capabilities '${ cTBAndYithTrue }' --format=json`, - { timeout: customCommandTimeout } - ); - cy.get( '.nfd-flex-none > .nfd-button--secondary', { - timeout: customCommandTimeout, - } ) - .invoke( 'removeAttr', 'target' ) - .click(); - cy.url().should( 'eq', Cypress.config().baseUrl + '/' ); - cy.go( 'back' ); - cy.get( '.nfd-flex-none > .nfd-button--upsell' ).click(); - cy.get('[data-testid="siteStatus"]').should('not.exist'); - cy.get( '.nfd-notification--success' ).should( 'exist' ); - } ); } ); From 34e411dad024a2f091a3ba1f89570c98b549444c Mon Sep 17 00:00:00 2001 From: aratidgr8 Date: Wed, 26 Jun 2024 16:22:36 +0530 Subject: [PATCH 37/37] Version bump to 1.3.34 for Ecommerce Module --- bootstrap.php | 2 +- composer.lock | 153 +++++++++++++++++++++++++++------------------- package-lock.json | 4 +- package.json | 2 +- 4 files changed, 93 insertions(+), 68 deletions(-) diff --git a/bootstrap.php b/bootstrap.php index 6e168e73..b9b39e69 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -5,7 +5,7 @@ use function NewfoldLabs\WP\ModuleLoader\register; -define( 'NFD_ECOMMERCE_MODULE_VERSION', '1.3.33' ); +define( 'NFD_ECOMMERCE_MODULE_VERSION', '1.3.34' ); if ( function_exists( 'is_admin' ) && is_admin() ) { $old_woocommerce_module_version = get_option( 'nfd_ecommerce_module_version' ); diff --git a/composer.lock b/composer.lock index 97bef54d..768c67ea 100644 --- a/composer.lock +++ b/composer.lock @@ -237,16 +237,16 @@ }, { "name": "newfold-labs/wp-module-coming-soon", - "version": "1.2.4", + "version": "1.2.5", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-coming-soon.git", - "reference": "05112a5908bb08ca0aa3aa7d7e7c508d44401b28" + "reference": "36da71998930ffc6fcb13d2ea082b82507a284b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-coming-soon/zipball/05112a5908bb08ca0aa3aa7d7e7c508d44401b28", - "reference": "05112a5908bb08ca0aa3aa7d7e7c508d44401b28", + "url": "https://api.github.com/repos/newfold-labs/wp-module-coming-soon/zipball/36da71998930ffc6fcb13d2ea082b82507a284b2", + "reference": "36da71998930ffc6fcb13d2ea082b82507a284b2", "shasum": "" }, "require": { @@ -284,10 +284,10 @@ ], "description": "Coming Soon module for WordPress sites.", "support": { - "source": "https://github.com/newfold-labs/wp-module-coming-soon/tree/1.2.4", + "source": "https://github.com/newfold-labs/wp-module-coming-soon/tree/1.2.5", "issues": "https://github.com/newfold-labs/wp-module-coming-soon/issues" }, - "time": "2024-05-31T16:22:17+00:00" + "time": "2024-06-19T19:13:33+00:00" }, { "name": "newfold-labs/wp-module-context", @@ -345,16 +345,16 @@ }, { "name": "newfold-labs/wp-module-data", - "version": "2.5.2", + "version": "2.5.3", "source": { "type": "git", "url": "https://github.com/newfold-labs/wp-module-data.git", - "reference": "bd9642c155735fac8f114ea1eb237da4a72eb267" + "reference": "6c0941bc9ac3d18820f924de8c4afe58bb421782" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/newfold-labs/wp-module-data/zipball/bd9642c155735fac8f114ea1eb237da4a72eb267", - "reference": "bd9642c155735fac8f114ea1eb237da4a72eb267", + "url": "https://api.github.com/repos/newfold-labs/wp-module-data/zipball/6c0941bc9ac3d18820f924de8c4afe58bb421782", + "reference": "6c0941bc9ac3d18820f924de8c4afe58bb421782", "shasum": "" }, "require": { @@ -367,10 +367,20 @@ }, "require-dev": { "10up/wp_mock": "^0.4.2", + "bluehost/bluehost-wordpress-plugin": "*", + "brianhenryie/composer-phpstorm": "*", "johnpbloch/wordpress": "*", - "newfold-labs/wp-php-standards": "^1.2" + "kporras07/composer-symlinks": "^1.2", + "lucatume/wp-browser": "^3", + "newfold-labs/wp-php-standards": "^1.2", + "wpackagist-plugin/woocommerce": "*" }, "type": "library", + "extra": { + "symlinks": { + ".": "wp-content/plugins/bluehost-wordpress-plugin/vendor/newfold-labs/wp-module-data" + } + }, "autoload": { "psr-4": { "NewfoldLabs\\WP\\Module\\Data\\": "includes/" @@ -381,8 +391,14 @@ }, "autoload-dev": { "psr-4": { - "NewfoldLabs\\WP\\Module\\Data\\": "tests/phpunit/includes/" - } + "NewfoldLabs\\WP\\Module\\Data\\": [ + "tests/phpunit/includes/", + "tests/wpunit/includes" + ] + }, + "classmap": [ + "wordpress" + ] }, "scripts": { "fix": [ @@ -393,6 +409,15 @@ ], "lint": [ "vendor/bin/phpcs . --standard=phpcs.xml -s" + ], + "create-symlinks": [ + "Kporras07\\ComposerSymlinks\\ScriptHandler::createSymlinks" + ], + "post-install-cmd": [ + "@create-symlinks" + ], + "post-update-cmd": [ + "@create-symlinks" ] }, "license": [ @@ -400,10 +425,10 @@ ], "description": "Newfold Data Module", "support": { - "source": "https://github.com/newfold-labs/wp-module-data/tree/2.5.2", + "source": "https://github.com/newfold-labs/wp-module-data/tree/2.5.3", "issues": "https://github.com/newfold-labs/wp-module-data/issues" }, - "time": "2024-05-30T18:45:12+00:00" + "time": "2024-06-19T17:34:08+00:00" }, { "name": "newfold-labs/wp-module-install-checker", @@ -3210,16 +3235,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", "shasum": "" }, "require": { @@ -3269,7 +3294,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" }, "funding": [ { @@ -3285,20 +3310,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", "shasum": "" }, "require": { @@ -3347,7 +3372,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" }, "funding": [ { @@ -3363,20 +3388,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", "shasum": "" }, "require": { @@ -3428,7 +3453,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" }, "funding": [ { @@ -3444,20 +3469,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { @@ -3508,7 +3533,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, "funding": [ { @@ -3524,20 +3549,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2" + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/ec444d3f3f6505bb28d11afa41e75faadebc10a1", + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1", "shasum": "" }, "require": { @@ -3584,7 +3609,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0" }, "funding": [ { @@ -3600,20 +3625,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", "shasum": "" }, "require": { @@ -3664,7 +3689,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" }, "funding": [ { @@ -3680,20 +3705,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d" + "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/c565ad1e63f30e7477fc40738343c62b40bc672d", - "reference": "c565ad1e63f30e7477fc40738343c62b40bc672d", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/3fb075789fb91f9ad9af537c4012d523085bd5af", + "reference": "3fb075789fb91f9ad9af537c4012d523085bd5af", "shasum": "" }, "require": { @@ -3740,7 +3765,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.30.0" }, "funding": [ { @@ -3756,7 +3781,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { "name": "symfony/process", @@ -4832,16 +4857,16 @@ }, { "name": "wp-cli/extension-command", - "version": "v2.1.21", + "version": "v2.1.22", "source": { "type": "git", "url": "https://github.com/wp-cli/extension-command.git", - "reference": "f9bc3fd2f2dabcbe9b3bc3dc9591535dd714fd3c" + "reference": "7baa058ae33e78a8e19f6a189203ed08e03a21be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/extension-command/zipball/f9bc3fd2f2dabcbe9b3bc3dc9591535dd714fd3c", - "reference": "f9bc3fd2f2dabcbe9b3bc3dc9591535dd714fd3c", + "url": "https://api.github.com/repos/wp-cli/extension-command/zipball/7baa058ae33e78a8e19f6a189203ed08e03a21be", + "reference": "7baa058ae33e78a8e19f6a189203ed08e03a21be", "shasum": "" }, "require": { @@ -4924,9 +4949,9 @@ "homepage": "https://github.com/wp-cli/extension-command", "support": { "issues": "https://github.com/wp-cli/extension-command/issues", - "source": "https://github.com/wp-cli/extension-command/tree/v2.1.21" + "source": "https://github.com/wp-cli/extension-command/tree/v2.1.22" }, - "time": "2024-05-02T13:35:09+00:00" + "time": "2024-06-04T12:24:31+00:00" }, { "name": "wp-cli/i18n-command", @@ -6202,5 +6227,5 @@ "platform-overrides": { "php": "7.3.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/package-lock.json b/package-lock.json index 048d5a96..84a6779e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@newfold-labs/wp-module-ecommerce", - "version": "1.3.33", + "version": "1.3.34", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@newfold-labs/wp-module-ecommerce", - "version": "1.3.33", + "version": "1.3.34", "license": "GPL-2.0-or-later", "dependencies": { "@faizaanceg/pandora": "^1.1.1", diff --git a/package.json b/package.json index 99e590a4..5ab77296 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@newfold-labs/wp-module-ecommerce", "description": "Brand Agnostic eCommerce Experience", "license": "GPL-2.0-or-later", - "version": "1.3.33", + "version": "1.3.34", "main": "build/index.js", "files": [ "build/",