E2e: fix order emails (#39013)
* Use latest version of WP Mail Logging * Use batch delete operation to gracefully handle uncreated test orders * Use stricter locator * Add changelog
This commit is contained in:
parent
ed1ace1646
commit
504b3be343
|
@ -24,7 +24,7 @@
|
|||
".",
|
||||
"https://downloads.wordpress.org/plugin/akismet.zip",
|
||||
"https://github.com/WP-API/Basic-Auth/archive/master.zip",
|
||||
"https://downloads.wordpress.org/plugin/wp-mail-logging.1.11.2.zip"
|
||||
"https://downloads.wordpress.org/plugin/wp-mail-logging.zip"
|
||||
],
|
||||
"themes": [
|
||||
"https://downloads.wordpress.org/theme/twentynineteen.zip"
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: dev
|
||||
|
||||
Update locators in `order-emails` spec, and use the latest version of WP Mail Logging.
|
|
@ -54,8 +54,8 @@ test.describe( 'Merchant > Order Action emails received', () => {
|
|||
consumerSecret: process.env.CONSUMER_SECRET,
|
||||
version: 'wc/v3',
|
||||
} );
|
||||
await api.delete( `orders/${ orderId }`, { force: true } );
|
||||
await api.delete( `orders/${ newOrderId }`, { force: true } );
|
||||
|
||||
await api.post( `orders/batch`, { delete: [ orderId, newOrderId ] } );
|
||||
} );
|
||||
|
||||
test( 'can receive new order email', async ( { page, baseURL } ) => {
|
||||
|
@ -104,12 +104,16 @@ test.describe( 'Merchant > Order Action emails received', () => {
|
|||
customerBilling.email
|
||||
) }`
|
||||
);
|
||||
await expect( page.locator( 'td.column-receiver' ) ).toContainText(
|
||||
admin.email
|
||||
);
|
||||
await expect( page.locator( 'td.column-subject' ) ).toContainText(
|
||||
`[${ storeName }]: New order #${ orderId }`
|
||||
);
|
||||
|
||||
// Expect row containing the admin email and the correct subject to be listed.
|
||||
await expect(
|
||||
page
|
||||
.getByRole( 'row' )
|
||||
.filter( { hasText: admin.email } )
|
||||
.filter( {
|
||||
hasText: `[${ storeName }]: New order #${ orderId }`,
|
||||
} )
|
||||
).toBeVisible();
|
||||
} );
|
||||
|
||||
test( 'can email invoice/order details to customer', async ( { page } ) => {
|
||||
|
@ -127,11 +131,15 @@ test.describe( 'Merchant > Order Action emails received', () => {
|
|||
customerBilling.email
|
||||
) }`
|
||||
);
|
||||
await expect( page.locator( 'td.column-receiver' ) ).toContainText(
|
||||
customerBilling.email
|
||||
);
|
||||
await expect( page.locator( 'td.column-subject' ) ).toContainText(
|
||||
`Invoice for order #${ orderId } on ${ storeName }`
|
||||
);
|
||||
|
||||
// Expect row containing the billing email and the correct subject to be listed.
|
||||
await expect(
|
||||
page
|
||||
.getByRole( 'row' )
|
||||
.filter( { hasText: customerBilling.email } )
|
||||
.filter( {
|
||||
hasText: `Invoice for order #${ orderId } on ${ storeName }`,
|
||||
} )
|
||||
).toBeVisible();
|
||||
} );
|
||||
} );
|
||||
|
|
Loading…
Reference in New Issue