Skip to content

Commit

Permalink
[e2e tests] External sites - update admin-* folders (woocommerce#50994)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored Aug 27, 2024
1 parent dd79e4b commit 013cef9
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: update

Update admin-* folders, so e2e tests are passing against Pressable env.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ config = {
'**/merchant/products/add-variable-product/**/*.spec.js',
'**/activate-and-setup/**/*.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/,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const test = baseTest.extend( {

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ test.describe( 'Marketing page', () => {
).toBeVisible();

// Sections present
await expect(
page.getByText(
'Reach new customers and increase sales without leaving WooCommerce'
)
).toBeVisible();
await expect(
page.getByText( 'Channels', { exact: true } )
).toBeVisible();
Expand All @@ -55,38 +50,44 @@ test.describe( 'Marketing page', () => {
).toBeVisible();
} );

test( 'Introduction can be dismissed', 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)
try {
await page
.locator(
'.woocommerce-marketing-introduction-banner-illustration > .components-button'
test(
'Introduction can be dismissed',
{ 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)
try {
await page
.locator(
'.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 } );
} catch ( e ) {
console.log( 'Info: introduction already hidden' );
}
).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();
// 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 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 } ) => {
// Go to the Dashboard page (this adds time for posts to be created)
Expand Down

0 comments on commit 013cef9

Please sign in to comment.