[e2e tests] External sites - update /merchant tests, part 1 (#51014)
* Dismiss "Choose a pattern" if present * Cover "New in store" for PRessable * Handle error for `api.delete( coupons/<id> )` * Check if `Select an option…` is available * Expand Pressable suite * Add changefile(s) from automation for the following project(s): woocommerce * Missed one spec, adding it now * Handle "Choose a pattern" popup * Use `closeChoosePatternModal` instead * Remove comments * Add missing `throw` error * Revert to check `Browse store` link, after updating template on Pressable --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
parent
a5e9744ed5
commit
3a2a812e1d
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: update
|
||||
|
||||
Update /merchant tests (first five files), so they are passing against Pressable env.
|
|
@ -16,6 +16,11 @@ config = {
|
|||
'**/admin-marketing/**/*.spec.js',
|
||||
'**/admin-tasks/**/*.spec.js',
|
||||
'**/customize-store/**/*.spec.js',
|
||||
'**/merchant/command-palette.spec.js',
|
||||
'**/merchant/create-cart-block.spec.js',
|
||||
'**/merchant/create-checkout-block.spec.js',
|
||||
'**/merchant/create-coupon.spec.js',
|
||||
'**/merchant/create-order.spec.js',
|
||||
],
|
||||
grepInvert: /@skip-on-default-pressable/,
|
||||
},
|
||||
|
|
|
@ -5,6 +5,7 @@ const {
|
|||
insertBlock,
|
||||
transformIntoBlocks,
|
||||
publishPage,
|
||||
closeChoosePatternModal,
|
||||
} = require( '../../utils/editor' );
|
||||
const { getInstalledWordPressVersion } = require( '../../utils/wordpress' );
|
||||
|
||||
|
@ -23,6 +24,8 @@ test.describe(
|
|||
} ) => {
|
||||
await goToPageEditor( { page } );
|
||||
|
||||
await closeChoosePatternModal( { page } );
|
||||
|
||||
await fillPageTitle( page, testPage.title );
|
||||
const wordPressVersion = await getInstalledWordPressVersion();
|
||||
await insertBlock( page, 'Classic Cart', wordPressVersion );
|
||||
|
|
|
@ -7,6 +7,7 @@ const {
|
|||
transformIntoBlocks,
|
||||
publishPage,
|
||||
openEditorSettings,
|
||||
closeChoosePatternModal,
|
||||
} = require( '../../utils/editor' );
|
||||
const { getInstalledWordPressVersion } = require( '../../utils/wordpress' );
|
||||
|
||||
|
@ -74,6 +75,8 @@ test.describe(
|
|||
} ) => {
|
||||
await goToPageEditor( { page } );
|
||||
|
||||
await closeChoosePatternModal( { page } );
|
||||
|
||||
await fillPageTitle( page, testPage.title );
|
||||
const wordPressVersion = await getInstalledWordPressVersion();
|
||||
await insertBlock( page, 'Classic Checkout', wordPressVersion );
|
||||
|
|
|
@ -35,7 +35,15 @@ const test = baseTest.extend( {
|
|||
coupon: async ( { api }, use ) => {
|
||||
const coupon = {};
|
||||
await use( coupon );
|
||||
await api.delete( `coupons/${ coupon.id }`, { force: true } );
|
||||
await api
|
||||
.delete( `coupons/${ coupon.id }`, { force: true } )
|
||||
.then( ( response ) => {
|
||||
console.log( 'Delete successful:', response.data );
|
||||
} )
|
||||
.catch( ( error ) => {
|
||||
console.log( 'Error response data:', error.response.data );
|
||||
throw new Error( error.response.data );
|
||||
} );
|
||||
},
|
||||
} );
|
||||
|
||||
|
|
|
@ -299,10 +299,17 @@ test.describe(
|
|||
await page
|
||||
.getByRole( 'textbox', { name: 'Postcode' } )
|
||||
.fill( '12345' );
|
||||
await page
|
||||
.getByRole( 'textbox', { name: 'Select an option…' } )
|
||||
.click();
|
||||
await page.getByRole( 'option', { name: 'Florida' } ).click();
|
||||
// eslint-disable-next-line playwright/no-conditional-in-test
|
||||
if (
|
||||
await page
|
||||
.getByRole( 'textbox', { name: 'Select an option…' } )
|
||||
.isVisible()
|
||||
) {
|
||||
await page
|
||||
.getByRole( 'textbox', { name: 'Select an option…' } )
|
||||
.click();
|
||||
await page.getByRole( 'option', { name: 'Florida' } ).click();
|
||||
}
|
||||
await page
|
||||
.getByRole( 'textbox', { name: 'Email address' } )
|
||||
.fill( 'elbarto@example.com' );
|
||||
|
|
Loading…
Reference in New Issue