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 # Unreleased
## Fixed
- Moved `merchant.login()` out of `beforeAll()` block and into test body for retried runs.
## Added ## Added
- A `specs/data` folder to store page element data. - A `specs/data` folder to store page element data.

View File

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