Merge branch 'trunk' into add/jest-retry

This commit is contained in:
jamelreid 2021-12-06 17:50:22 -05:00
commit 021b61a5f9
9 changed files with 19 additions and 10 deletions

View File

@ -40,7 +40,7 @@ const runAddNewShippingZoneTest = () => {
});
afterAll( async () => {
shopper.logout();
await shopper.logout();
} );
it('add shipping zone for San Francisco with free Local pickup', async () => {

View File

@ -42,6 +42,10 @@ const runCheckoutLoginAccountTest = () => {
await shopper.goToCheckout();
});
afterAll( async () => {
await shopper.logout();
} );
it('can login to an existing account during checkout', async () => {
// Click to login during checkout
await page.waitForSelector('.woocommerce-form-login-toggle');
@ -65,8 +69,11 @@ const runCheckoutLoginAccountTest = () => {
// Verify the user is logged in on my account page
await shopper.gotoMyAccount();
await expect(page.url()).toMatch('my-account/');
await expect(page).toMatchElement('h1', {text: 'My account'});
await Promise.all( [
await expect(page.url()).toMatch('my-account/'),
await expect(page).toMatchElement('h1', {text: 'My account'}),
] );
});
});
};

View File

@ -26,7 +26,7 @@ const runMyAccountCreateAccountTest = () => {
});
afterAll( async () => {
shopper.logout();
await shopper.logout();
} );
it('can create a new account via my account', async () => {

View File

@ -35,7 +35,7 @@ const runMyAccountPayOrderTest = () => {
});
afterAll( async () => {
shopper.logout();
await shopper.logout();
} );
it('allows customer to pay for their order in My Account', async () => {

View File

@ -16,7 +16,7 @@ const pages = [
const runMyAccountPageTest = () => {
describe('My account page', () => {
afterAll( async () => {
shopper.logout();
await shopper.logout();
} );
it('allows customer to login', async () => {

View File

@ -37,7 +37,7 @@ const runOrderEmailReceivingTest = () => {
});
afterAll( async () => {
shopper.logout();
await shopper.logout();
} );
it('should receive order email after purchasing an item', async () => {

View File

@ -2,8 +2,7 @@
## Added
- Added `jest-circus` as a test runner to enable retrying failed tests
- Added `E2E_RETRY_TIMES` environment variable to determine retry count. The default is 3.
- Added `await` for every call to `shopper.logout`
## Fixed

View File

@ -1,5 +1,9 @@
# Unreleased
## Changes
- Removed `page.waitForNavigation()` from `shopper.logout()`
## Added
- `utils.waitForTimeout( delay )` pause processing for `delay` milliseconds

View File

@ -240,7 +240,6 @@ const shopper = {
await expect( page.title() ).resolves.toMatch( 'My account' );
await page.click( '.woocommerce-MyAccount-navigation-link--customer-logout a' );
await page.waitForNavigation( { waitUntil: 'networkidle0' } );
},
};