From 0323ba3b23ec5bf7bafef58d2913bdcb7c2d92c4 Mon Sep 17 00:00:00 2001 From: sangeetha-nayak Date: Wed, 21 Feb 2024 15:03:27 +0530 Subject: [PATCH 1/5] Fix WooCommerce install issue --- .../integration/wp-module-support/utils.cy.js | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/tests/cypress/integration/wp-module-support/utils.cy.js b/tests/cypress/integration/wp-module-support/utils.cy.js index 2d5acad6..65bbfe71 100644 --- a/tests/cypress/integration/wp-module-support/utils.cy.js +++ b/tests/cypress/integration/wp-module-support/utils.cy.js @@ -40,15 +40,19 @@ export const comingSoon = ( shouldBeComingSoon ) => { }; export const installWoo = () => { - cy.get( - '.nfd-app-section-content .nfd-bg-canvas .nfd-button.nfd-button--upsell' - ) - .eq( 0 ) - .click(); - cy.get( '.nfd-notifications--bottom-left .nfd-notification--success', { - timeout: longWait, - } ).should( 'exist' ); - cy.get( '.nfd-w-0 p' ).should( 'exist' ); + cy.exec( `npx wp-env run cli wp plugin install woocommerce`, { + timeout: longWait + } ); + // cy.get( + // '.nfd-app-section-content .nfd-bg-canvas .nfd-button.nfd-button--upsell' + // ) + // .eq( 0 ) + // .click(); + // cy.get( '.nfd-notifications--bottom-left .nfd-notification--success', { + // timeout: longWait, + // } ).should( 'exist' ); + // cy.get( '.nfd-w-0 p' ).should( 'exist' ); + }; export const viewCompletedTasks = () => { From 6083a014bafa3ab15657f9e6ba58b68a729554b6 Mon Sep 17 00:00:00 2001 From: sangeetha-nayak Date: Wed, 21 Feb 2024 15:42:29 +0530 Subject: [PATCH 2/5] Removed commented lines --- .../cypress/integration/wp-module-support/utils.cy.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tests/cypress/integration/wp-module-support/utils.cy.js b/tests/cypress/integration/wp-module-support/utils.cy.js index 65bbfe71..a075e717 100644 --- a/tests/cypress/integration/wp-module-support/utils.cy.js +++ b/tests/cypress/integration/wp-module-support/utils.cy.js @@ -43,16 +43,6 @@ export const installWoo = () => { cy.exec( `npx wp-env run cli wp plugin install woocommerce`, { timeout: longWait } ); - // cy.get( - // '.nfd-app-section-content .nfd-bg-canvas .nfd-button.nfd-button--upsell' - // ) - // .eq( 0 ) - // .click(); - // cy.get( '.nfd-notifications--bottom-left .nfd-notification--success', { - // timeout: longWait, - // } ).should( 'exist' ); - // cy.get( '.nfd-w-0 p' ).should( 'exist' ); - }; export const viewCompletedTasks = () => { From d7abbe3d7e27642b3018de773fadb5e9643d7beb Mon Sep 17 00:00:00 2001 From: sangeetha-nayak Date: Thu, 22 Feb 2024 14:07:39 +0530 Subject: [PATCH 3/5] install and activate via wp-cli --- tests/cypress/integration/wp-module-support/utils.cy.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/cypress/integration/wp-module-support/utils.cy.js b/tests/cypress/integration/wp-module-support/utils.cy.js index a075e717..3c303e60 100644 --- a/tests/cypress/integration/wp-module-support/utils.cy.js +++ b/tests/cypress/integration/wp-module-support/utils.cy.js @@ -43,6 +43,10 @@ export const installWoo = () => { cy.exec( `npx wp-env run cli wp plugin install woocommerce`, { timeout: longWait } ); + + cy.exec( `npx wp-env run cli wp plugin activate woocommerce`, { + timeout: longWait + } ); }; export const viewCompletedTasks = () => { From 3f9db54cd8a50bda37af2cedef969276e235d2a1 Mon Sep 17 00:00:00 2001 From: sangeetha-nayak Date: Thu, 22 Feb 2024 15:48:56 +0530 Subject: [PATCH 4/5] increase timeout --- .../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 18cb007b..0e52fdde 100644 --- a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js +++ b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js @@ -73,7 +73,7 @@ describe( 'Verify Wondercart accessibility as per site capabilities', () => { ); cy.reload(); cy.get( `.${ appId }-app-navitem-Store`, { - timeout: mediumWait, + timeout: customCommandTimeout, } ).click(); cy.get( `.${ appId }-app-subnavitem-Sales` ) .as( 'salesTab' ) @@ -86,7 +86,7 @@ describe( 'Verify Wondercart accessibility as per site capabilities', () => { it( 'Verify clicking on Buy Now leads to cpanel login page', () => { cy.get( `.${ appId }-app-navitem-Store`, { - timeout: mediumWait, + timeout: customCommandTimeout, } ).click(); cy.get( `.${ appId }-app-subnavitem-Sales` ).click(); cy.get( '.nfd-button--upsell', { timeout: mediumWait } ) @@ -113,7 +113,7 @@ describe( 'Verify Wondercart accessibility as per site capabilities', () => { ); cy.reload(); cy.get( `.${ appId }-app-navitem-Store`, { - timeout: mediumWait, + timeout: customCommandTimeout, } ).click(); cy.get( `.${ appId }-app-subnavitem-Sales`, { timeout: mediumWait } ) .as( 'salesTab' ) @@ -126,7 +126,7 @@ describe( 'Verify Wondercart accessibility as per site capabilities', () => { it( 'Verify clicking Install Now successfully installs Wonder Cart plugin', () => { cy.get( `.${ appId }-app-navitem-Store`, { - timeout: mediumWait, + timeout: customCommandTimeout, } ).click(); cy.get( `.${ appId }-app-subnavitem-Sales` ).click(); cy.get( '.nfd-button--upsell', { timeout: mediumWait } ) From 6a47f56fabde60b31685a77edd1ee39428da655d Mon Sep 17 00:00:00 2001 From: sangeetha-nayak Date: Thu, 22 Feb 2024 16:22:03 +0530 Subject: [PATCH 5/5] final change --- .../integration/Site-Capabilities/siteCapabilities.cy.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js index 0e52fdde..6b421bc2 100644 --- a/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js +++ b/tests/cypress/integration/Site-Capabilities/siteCapabilities.cy.js @@ -84,7 +84,11 @@ describe( 'Verify Wondercart accessibility as per site capabilities', () => { ); } ); - it( 'Verify clicking on Buy Now leads to cpanel login page', () => { + 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();