From dd5ce31aedfbbe6073db70b5084e1309d81f4e11 Mon Sep 17 00:00:00 2001 From: sangeetha-nayak Date: Wed, 3 Jul 2024 17:14:18 +0530 Subject: [PATCH 1/5] Update utm_medium param value and skip razorpay test for CD --- tests/cypress/integration/Home/ecommerce-next-steps.cy.js | 2 +- tests/cypress/integration/Home/homePageWithWoo.cy.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/cypress/integration/Home/ecommerce-next-steps.cy.js b/tests/cypress/integration/Home/ecommerce-next-steps.cy.js index 8293cb16..4df84b56 100644 --- a/tests/cypress/integration/Home/ecommerce-next-steps.cy.js +++ b/tests/cypress/integration/Home/ecommerce-next-steps.cy.js @@ -158,7 +158,7 @@ describe( 'e-commerce Home Page- Next Steps', () => { if ( pluginId == 'crazy-domains' ) { cy.url().should( 'equal', - `https://my.yoast.com/signup?redirect_to=https://academy.yoast.com/courses/?utm_medium=crazydomains_plugin&utm_source=wp-home` + 'https://my.yoast.com/signup?redirect_to=https://academy.yoast.com/courses/?utm_medium=crazy_plugin&utm_source=wp-home' ); } else { cy.url().should( diff --git a/tests/cypress/integration/Home/homePageWithWoo.cy.js b/tests/cypress/integration/Home/homePageWithWoo.cy.js index b8058554..c02b424a 100644 --- a/tests/cypress/integration/Home/homePageWithWoo.cy.js +++ b/tests/cypress/integration/Home/homePageWithWoo.cy.js @@ -86,7 +86,10 @@ describe( viewRemainingTasks(); } ); - it( 'Verify next step "Connect a payment processor"', () => { + it( 'Verify next step "Connect a payment processor"', function () { + if (pluginId == 'crazy-domains') { + this.skip(); + } cy.reload(); waitForNextSteps(); cy.get( '#connect-a-payment-processor a', { From 12264e339a45bc1578a9c1e820136244d9d4e42a Mon Sep 17 00:00:00 2001 From: sangeetha-nayak Date: Thu, 4 Jul 2024 14:58:37 +0530 Subject: [PATCH 2/5] fix tests failing in cypress matrix. address review comments --- .../integration/Home/ecommerce-coming-soon.cy.js | 4 +--- tests/cypress/integration/Home/ecommerce-live.cy.js | 2 +- .../integration/Home/ecommerce-next-steps.cy.js | 12 ++---------- tests/cypress/integration/Home/homePageWithWoo.cy.js | 8 ++++++-- tests/cypress/integration/Home/migration.cy.js | 4 ++-- tests/cypress/integration/Store/storePage.cy.js | 2 +- 6 files changed, 13 insertions(+), 19 deletions(-) diff --git a/tests/cypress/integration/Home/ecommerce-coming-soon.cy.js b/tests/cypress/integration/Home/ecommerce-coming-soon.cy.js index cc77c91a..7bdfeed8 100644 --- a/tests/cypress/integration/Home/ecommerce-coming-soon.cy.js +++ b/tests/cypress/integration/Home/ecommerce-coming-soon.cy.js @@ -4,11 +4,9 @@ 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', @@ -16,7 +14,7 @@ describe( () => { beforeEach( () => { wpLogin(); - uninstallPlugins(); + // 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 9ff3d278..4888a663 100644 --- a/tests/cypress/integration/Home/ecommerce-live.cy.js +++ b/tests/cypress/integration/Home/ecommerce-live.cy.js @@ -11,7 +11,7 @@ const pluginId = GetPluginId(); describe( 'e-commerce Home Page- Live Mode', { testIsolation: true }, () => { beforeEach( () => { wpLogin(); - uninstallPlugins(); + // uninstallPlugins(); comingSoon( false ); cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); } ); diff --git a/tests/cypress/integration/Home/ecommerce-next-steps.cy.js b/tests/cypress/integration/Home/ecommerce-next-steps.cy.js index 4df84b56..8992bf51 100644 --- a/tests/cypress/integration/Home/ecommerce-next-steps.cy.js +++ b/tests/cypress/integration/Home/ecommerce-next-steps.cy.js @@ -155,17 +155,9 @@ describe( 'e-commerce Home Page- Next Steps', () => { .scrollIntoView() .invoke( 'removeAttr', 'target' ) .click(); - if ( pluginId == 'crazy-domains' ) { - cy.url().should( - 'equal', - 'https://my.yoast.com/signup?redirect_to=https://academy.yoast.com/courses/?utm_medium=crazy_plugin&utm_source=wp-home' - ); - } else { - cy.url().should( - 'equal', - `https://my.yoast.com/signup?redirect_to=https://academy.yoast.com/courses/?utm_medium=${ pluginId }_plugin&utm_source=wp-home` + cy.url().contains( + 'https://my.yoast.com/signup?redirect_to=https://academy.yoast.com/courses/' ); - } cy.go( 'back' ); EventsAPI( APIList.yoast_seo_academy, pluginId ); diff --git a/tests/cypress/integration/Home/homePageWithWoo.cy.js b/tests/cypress/integration/Home/homePageWithWoo.cy.js index c02b424a..dbd69e12 100644 --- a/tests/cypress/integration/Home/homePageWithWoo.cy.js +++ b/tests/cypress/integration/Home/homePageWithWoo.cy.js @@ -16,10 +16,12 @@ describe( 'e-commerce Home Page - When WooCommerce is installed', { testIsolation: true }, () => { + before(() => { + installWoo(); + }); + beforeEach( () => { wpLogin(); - uninstallPlugins(); - installWoo(); cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); } ); @@ -28,6 +30,7 @@ describe( } ); it( 'Verify next steps "Add your store info"', () => { + cy.reload(); waitForNextSteps(); cy.get( '#add-your-store-info a', { timeout: customCommandTimeout, @@ -87,6 +90,7 @@ describe( } ); it( 'Verify next step "Connect a payment processor"', function () { + // Razorpay is not enabled for crazy-domains, hense skipping if (pluginId == 'crazy-domains') { this.skip(); } diff --git a/tests/cypress/integration/Home/migration.cy.js b/tests/cypress/integration/Home/migration.cy.js index 0815877f..927f2318 100644 --- a/tests/cypress/integration/Home/migration.cy.js +++ b/tests/cypress/integration/Home/migration.cy.js @@ -42,7 +42,7 @@ describe( .should( 'exist' ) .click(); EventsAPI( APIList.update_nameserver, pluginId ); - cy.get( '.nfd-help-center', { + cy.get( '.help-container', { timeout: customCommandTimeout, } ).should( 'be.visible' ); cy.get( '.close-button' ).click(); @@ -57,7 +57,7 @@ describe( .should( 'exist' ) .click(); EventsAPI( APIList.connect_domain, pluginId ); - cy.get( '.nfd-help-center', { + cy.get( '.help-container', { timeout: customCommandTimeout, } ).should( 'be.visible' ); cy.get( '.close-button' ).click(); diff --git a/tests/cypress/integration/Store/storePage.cy.js b/tests/cypress/integration/Store/storePage.cy.js index b07c0df2..08f4dc52 100644 --- a/tests/cypress/integration/Store/storePage.cy.js +++ b/tests/cypress/integration/Store/storePage.cy.js @@ -11,7 +11,7 @@ describe( () => { before( () => { wpLogin(); - uninstallPlugins(); + // uninstallPlugins(); cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); } ); From d25d8f2142ece035fed89ed8210fbfc441ce659d Mon Sep 17 00:00:00 2001 From: sangeetha-nayak Date: Thu, 4 Jul 2024 15:37:04 +0530 Subject: [PATCH 3/5] code clean up and corrected 'contain' assertion --- tests/cypress/integration/Home/ecommerce-coming-soon.cy.js | 1 - tests/cypress/integration/Home/ecommerce-live.cy.js | 2 -- tests/cypress/integration/Home/ecommerce-next-steps.cy.js | 5 +++-- tests/cypress/integration/Store/storePage.cy.js | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/cypress/integration/Home/ecommerce-coming-soon.cy.js b/tests/cypress/integration/Home/ecommerce-coming-soon.cy.js index 7bdfeed8..ea2f2b96 100644 --- a/tests/cypress/integration/Home/ecommerce-coming-soon.cy.js +++ b/tests/cypress/integration/Home/ecommerce-coming-soon.cy.js @@ -14,7 +14,6 @@ describe( () => { beforeEach( () => { 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 4888a663..b5b75424 100644 --- a/tests/cypress/integration/Home/ecommerce-live.cy.js +++ b/tests/cypress/integration/Home/ecommerce-live.cy.js @@ -2,7 +2,6 @@ import { GetPluginId } from '../wp-module-support/pluginID.cy'; import { wpLogin, comingSoon, - uninstallPlugins, } from '../wp-module-support/utils.cy'; const customCommandTimeout = 20000; @@ -11,7 +10,6 @@ const pluginId = GetPluginId(); describe( 'e-commerce Home Page- Live Mode', { testIsolation: true }, () => { beforeEach( () => { wpLogin(); - // uninstallPlugins(); comingSoon( false ); cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/home' ); } ); diff --git a/tests/cypress/integration/Home/ecommerce-next-steps.cy.js b/tests/cypress/integration/Home/ecommerce-next-steps.cy.js index 8992bf51..9cd88d7f 100644 --- a/tests/cypress/integration/Home/ecommerce-next-steps.cy.js +++ b/tests/cypress/integration/Home/ecommerce-next-steps.cy.js @@ -1,7 +1,6 @@ import { GetPluginId } from '../wp-module-support/pluginID.cy'; import { wpLogin, - comingSoon, viewCompletedTasks, viewRemainingTasks, } from '../wp-module-support/utils.cy'; @@ -155,7 +154,9 @@ describe( 'e-commerce Home Page- Next Steps', () => { .scrollIntoView() .invoke( 'removeAttr', 'target' ) .click(); - cy.url().contains( + cy.url() + .should( + 'contain', 'https://my.yoast.com/signup?redirect_to=https://academy.yoast.com/courses/' ); cy.go( 'back' ); diff --git a/tests/cypress/integration/Store/storePage.cy.js b/tests/cypress/integration/Store/storePage.cy.js index 08f4dc52..b07c0df2 100644 --- a/tests/cypress/integration/Store/storePage.cy.js +++ b/tests/cypress/integration/Store/storePage.cy.js @@ -11,7 +11,7 @@ describe( () => { before( () => { wpLogin(); - // uninstallPlugins(); + uninstallPlugins(); cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); } ); From 8e8789423f53ccc078ddbb3ee38d71e50f23e8c0 Mon Sep 17 00:00:00 2001 From: sangeetha-nayak Date: Fri, 5 Jul 2024 10:38:44 +0530 Subject: [PATCH 4/5] de-activate woo plugin if at all it is active. --- 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 b07c0df2..a10fc5b5 100644 --- a/tests/cypress/integration/Store/storePage.cy.js +++ b/tests/cypress/integration/Store/storePage.cy.js @@ -11,7 +11,8 @@ describe( () => { before( () => { wpLogin(); - uninstallPlugins(); + cy.exec( `npx wp-env run cli wp plugin deactivate woocommerce`, + { failOnNonZeroExit: false }); cy.visit( '/wp-admin/admin.php?page=' + pluginId + '#/store' ); } ); From a87fa76608e36aa781e2635647be66430a9bd5a5 Mon Sep 17 00:00:00 2001 From: Ramya krishna Date: Fri, 5 Jul 2024 18:24:33 +0530 Subject: [PATCH 5/5] ecommerce version bump 1.3.36 --- bootstrap.php | 2 +- composer.lock | 86 +++++++++++++++++++++++------------------------ package-lock.json | 4 +-- package.json | 2 +- 4 files changed, 47 insertions(+), 47 deletions(-) diff --git a/bootstrap.php b/bootstrap.php index e31491e4..fe4107b1 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -5,7 +5,7 @@ use function NewfoldLabs\WP\ModuleLoader\register; -define( 'NFD_ECOMMERCE_MODULE_VERSION', '1.3.35' ); +define( 'NFD_ECOMMERCE_MODULE_VERSION', '1.3.36' ); 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 c1d9bf1a..28435f96 100644 --- a/composer.lock +++ b/composer.lock @@ -2983,16 +2983,16 @@ }, { "name": "symfony/console", - "version": "v5.4.40", + "version": "v5.4.41", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "aa73115c0c24220b523625bfcfa655d7d73662dd" + "reference": "6473d441a913cb997123b59ff2dbe3d1cf9e11ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/aa73115c0c24220b523625bfcfa655d7d73662dd", - "reference": "aa73115c0c24220b523625bfcfa655d7d73662dd", + "url": "https://api.github.com/repos/symfony/console/zipball/6473d441a913cb997123b59ff2dbe3d1cf9e11ba", + "reference": "6473d441a913cb997123b59ff2dbe3d1cf9e11ba", "shasum": "" }, "require": { @@ -3062,7 +3062,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.40" + "source": "https://github.com/symfony/console/tree/v5.4.41" }, "funding": [ { @@ -3078,7 +3078,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-06-28T07:48:55+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3149,16 +3149,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.40", + "version": "v5.4.41", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "26dd9912df6940810ea00f8f53ad48d6a3424995" + "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/26dd9912df6940810ea00f8f53ad48d6a3424995", - "reference": "26dd9912df6940810ea00f8f53ad48d6a3424995", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/6d29dd9340b372fa603f04e6df4dd76bb808591e", + "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e", "shasum": "" }, "require": { @@ -3196,7 +3196,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.40" + "source": "https://github.com/symfony/filesystem/tree/v5.4.41" }, "funding": [ { @@ -3212,7 +3212,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-06-28T09:36:24+00:00" }, { "name": "symfony/finder", @@ -3974,16 +3974,16 @@ }, { "name": "symfony/string", - "version": "v5.4.40", + "version": "v5.4.41", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "142877285aa974a6f7685e292ab5ba9aae86b143" + "reference": "065a9611e0b1fd2197a867e1fb7f2238191b7096" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/142877285aa974a6f7685e292ab5ba9aae86b143", - "reference": "142877285aa974a6f7685e292ab5ba9aae86b143", + "url": "https://api.github.com/repos/symfony/string/zipball/065a9611e0b1fd2197a867e1fb7f2238191b7096", + "reference": "065a9611e0b1fd2197a867e1fb7f2238191b7096", "shasum": "" }, "require": { @@ -4040,7 +4040,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.40" + "source": "https://github.com/symfony/string/tree/v5.4.41" }, "funding": [ { @@ -4056,7 +4056,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:33:22+00:00" + "time": "2024-06-28T09:20:55+00:00" }, { "name": "wp-cli/cache-command", @@ -5128,16 +5128,16 @@ }, { "name": "wp-cli/language-command", - "version": "v2.0.20", + "version": "v2.0.21", "source": { "type": "git", "url": "https://github.com/wp-cli/language-command.git", - "reference": "2e6edc65aff1828b79250b96ace93d77abcca481" + "reference": "a9b5ae5976ebb48ee5465cf2f8d9afc863bc4e1c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/language-command/zipball/2e6edc65aff1828b79250b96ace93d77abcca481", - "reference": "2e6edc65aff1828b79250b96ace93d77abcca481", + "url": "https://api.github.com/repos/wp-cli/language-command/zipball/a9b5ae5976ebb48ee5465cf2f8d9afc863bc4e1c", + "reference": "a9b5ae5976ebb48ee5465cf2f8d9afc863bc4e1c", "shasum": "" }, "require": { @@ -5201,9 +5201,9 @@ "homepage": "https://github.com/wp-cli/language-command", "support": { "issues": "https://github.com/wp-cli/language-command/issues", - "source": "https://github.com/wp-cli/language-command/tree/v2.0.20" + "source": "https://github.com/wp-cli/language-command/tree/v2.0.21" }, - "time": "2024-02-20T12:36:40+00:00" + "time": "2024-06-21T10:12:40+00:00" }, { "name": "wp-cli/maintenance-mode-command", @@ -5268,16 +5268,16 @@ }, { "name": "wp-cli/media-command", - "version": "v2.1.0", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/wp-cli/media-command.git", - "reference": "210cccf80f4faa38c0c608768089edf7acf2b319" + "reference": "8eefc101713713871c1802e387b87348f6a048d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/media-command/zipball/210cccf80f4faa38c0c608768089edf7acf2b319", - "reference": "210cccf80f4faa38c0c608768089edf7acf2b319", + "url": "https://api.github.com/repos/wp-cli/media-command/zipball/8eefc101713713871c1802e387b87348f6a048d5", + "reference": "8eefc101713713871c1802e387b87348f6a048d5", "shasum": "" }, "require": { @@ -5324,9 +5324,9 @@ "homepage": "https://github.com/wp-cli/media-command", "support": { "issues": "https://github.com/wp-cli/media-command/issues", - "source": "https://github.com/wp-cli/media-command/tree/v2.1.0" + "source": "https://github.com/wp-cli/media-command/tree/v2.2.0" }, - "time": "2024-03-14T09:04:20+00:00" + "time": "2024-06-06T09:32:12+00:00" }, { "name": "wp-cli/mustangostang-spyc", @@ -5381,16 +5381,16 @@ }, { "name": "wp-cli/package-command", - "version": "v2.5.1", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/wp-cli/package-command.git", - "reference": "afa90e92e6b2b1f9fe754963726909433facd9f5" + "reference": "3370dd88ddf906992bda3a28c8c387c8f4f33073" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/package-command/zipball/afa90e92e6b2b1f9fe754963726909433facd9f5", - "reference": "afa90e92e6b2b1f9fe754963726909433facd9f5", + "url": "https://api.github.com/repos/wp-cli/package-command/zipball/3370dd88ddf906992bda3a28c8c387c8f4f33073", + "reference": "3370dd88ddf906992bda3a28c8c387c8f4f33073", "shasum": "" }, "require": { @@ -5440,9 +5440,9 @@ "homepage": "https://github.com/wp-cli/package-command", "support": { "issues": "https://github.com/wp-cli/package-command/issues", - "source": "https://github.com/wp-cli/package-command/tree/v2.5.1" + "source": "https://github.com/wp-cli/package-command/tree/v2.5.2" }, - "time": "2024-04-26T10:03:17+00:00" + "time": "2024-05-22T05:26:05+00:00" }, { "name": "wp-cli/php-cli-tools", @@ -6148,16 +6148,16 @@ }, { "name": "wp-cli/wp-config-transformer", - "version": "v1.3.5", + "version": "v1.3.6", "source": { "type": "git", "url": "https://github.com/wp-cli/wp-config-transformer.git", - "reference": "202aa80528939159d52bc4026cee5453aec382db" + "reference": "88f516f44dce1660fc4b780da513e3ca12d7d24f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/wp-config-transformer/zipball/202aa80528939159d52bc4026cee5453aec382db", - "reference": "202aa80528939159d52bc4026cee5453aec382db", + "url": "https://api.github.com/repos/wp-cli/wp-config-transformer/zipball/88f516f44dce1660fc4b780da513e3ca12d7d24f", + "reference": "88f516f44dce1660fc4b780da513e3ca12d7d24f", "shasum": "" }, "require": { @@ -6186,9 +6186,9 @@ "homepage": "https://github.com/wp-cli/wp-config-transformer", "support": { "issues": "https://github.com/wp-cli/wp-config-transformer/issues", - "source": "https://github.com/wp-cli/wp-config-transformer/tree/v1.3.5" + "source": "https://github.com/wp-cli/wp-config-transformer/tree/v1.3.6" }, - "time": "2023-11-10T14:28:03+00:00" + "time": "2024-05-23T06:32:14+00:00" }, { "name": "wp-coding-standards/wpcs", @@ -6271,5 +6271,5 @@ "platform-overrides": { "php": "7.3.0" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.3.0" } diff --git a/package-lock.json b/package-lock.json index 35961bc9..a0cd7698 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@newfold-labs/wp-module-ecommerce", - "version": "1.3.35", + "version": "1.3.36", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@newfold-labs/wp-module-ecommerce", - "version": "1.3.35", + "version": "1.3.36", "license": "GPL-2.0-or-later", "dependencies": { "@faizaanceg/pandora": "^1.1.1", diff --git a/package.json b/package.json index ae1052ac..cbe3ef64 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.35", + "version": "1.3.36", "main": "build/index.js", "files": [ "build/",