Add e2e tests to confirm that the store is in coming soon mode after completing the core profiler (#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 <github-actions@github.com>
This commit is contained in:
Chi-Hsuan Huang 2024-08-22 11:34:23 +08:00 committed by GitHub
parent b04f535a54
commit 0a60c3c5ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 46 additions and 1 deletions

View File

@ -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

View File

@ -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,
} ) => {
@ -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'
@ -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 } ) => {