Skip to content

Commit

Permalink
Add e2e tests to confirm that the store is in coming soon mode after …
Browse files Browse the repository at this point in the history
…completing the core profiler (woocommerce#50784)

* Update core profiler setup e2e to handle coming soon mode

This adds a new test to confirm that the store is in coming soon mode after completing the core profiler. Additionally, it adds a new test to confirm that the store is in coming soon mode after skipping the core profiler.

These changes are necessary to ensure that the core profiler setup works correctly when the store is in coming soon mode.

* Add changefile(s) from automation for the following project(s): woocommerce

* Include coming soon test case in core profiler steps

---------

Co-authored-by: github-actions <[email protected]>
  • Loading branch information
chihsuan and github-actions authored Aug 22, 2024
1 parent b04f535 commit 0a60c3c
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
4 changes: 4 additions & 0 deletions plugins/woocommerce/changelog/50784-add-coming-soon-mode-e2e
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: dev

Add e2e tests to confirm that the store is in coming soon mode after completing the core profiler
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
const { test, expect } = require( '@playwright/test' );
const { test, expect, request } = require( '@playwright/test' );
const { setOption } = require( '../../utils/options' );

test.describe( 'Store owner can complete the core profiler', () => {
test.use( { storageState: process.env.ADMINSTATE } );

test.beforeAll( async ( { baseURL } ) => {
try {
await setOption(
request,
baseURL,
'woocommerce_coming_soon',
'no'
);
} catch ( error ) {
console.log( error );
}
} );

test( 'Can complete the core profiler skipping extension install', async ( {
page,
} ) => {
Expand Down Expand Up @@ -393,12 +407,32 @@ test.describe( 'Store owner can complete the core profiler', () => {
page.getByLabel( 'Delete Pinterest for' )
).toBeHidden();
} );

await test.step( 'Confirm that the store is in coming soon mode after completing the core profiler', async () => {
await page.goto( 'wp-admin/admin.php?page=wc-admin' );
await expect(
page.getByRole( 'menuitem', { name: 'Store coming soon' } )
).toBeVisible();
} );
} );
} );

test.describe( 'Store owner can skip the core profiler', () => {
test.use( { storageState: process.env.ADMINSTATE } );

test.beforeAll( async ( { baseURL } ) => {
try {
await setOption(
request,
baseURL,
'woocommerce_coming_soon',
'no'
);
} catch ( error ) {
console.log( error );
}
} );

test( 'Can click skip guided setup', async ( { page } ) => {
await page.goto(
'wp-admin/admin.php?page=wc-admin&path=%2Fsetup-wizard'
Expand Down Expand Up @@ -426,6 +460,13 @@ test.describe( 'Store owner can skip the core profiler', () => {
name: 'Welcome to WooCommerce Core E2E Test Suite',
} )
).toBeVisible();

await test.step( 'Confirm that the store is in coming soon mode after skipping the core profiler', async () => {
await page.goto( 'wp-admin/admin.php?page=wc-admin' );
await expect(
page.getByRole( 'menuitem', { name: 'Store coming soon' } )
).toBeVisible();
} );
} );

test( 'Can connect to WooCommerce.com', async ( { page } ) => {
Expand Down

0 comments on commit 0a60c3c

Please sign in to comment.