diff --git a/plugins/woocommerce/changelog/e2e-fix-compatibility-external-envs-part2 b/plugins/woocommerce/changelog/e2e-fix-compatibility-external-envs-part2 new file mode 100644 index 00000000000..682518cc821 --- /dev/null +++ b/plugins/woocommerce/changelog/e2e-fix-compatibility-external-envs-part2 @@ -0,0 +1,4 @@ +Significance: patch +Type: update + +Update /shopper tests (second part), so they are passing against Pressable env. \ No newline at end of file diff --git a/plugins/woocommerce/tests/e2e-pw/envs/default-pressable/playwright.config.js b/plugins/woocommerce/tests/e2e-pw/envs/default-pressable/playwright.config.js index b0747f37c30..48f83f3e12b 100644 --- a/plugins/woocommerce/tests/e2e-pw/envs/default-pressable/playwright.config.js +++ b/plugins/woocommerce/tests/e2e-pw/envs/default-pressable/playwright.config.js @@ -21,6 +21,23 @@ config = { '**/merchant/create-checkout-block.spec.js', '**/merchant/create-coupon.spec.js', '**/merchant/create-order.spec.js', + '**/shopper/checkout-create-account.spec.js', + '**/shopper/checkout-login.spec.js', + '**/shopper/checkout.spec.js', + '**/shopper/dashboard-access.spec.js', + '**/shopper/mini-cart.spec.js', + '**/shopper/my-account-addresses.spec.js', + '**/shopper/my-account-create-account.spec.js', + '**/shopper/my-account-downloads.spec.js', + '**/shopper/my-account-pay-order.spec.js', + '**/shopper/my-account.spec.js', + '**/shopper/order-email-receiving.spec.js', + '**/shopper/product-grouped.spec.js', + '**/shopper/product-simple.spec.js', + '**/shopper/product-tags-attributes.spec.js', + '**/shopper/product-variable.spec.js', + '**/shopper/shop-search-browse-sort.spec.js', + '**/shopper/shop-title-after-deletion.spec.js', ], grepInvert: /@skip-on-default-pressable/, }, diff --git a/plugins/woocommerce/tests/e2e-pw/envs/default-wpcom/playwright.config.js b/plugins/woocommerce/tests/e2e-pw/envs/default-wpcom/playwright.config.js index 179fca7b471..3a566c9a531 100644 --- a/plugins/woocommerce/tests/e2e-pw/envs/default-wpcom/playwright.config.js +++ b/plugins/woocommerce/tests/e2e-pw/envs/default-wpcom/playwright.config.js @@ -7,7 +7,27 @@ config = { { name: 'default wpcom', use: { ...devices[ 'Desktop Chrome' ] }, - testMatch: '**basic.spec.js', + testMatch: [ + '**/basic.spec.js', + '**/shopper/checkout-create-account.spec.js', + '**/shopper/checkout-login.spec.js', + '**/shopper/checkout.spec.js', + '**/shopper/dashboard-access.spec.js', + '**/shopper/mini-cart.spec.js', + '**/shopper/my-account-addresses.spec.js', + '**/shopper/my-account-create-account.spec.js', + '**/shopper/my-account-downloads.spec.js', + '**/shopper/my-account-pay-order.spec.js', + '**/shopper/my-account.spec.js', + '**/shopper/order-email-receiving.spec.js', + '**/shopper/product-grouped.spec.js', + '**/shopper/product-simple.spec.js', + '**/shopper/product-tags-attributes.spec.js', + '**/shopper/product-variable.spec.js', + '**/shopper/shop-search-browse-sort.spec.js', + '**/shopper/shop-title-after-deletion.spec.js', + ], + grepInvert: /@skip-on-default-wpcom/, }, ], }; diff --git a/plugins/woocommerce/tests/e2e-pw/tests/shopper/launch-your-store.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/shopper/launch-your-store.spec.js index 5f85238a598..5db7a5ebd3b 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/shopper/launch-your-store.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/shopper/launch-your-store.spec.js @@ -72,43 +72,51 @@ async function runComingSoonTests( themeContext = '' ) { } ); } -test.describe( 'Launch Your Store front end - logged out', () => { - test.afterAll( async ( { baseURL } ) => { - try { - await setOption( - request, - baseURL, - 'woocommerce_coming_soon', - 'no' +test.describe( + 'Launch Your Store front end - logged out', + { tag: [ '@skip-on-default-wpcom', '@skip-on-default-pressable' ] }, + () => { + test.afterAll( async ( { baseURL } ) => { + try { + await setOption( + request, + baseURL, + 'woocommerce_coming_soon', + 'no' + ); + } catch ( error ) { + console.log( error ); + } + } ); + + test.describe( 'Block Theme (Twenty Twenty Four)', () => { + test.beforeAll( async () => { + await activateTheme( 'twentytwentyfour' ); + } ); + + test.afterAll( async () => { + // Reset theme to the default. + await activateTheme( DEFAULT_THEME ); + } ); + + runComingSoonTests( test.step, test.use ); + } ); + + test.describe( 'Classic Theme (Storefront)', () => { + test.beforeAll( async () => { + await activateTheme( 'storefront' ); + } ); + + test.afterAll( async () => { + // Reset theme to the default. + await activateTheme( DEFAULT_THEME ); + } ); + + runComingSoonTests( + test.step, + test.use, + 'Classic Theme (Storefront)' ); - } catch ( error ) { - console.log( error ); - } - } ); - - test.describe( 'Block Theme (Twenty Twenty Four)', () => { - test.beforeAll( async () => { - await activateTheme( 'twentytwentyfour' ); } ); - - test.afterAll( async () => { - // Reset theme to the default. - await activateTheme( DEFAULT_THEME ); - } ); - - runComingSoonTests( test.step, test.use ); - } ); - - test.describe( 'Classic Theme (Storefront)', () => { - test.beforeAll( async () => { - await activateTheme( 'storefront' ); - } ); - - test.afterAll( async () => { - // Reset theme to the default. - await activateTheme( DEFAULT_THEME ); - } ); - - runComingSoonTests( test.step, test.use, 'Classic Theme (Storefront)' ); - } ); -} ); + } +); diff --git a/plugins/woocommerce/tests/e2e-pw/tests/shopper/shop-products-filter-by-price.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/shopper/shop-products-filter-by-price.spec.js index 61fd3df02ba..ddf1a2d4735 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/shopper/shop-products-filter-by-price.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/shopper/shop-products-filter-by-price.spec.js @@ -24,7 +24,14 @@ const test = baseTest.extend( { test.describe( 'Filter items in the shop by product price', - { tag: [ '@payments', '@services' ] }, + { + tag: [ + '@payments', + '@services', + '@skip-on-default-wpcom', + '@skip-on-default-pressable', + ], + }, () => { test.beforeAll( async ( { api } ) => { // add products diff --git a/plugins/woocommerce/tests/e2e-pw/tests/shopper/shop-title-after-deletion.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/shopper/shop-title-after-deletion.spec.js index 5c361b1ed50..f0b75c15854 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/shopper/shop-title-after-deletion.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/shopper/shop-title-after-deletion.spec.js @@ -30,6 +30,18 @@ test.describe( await page .getByText( '1 page restored from the Trash.' ) .waitFor( { state: 'visible' } ); + await page.goto( 'wp-admin/edit.php?post_type=page' ); + await page.getByRole( 'cell', { name: '“Shop” (Edit)' } ).hover(); + await page + .getByLabel( 'Quick edit “Shop” inline' ) + .click( { force: true } ); + await page + .getByLabel( 'Status Published Pending' ) + .selectOption( 'publish', { exact: true } ); + await page.getByRole( 'button', { name: 'Update' } ).click(); + await page + .locator( '#a11y-speak-polite', { hasText: 'Changes saved.' } ) + .waitFor(); } ); test( 'Check the title of the shop page after the page has been deleted', async ( { diff --git a/plugins/woocommerce/tests/e2e-pw/tests/shopper/wordpress-post.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/shopper/wordpress-post.spec.js index fd6f46e0497..a9a3407d06f 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/shopper/wordpress-post.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/shopper/wordpress-post.spec.js @@ -6,7 +6,13 @@ const test = baseTest.extend( { test( 'logged-in customer can comment on a post', - { tag: [ '@non-critical' ] }, + { + tag: [ + '@non-critical', + '@skip-on-default-wpcom', + '@skip-on-default-pressable', + ], + }, async ( { page } ) => { await page.goto( 'hello-world/' ); await expect( diff --git a/plugins/woocommerce/tests/e2e-pw/utils/editor.js b/plugins/woocommerce/tests/e2e-pw/utils/editor.js index d2cf9d6dfe3..c837a59594e 100644 --- a/plugins/woocommerce/tests/e2e-pw/utils/editor.js +++ b/plugins/woocommerce/tests/e2e-pw/utils/editor.js @@ -45,6 +45,7 @@ const goToPageEditor = async ( { page } ) => { ); await page.goto( 'wp-admin/post-new.php?post_type=page' ); await disableWelcomeModal( { page } ); + await closeChoosePatternModal( { page } ); await responsePromise; };