Merge pull request #31545 from woocommerce/fix/31468

Move merchant.login out of beforeAll block
This commit is contained in:
Greg 2022-01-03 15:55:46 -07:00 committed by GitHub
commit 48a6347b48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 9 deletions

View File

@ -1,5 +1,8 @@
# Unreleased
## Fixed
- Moved `merchant.login()` out of `beforeAll()` block and into test body for retried runs.
## Added
- A `specs/data` folder to store page element data.

View File

@ -23,7 +23,6 @@ const {
const {
it,
describe,
beforeAll,
} = require( '@jest/globals' );
const config = require( 'config' );
@ -41,10 +40,6 @@ const openNewProductAndVerify = async () => {
const runAddSimpleProductTest = () => {
describe('Add New Simple Product Page', () => {
beforeAll(async () => {
await merchant.login();
});
it('can create simple virtual product and add it to the cart', async () => {
// @todo: remove this once https://github.com/woocommerce/woocommerce/issues/31337 has been addressed
@ -53,6 +48,7 @@ const runAddSimpleProductTest = () => {
height: 700,
} );
await merchant.login();
await openNewProductAndVerify();
// Set product data and publish the product
@ -120,11 +116,8 @@ const runAddSimpleProductTest = () => {
const runAddVariableProductTest = () => {
describe('Add New Variable Product Page', () => {
beforeAll(async () => {
await merchant.login();
});
it('can create product with variations', async () => {
await merchant.login();
await openNewProductAndVerify();
// Set product data