Update e2e test for marketing page.

This commit is contained in:
Gan Eng Chin 2023-03-25 01:32:14 +08:00
parent 6a6dd1a710
commit 046b0195ab
No known key found for this signature in database
GPG Key ID: 94D5D972860ADB01
1 changed files with 1 additions and 39 deletions

View File

@ -3,47 +3,9 @@ const { test, expect } = require( '@playwright/test' );
test.describe( 'Marketing page', () => {
test.use( { storageState: process.env.ADMINSTATE } );
test( 'A user can disable the Multichannel Marketing feature in WC Settings and view the Marketing > Overview page without it crashing', async ( {
test( 'A user can view the Marketing > Overview page without it crashing', async ( {
page,
} ) => {
// Go to WC Settings > Advanced > Features page.
await page.goto(
'wp-admin/admin.php?page=wc-settings&tab=advanced&section=features'
);
// Disable multichannel marketing experience by unchecking the checkbox and clicking on "Save changes" button.
await page
.locator(
'"Enables the new WooCommerce Multichannel Marketing experience in the Marketing page"'
)
.uncheck();
await page.locator( '"Save changes"' ).click();
// Go to the Marketing page.
await page.goto( 'wp-admin/admin.php?page=wc-admin&path=%2Fmarketing' );
// Users should see the knowledge base card.
await expect(
page.locator( '"WooCommerce knowledge base"' )
).toBeVisible();
} );
test( 'A user can enable the Multichannel Marketing feature in WC Settings and view the Marketing > Overview page without it crashing', async ( {
page,
} ) => {
// Go to WC Settings > Advanced > Features page.
await page.goto(
'wp-admin/admin.php?page=wc-settings&tab=advanced&section=features'
);
// Enable multichannel marketing experience by checking the checkbox and clicking on "Save changes" button.
await page
.locator(
'"Enables the new WooCommerce Multichannel Marketing experience in the Marketing page"'
)
.check();
await page.locator( '"Save changes"' ).click();
// Go to the Marketing page.
await page.goto( 'wp-admin/admin.php?page=wc-admin&path=%2Fmarketing' );