[e2e tests] External sites - update admin-* folders (#50994)

* Skip `Introduction can be dismissed`

* This part is already covered in `Introduction can be dismissed`

* Skip Analytics-related tests since there are already some numbers on Pressable website

* Include admin related tests into default-pressable test suite

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

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
This commit is contained in:
Ivan Stojadinov 2024-08-27 18:44:56 +02:00 committed by GitHub
parent dd79e4bf97
commit 013cef959e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 43 additions and 35 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: update
Update admin-* folders, so e2e tests are passing against Pressable env.

View File

@ -12,6 +12,9 @@ config = {
'**/merchant/products/add-variable-product/**/*.spec.js', '**/merchant/products/add-variable-product/**/*.spec.js',
'**/activate-and-setup/**/*.spec.js', '**/activate-and-setup/**/*.spec.js',
'**/merchant/products/block-editor/**/*.spec.js', '**/merchant/products/block-editor/**/*.spec.js',
'**/admin-analytics/**/*.spec.js',
'**/admin-marketing/**/*.spec.js',
'**/admin-tasks/**/*.spec.js',
], ],
grepInvert: /@skip-on-default-pressable/, grepInvert: /@skip-on-default-pressable/,
}, },

View File

@ -25,7 +25,7 @@ const test = baseTest.extend( {
test.describe( test.describe(
'Analytics-related tests', 'Analytics-related tests',
{ tag: [ '@payments', '@services' ] }, { tag: [ '@payments', '@services', '@skip-on-default-pressable' ] },
() => { () => {
let categoryIds, productIds, orderIds, setupPage; let categoryIds, productIds, orderIds, setupPage;

View File

@ -27,11 +27,6 @@ test.describe( 'Marketing page', () => {
).toBeVisible(); ).toBeVisible();
// Sections present // Sections present
await expect(
page.getByText(
'Reach new customers and increase sales without leaving WooCommerce'
)
).toBeVisible();
await expect( await expect(
page.getByText( 'Channels', { exact: true } ) page.getByText( 'Channels', { exact: true } )
).toBeVisible(); ).toBeVisible();
@ -55,38 +50,44 @@ test.describe( 'Marketing page', () => {
).toBeVisible(); ).toBeVisible();
} ); } );
test( 'Introduction can be dismissed', async ( { page } ) => { test(
// Go to the Marketing page. 'Introduction can be dismissed',
await page.goto( 'wp-admin/admin.php?page=wc-admin&path=%2Fmarketing' ); { tag: '@skip-on-default-pressable' },
async ( { page } ) => {
// Go to the Marketing page.
await page.goto(
'wp-admin/admin.php?page=wc-admin&path=%2Fmarketing'
);
// Dismiss the introduction (if it's visible) // Dismiss the introduction (if it's visible)
try { try {
await page await page
.locator( .locator(
'.woocommerce-marketing-introduction-banner-illustration > .components-button' '.woocommerce-marketing-introduction-banner-illustration > .components-button'
)
.click( { timeout: 2000 } );
} catch ( e ) {
console.log( 'Info: introduction already hidden' );
}
// The introduction should be hidden.
await expect(
page.getByText(
'Reach new customers and increase sales without leaving WooCommerce'
) )
.click( { timeout: 2000 } ); ).toBeHidden();
} catch ( e ) {
console.log( 'Info: introduction already hidden' ); // Refresh the page to make sure the state is saved.
await page.reload();
// The introduction should still be hidden.
await expect(
page.getByText(
'Reach new customers and increase sales without leaving WooCommerce'
)
).toBeHidden();
} }
);
// The introduction should be hidden.
await expect(
page.getByText(
'Reach new customers and increase sales without leaving WooCommerce'
)
).toBeHidden();
// Refresh the page to make sure the state is saved.
await page.reload();
// The introduction should still be hidden.
await expect(
page.getByText(
'Reach new customers and increase sales without leaving WooCommerce'
)
).toBeHidden();
} );
test( 'Learning section can be expanded', async ( { page } ) => { test( 'Learning section can be expanded', async ( { page } ) => {
// Go to the Dashboard page (this adds time for posts to be created) // Go to the Dashboard page (this adds time for posts to be created)