E2E Fix shopper mini-cart test (#51741)

This commit is contained in:
Veljko V. 2024-09-27 22:16:21 +02:00 committed by GitHub
parent c0c162ee61
commit ac7321e5b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 8 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
Fix shopper mini cart test compatibility with external envs

View File

@ -1,8 +1,8 @@
const { test, expect } = require( '@playwright/test' );
const {
disableWelcomeModal,
openEditorSettings,
getCanvas,
goToPageEditor,
} = require( '../../utils/editor' );
const wcApi = require( '@woocommerce/woocommerce-rest-api' ).default;
const { random } = require( '../../utils/helpers' );
@ -133,9 +133,7 @@ test.describe(
const greenColor = '00cc09';
// go to create a new page
await page.goto( 'wp-admin/post-new.php?post_type=page' );
await disableWelcomeModal( { page } );
await goToPageEditor( { page } );
const canvas = await getCanvas( page );

View File

@ -1,10 +1,13 @@
const { expect } = require( '@playwright/test' );
const closeChoosePatternModal = async ( { page } ) => {
const closeModal = page.getByRole( 'button', {
name: 'Close',
exact: true,
} );
const closeModal = page
.getByLabel( 'Scrollable section' )
.filter()
.getByRole( 'button', {
name: 'Close',
exact: true,
} );
await page.addLocatorHandler( closeModal, async () => {
await closeModal.click();
} );