Merge pull request #31644 from woocommerce/e2e/import-cleanup

e2e-core-test package cleanup
This commit is contained in:
Jamel Noel Reid 2022-01-17 13:08:59 -05:00 committed by GitHub
commit c9696e66b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 83 additions and 59 deletions

View File

@ -9,6 +9,36 @@
"action": "add", "action": "add",
"cwd": "packages/js/e2e-core-tests" "cwd": "packages/js/e2e-core-tests"
} }
},
"build": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "build"
}
},
"clean": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "clean"
}
},
"compile": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "compile"
}
},
"prepare": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "prepare"
}
},
"lint": {
"executor": "@nrwl/workspace:run-script",
"options": {
"script": "lint"
}
} }
} }
} }

View File

@ -7,7 +7,6 @@ const {
verifyCheckboxIsSet, verifyCheckboxIsSet,
verifyValueOfInputField, verifyValueOfInputField,
uiUnblocked, uiUnblocked,
evalAndClick,
createOrder, createOrder,
clickAndWaitForSelector, clickAndWaitForSelector,
} = require( '@woocommerce/e2e-utils' ); } = require( '@woocommerce/e2e-utils' );

View File

@ -1,8 +1,6 @@
/** /**
* Internal dependencies * Internal dependencies
*/ */
const config = require( 'config' );
const { const {
merchant, merchant,
withRestApi, withRestApi,

View File

@ -7,9 +7,14 @@ const {
merchant, merchant,
uiUnblocked, uiUnblocked,
verifyAndPublish, verifyAndPublish,
createSimpleProduct createSimpleProduct,
} = require( '@woocommerce/e2e-utils' ); } = require( '@woocommerce/e2e-utils' );
/**
* External dependencies
*/
const { it, describe, beforeAll } = require( '@jest/globals' );
let productId; let productId;
const runProductEditDetailsTest = () => { const runProductEditDetailsTest = () => {

View File

@ -11,7 +11,7 @@ const {
setBrowserViewport, setBrowserViewport,
verifyAndPublish, verifyAndPublish,
waitForSelector, waitForSelector,
waitForSelectorWithoutThrow waitForSelectorWithoutThrow,
} = require( '@woocommerce/e2e-utils' ); } = require( '@woocommerce/e2e-utils' );
const { const {
waitAndClick, waitAndClick,

View File

@ -5,7 +5,7 @@
const { const {
merchant, merchant,
settingsPageSaveChanges, settingsPageSaveChanges,
verifyValueOfInputField verifyValueOfInputField,
} = require( '@woocommerce/e2e-utils' ); } = require( '@woocommerce/e2e-utils' );
/** /**

View File

@ -8,7 +8,7 @@ const {
settingsPageSaveChanges, settingsPageSaveChanges,
unsetCheckbox, unsetCheckbox,
verifyCheckboxIsSet, verifyCheckboxIsSet,
verifyCheckboxIsUnset verifyCheckboxIsUnset,
} = require( '@woocommerce/e2e-utils' ); } = require( '@woocommerce/e2e-utils' );
const runProductSettingsTest = () => { const runProductSettingsTest = () => {

View File

@ -2,6 +2,10 @@
* Internal dependencies * Internal dependencies
*/ */
const { merchant, withRestApi } = require('@woocommerce/e2e-utils'); const { merchant, withRestApi } = require('@woocommerce/e2e-utils');
/**
* External dependencies
*/
const { lorem, helpers } = require('faker'); const { lorem, helpers } = require('faker');
const runAddShippingClassesTest = () => { const runAddShippingClassesTest = () => {

View File

@ -12,11 +12,7 @@ const {
/** /**
* External dependencies * External dependencies
*/ */
const { const { it, describe, beforeAll } = require( '@jest/globals' );
it,
describe,
beforeAll,
} = require( '@jest/globals' );
const config = require( 'config' ); const config = require( 'config' );
const firstProductPrice = config.has( 'products.simple.price' ) ? config.get( 'products.simple.price' ) : '9.99'; const firstProductPrice = config.has( 'products.simple.price' ) ? config.get( 'products.simple.price' ) : '9.99';

View File

@ -3,7 +3,6 @@
*/ */
const { const {
shopper, shopper,
createCoupon,
createSimpleProduct, createSimpleProduct,
uiUnblocked, uiUnblocked,
applyCoupon, applyCoupon,
@ -14,11 +13,7 @@ const { getCouponId, getCouponsTable } = require( '../utils/coupons' );
/** /**
* External dependencies * External dependencies
*/ */
const { const { it, describe, beforeAll } = require( '@jest/globals' );
it,
describe,
beforeAll,
} = require( '@jest/globals' );
const runCartApplyCouponsTest = () => { const runCartApplyCouponsTest = () => {
describe('Cart applying coupons', () => { describe('Cart applying coupons', () => {

View File

@ -5,17 +5,13 @@ const {
shopper, shopper,
withRestApi, withRestApi,
createSimpleProduct, createSimpleProduct,
uiUnblocked uiUnblocked,
} = require( '@woocommerce/e2e-utils' ); } = require( '@woocommerce/e2e-utils' );
/** /**
* External dependencies * External dependencies
*/ */
const { const { it, describe, beforeAll } = require( '@jest/globals' );
it,
describe,
beforeAll,
} = require( '@jest/globals' );
const config = require( 'config' ); const config = require( 'config' );
const simpleProductName = config.get( 'products.simple.name' ); const simpleProductName = config.get( 'products.simple.name' );

View File

@ -3,7 +3,6 @@
*/ */
const { const {
shopper, shopper,
createCoupon,
createSimpleProduct, createSimpleProduct,
uiUnblocked, uiUnblocked,
applyCoupon, applyCoupon,
@ -15,11 +14,7 @@ const { getCouponId, getCouponsTable } = require( '../utils/coupons' );
/** /**
* External dependencies * External dependencies
*/ */
const { const { it, describe, beforeAll } = require( '@jest/globals' );
it,
describe,
beforeAll,
} = require( '@jest/globals' );
const runCheckoutApplyCouponsTest = () => { const runCheckoutApplyCouponsTest = () => {

View File

@ -15,11 +15,7 @@
/** /**
* External dependencies * External dependencies
*/ */
const { const { it, describe, beforeAll } = require( '@jest/globals' );
it,
describe,
beforeAll,
} = require( '@jest/globals' );
const config = require( 'config' ); const config = require( 'config' );
const customerBilling = config.get( 'addresses.customer.billing' ); const customerBilling = config.get( 'addresses.customer.billing' );

View File

@ -13,11 +13,7 @@
/** /**
* External dependencies * External dependencies
*/ */
const { const { it, describe, beforeAll } = require( '@jest/globals' );
it,
describe,
beforeAll,
} = require( '@jest/globals' );
const config = require('config'); const config = require('config');

View File

@ -9,6 +9,11 @@ const {
uiUnblocked, uiUnblocked,
} = require( '@woocommerce/e2e-utils' ); } = require( '@woocommerce/e2e-utils' );
/**
* External dependencies
*/
const { it, describe, beforeAll, afterAll } = require( '@jest/globals' );
const config = require( 'config' ); const config = require( 'config' );
const simpleProductName = config.get( 'products.simple.name' ); const simpleProductName = config.get( 'products.simple.name' );
const singleProductPrice = config.has('products.simple.price') ? config.get('products.simple.price') : '9.99'; const singleProductPrice = config.has('products.simple.price') ? config.get('products.simple.price') : '9.99';

View File

@ -9,6 +9,11 @@ const {
withRestApi, withRestApi,
} = require( '@woocommerce/e2e-utils' ); } = require( '@woocommerce/e2e-utils' );
/**
* External dependencies
*/
const { it, describe, beforeAll, afterAll } = require( '@jest/globals' );
const customerEmailAddress = 'john.doe.test@example.com'; const customerEmailAddress = 'john.doe.test@example.com';
const runMyAccountCreateAccountTest = () => { const runMyAccountCreateAccountTest = () => {

View File

@ -9,6 +9,11 @@ const {
uiUnblocked uiUnblocked
} = require( '@woocommerce/e2e-utils' ); } = require( '@woocommerce/e2e-utils' );
/**
* External dependencies
*/
const { it, describe, beforeAll, afterAll } = require( '@jest/globals' );
let simplePostIdValue; let simplePostIdValue;
let orderNum; let orderNum;
const config = require( 'config' ); const config = require( 'config' );

View File

@ -6,6 +6,11 @@ const {
shopper, shopper,
} = require( '@woocommerce/e2e-utils' ); } = require( '@woocommerce/e2e-utils' );
/**
* External dependencies
*/
const { it, describe } = require( '@jest/globals' );
const pages = [ const pages = [
['Orders', 'my-account/orders', shopper.goToOrders], ['Orders', 'my-account/orders', shopper.goToOrders],
['Downloads', 'my-account/downloads', shopper.goToDownloads], ['Downloads', 'my-account/downloads', shopper.goToDownloads],

View File

@ -10,6 +10,11 @@
deleteAllEmailLogs, deleteAllEmailLogs,
} = require( '@woocommerce/e2e-utils' ); } = require( '@woocommerce/e2e-utils' );
/**
* External dependencies
*/
const { it, describe, beforeAll, afterAll } = require( '@jest/globals' );
let simplePostIdValue; let simplePostIdValue;
let orderId; let orderId;
const config = require( 'config' ); const config = require( 'config' );
@ -17,15 +22,6 @@ const simpleProductName = config.get( 'products.simple.name' );
const customerEmail = config.get( 'addresses.customer.billing.email' ); const customerEmail = config.get( 'addresses.customer.billing.email' );
const storeName = 'WooCommerce Core E2E Test Suite'; const storeName = 'WooCommerce Core E2E Test Suite';
/**
* External dependencies
*/
const {
it,
describe,
beforeAll,
} = require( '@jest/globals' );
const runOrderEmailReceivingTest = () => { const runOrderEmailReceivingTest = () => {
describe('Shopper Order Email Receiving', () => { describe('Shopper Order Email Receiving', () => {
beforeAll(async () => { beforeAll(async () => {

View File

@ -11,11 +11,7 @@ const {
/** /**
* External dependencies * External dependencies
*/ */
const { const { it, beforeAll } = require( '@jest/globals' );
it,
describe,
beforeAll,
} = require( '@jest/globals' );
const config = require( 'config' ); const config = require( 'config' );
const simpleProductName = config.get( 'products.simple.name' ); const simpleProductName = config.get( 'products.simple.name' );

View File

@ -6,9 +6,13 @@ const {
createSimpleProduct, createSimpleProduct,
createVariableProduct, createVariableProduct,
createGroupedProduct, createGroupedProduct,
uiUnblocked uiUnblocked,
} = require( '@woocommerce/e2e-utils' ); } = require( '@woocommerce/e2e-utils' );
/**
* External dependencies
*/
const { it, describe, beforeAll } = require( '@jest/globals' );
const config = require( 'config' ); const config = require( 'config' );
// Variables for simple product // Variables for simple product

View File

@ -2,9 +2,7 @@ import { GroupedProduct } from '@woocommerce/api';
import { Factory } from 'fishery'; import { Factory } from 'fishery';
/** /**
* Creates a new factory for creating variable products. * Creates a new factory for creating grouped products.
* This does not include creating product variations.
* Instead, use `variationFactory()` for that.
* *
* @param {HTTPClient} httpClient The HTTP client we will give the repository. * @param {HTTPClient} httpClient The HTTP client we will give the repository.
* @return {AsyncFactory} The factory for creating models. * @return {AsyncFactory} The factory for creating models.