From 6adf1a7a6f1b399b747c6795e15374643363fc2d Mon Sep 17 00:00:00 2001 From: Burhan Nasir Date: Mon, 27 Jan 2025 18:08:46 +0500 Subject: [PATCH 1/2] Fix E2E tests --- tests/cypress/integration/features/woocommerce.cy.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/cypress/integration/features/woocommerce.cy.js b/tests/cypress/integration/features/woocommerce.cy.js index 184056684..9bb3ce0e9 100644 --- a/tests/cypress/integration/features/woocommerce.cy.js +++ b/tests/cypress/integration/features/woocommerce.cy.js @@ -146,12 +146,19 @@ describe('WooCommerce Feature', { tags: '@slow' }, () => { // enable payment gateway. cy.visitAdminPage('admin.php?page=wc-settings&tab=checkout§ion=cod'); + // if the checkbox is already checked, uncheck it first to enable the save button. + cy.get('#woocommerce_cod_enabled').uncheck(); cy.get('#woocommerce_cod_enabled').check(); cy.get( `.button-primary.woocommerce-save-button, .components-button.is-primary.woocommerce-save-button`, ).click(); + // set the store to live. + cy.visitAdminPage('admin.php?page=wc-settings&tab=site-visibility'); + cy.contains('label', 'Live').siblings('input[type="radio"]').check(); + cy.get('.components-button.is-primary.woocommerce-save-button').click(); + cy.logout(); // create new user. From 53cad59efd961bf8689a9a777514601303fae59c Mon Sep 17 00:00:00 2001 From: Burhan Nasir Date: Mon, 27 Jan 2025 18:46:25 +0500 Subject: [PATCH 2/2] Fix test --- tests/cypress/integration/features/woocommerce.cy.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/cypress/integration/features/woocommerce.cy.js b/tests/cypress/integration/features/woocommerce.cy.js index 9bb3ce0e9..cf6f81fcd 100644 --- a/tests/cypress/integration/features/woocommerce.cy.js +++ b/tests/cypress/integration/features/woocommerce.cy.js @@ -154,10 +154,8 @@ describe('WooCommerce Feature', { tags: '@slow' }, () => { .components-button.is-primary.woocommerce-save-button`, ).click(); - // set the store to live. - cy.visitAdminPage('admin.php?page=wc-settings&tab=site-visibility'); - cy.contains('label', 'Live').siblings('input[type="radio"]').check(); - cy.get('.components-button.is-primary.woocommerce-save-button').click(); + // disable coming soon option. + cy.wpCli('option update woocommerce_coming_soon off'); cy.logout();