[e2e tests] Add hpos disabled environment and tag tests (#50448)

This commit is contained in:
Adrian Moldovan 2024-08-13 10:28:21 +01:00 committed by GitHub
parent 49e11aa25b
commit e82f1ea98f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
22 changed files with 545 additions and 488 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
E2E tests: add hpos-disabled env and tagged tests with hpos tag

View File

@ -329,14 +329,8 @@
{ {
"name": "Core e2e tests - HPOS disabled", "name": "Core e2e tests - HPOS disabled",
"testType": "e2e", "testType": "e2e",
"command": "test:e2e", "command": "test:e2e:with-env default-hpos-disabled --project=ui",
"shardingArguments": [ "shardingArguments": [],
"--shard=1/5",
"--shard=2/5",
"--shard=3/5",
"--shard=4/5",
"--shard=5/5"
],
"events": [ "events": [
"daily-checks", "daily-checks",
"release-checks" "release-checks"
@ -349,7 +343,7 @@
} }
}, },
"report": { "report": {
"resultsBlobName": "core-e2e-reports-non-hpos", "resultsBlobName": "core-e2e-reports-hpos-disabled",
"resultsPath": "tests/e2e-pw/test-results", "resultsPath": "tests/e2e-pw/test-results",
"allure": true "allure": true
} }
@ -443,7 +437,7 @@
{ {
"name": "Core API tests - HPOS disabled", "name": "Core API tests - HPOS disabled",
"testType": "api", "testType": "api",
"command": "test:api", "command": "test:e2e:with-env default-hpos-disabled --project=api",
"optional": false, "optional": false,
"changes": [ "changes": [
"client/admin/config/*.json", "client/admin/config/*.json",

View File

@ -0,0 +1,5 @@
#!/bin/bash
set -eo pipefail
echo "Default environment setup."

View File

@ -0,0 +1,20 @@
let config = require( '../../playwright.config.js' );
process.env.USE_WP_ENV = 'true';
process.env.DISABLE_HPOS = '1';
config = {
...config,
projects: [
{
name: 'ui',
grep: /@hpos/,
},
{
name: 'api',
testMatch: '**/api-tests/**',
},
],
};
module.exports = config;

View File

@ -48,7 +48,7 @@ let simpleProductId,
test.describe( test.describe(
'WooCommerce Orders > Add new order', 'WooCommerce Orders > Add new order',
{ tag: '@services' }, { tag: [ '@services', '@hpos' ] },
() => { () => {
test.use( { storageState: process.env.ADMINSTATE } ); test.use( { storageState: process.env.ADMINSTATE } );

View File

@ -7,7 +7,7 @@ const productPrice = '15.99';
test.describe( test.describe(
'WooCommerce Merchant Flow: Orders > Customer Payment Page', 'WooCommerce Merchant Flow: Orders > Customer Payment Page',
{ tag: [ '@payments', '@services' ] }, { tag: [ '@payments', '@services', '@hpos' ] },
() => { () => {
test.use( { storageState: process.env.ADMINSTATE } ); test.use( { storageState: process.env.ADMINSTATE } );

View File

@ -1,7 +1,7 @@
const { test, expect } = require( '@playwright/test' ); const { test, expect } = require( '@playwright/test' );
const wcApi = require( '@woocommerce/woocommerce-rest-api' ).default; const wcApi = require( '@woocommerce/woocommerce-rest-api' ).default;
test.describe( 'Bulk edit orders', { tag: '@services' }, () => { test.describe( 'Bulk edit orders', { tag: [ '@services', '@hpos' ] }, () => {
test.use( { storageState: process.env.ADMINSTATE } ); test.use( { storageState: process.env.ADMINSTATE } );
let orderId1, orderId2, orderId3, orderId4, orderId5; let orderId1, orderId2, orderId3, orderId4, orderId5;

View File

@ -11,7 +11,7 @@ const discountedPrice = ( productPrice - couponAmount ).toString();
test.describe( test.describe(
'WooCommerce Orders > Apply Coupon', 'WooCommerce Orders > Apply Coupon',
{ tag: '@services' }, { tag: [ '@services', '@hpos' ] },
() => { () => {
test.use( { storageState: process.env.ADMINSTATE } ); test.use( { storageState: process.env.ADMINSTATE } );

View File

@ -2,7 +2,7 @@ const { test, expect } = require( '@playwright/test' );
const wcApi = require( '@woocommerce/woocommerce-rest-api' ).default; const wcApi = require( '@woocommerce/woocommerce-rest-api' ).default;
const uuid = require( 'uuid' ); const uuid = require( 'uuid' );
test.describe( 'Edit order', { tag: '@services' }, () => { test.describe( 'Edit order', { tag: [ '@services', '@hpos' ] }, () => {
test.use( { storageState: process.env.ADMINSTATE } ); test.use( { storageState: process.env.ADMINSTATE } );
let orderId, orderToCancel; let orderId, orderToCancel;
@ -286,7 +286,7 @@ test.describe( 'Edit order', { tag: '@services' }, () => {
test.describe( test.describe(
'Edit order > Downloadable product permissions', 'Edit order > Downloadable product permissions',
{ tag: '@services' }, { tag: [ '@services', '@hpos' ] },
() => { () => {
test.use( { storageState: process.env.ADMINSTATE } ); test.use( { storageState: process.env.ADMINSTATE } );

View File

@ -5,7 +5,7 @@ const wcApi = require( '@woocommerce/woocommerce-rest-api' ).default;
test.describe( test.describe(
'Merchant > Order Action emails received', 'Merchant > Order Action emails received',
{ tag: '@services' }, { tag: [ '@services', '@hpos' ] },
() => { () => {
test.use( { storageState: process.env.ADMINSTATE } ); test.use( { storageState: process.env.ADMINSTATE } );

View File

@ -3,7 +3,7 @@ const wcApi = require( '@woocommerce/woocommerce-rest-api' ).default;
test.describe.serial( test.describe.serial(
'WooCommerce Orders > Refund an order', 'WooCommerce Orders > Refund an order',
{ tag: '@payments' }, { tag: [ '@payments', '@hpos' ] },
() => { () => {
let productId, orderId, currencySymbol; let productId, orderId, currencySymbol;
@ -147,7 +147,7 @@ test.describe.serial(
test.describe( test.describe(
'WooCommerce Orders > Refund and restock an order item', 'WooCommerce Orders > Refund and restock an order item',
{ tag: [ '@payments', '@services' ] }, { tag: [ '@payments', '@services', '@hpos' ] },
() => { () => {
let productWithStockId, productWithNoStockId, orderId; let productWithStockId, productWithNoStockId, orderId;

View File

@ -71,7 +71,7 @@ const deleteCustomer = async ( api ) => {
test.describe( test.describe(
'WooCommerce Orders > Search orders', 'WooCommerce Orders > Search orders',
{ tag: '@services' }, { tag: [ '@services', '@hpos' ] },
() => { () => {
test.use( { storageState: process.env.ADMINSTATE } ); test.use( { storageState: process.env.ADMINSTATE } );

View File

@ -17,7 +17,7 @@ const orderStatus = [
test.describe( test.describe(
'WooCommerce Orders > Filter Order by Status', 'WooCommerce Orders > Filter Order by Status',
{ tag: '@services' }, { tag: [ '@services', '@hpos' ] },
() => { () => {
test.use( { storageState: process.env.ADMINSTATE } ); test.use( { storageState: process.env.ADMINSTATE } );

View File

@ -38,7 +38,7 @@ let productId,
test.describe( test.describe(
'Shopper Cart & Checkout Block Tax Display', 'Shopper Cart & Checkout Block Tax Display',
{ tag: [ '@payments', '@services' ] }, { tag: [ '@payments', '@services', '@hpos' ] },
() => { () => {
test.use( { storageState: process.env.ADMINSTATE } ); test.use( { storageState: process.env.ADMINSTATE } );
test.beforeAll( async ( { baseURL } ) => { test.beforeAll( async ( { baseURL } ) => {

View File

@ -24,7 +24,7 @@ let productId,
test.describe.serial( test.describe.serial(
'Tax rates in the cart and checkout', 'Tax rates in the cart and checkout',
{ tag: [ '@payments', '@services' ] }, { tag: [ '@payments', '@services', '@hpos' ] },
() => { () => {
test.beforeAll( async ( { baseURL } ) => { test.beforeAll( async ( { baseURL } ) => {
const api = new wcApi( { const api = new wcApi( {

View File

@ -26,7 +26,7 @@ const totals = [ '$15.00', '$10.00', '$13.00' ];
test.describe( test.describe(
'Cart & Checkout applying coupons', 'Cart & Checkout applying coupons',
{ tag: [ '@payments', '@services' ] }, { tag: [ '@payments', '@services', '@hpos' ] },
() => { () => {
let firstProductId; let firstProductId;
const couponBatchId = []; const couponBatchId = [];

View File

@ -10,7 +10,7 @@ const excludedCategoryName = 'Excluded Category';
test.describe( test.describe(
'Cart & Checkout Restricted Coupons', 'Cart & Checkout Restricted Coupons',
{ tag: [ '@payments', '@services' ] }, { tag: [ '@payments', '@services', '@hpos' ] },
() => { () => {
let firstProductId, let firstProductId,
secondProductId, secondProductId,

View File

@ -57,7 +57,7 @@ const test = baseTest.extend( {
test.describe( test.describe(
'Checkout Block page', 'Checkout Block page',
{ tag: [ '@payments', '@services' ] }, { tag: [ '@payments', '@services', '@hpos' ] },
() => { () => {
test.beforeAll( async ( { baseURL } ) => { test.beforeAll( async ( { baseURL } ) => {
const api = new wcApi( { const api = new wcApi( {

View File

@ -24,7 +24,7 @@ const customer = {
test.describe( test.describe(
'Shopper Checkout Login Account', 'Shopper Checkout Login Account',
{ tag: [ '@payments', '@services' ] }, { tag: [ '@payments', '@services', '@hpos' ] },
() => { () => {
let productId, orderId, shippingZoneId, customerId; let productId, orderId, shippingZoneId, customerId;

View File

@ -10,7 +10,7 @@ const customer = {
test.describe( test.describe(
'Customer can pay for their order through My Account', 'Customer can pay for their order through My Account',
{ tag: [ '@payments', '@services' ] }, { tag: [ '@payments', '@services', '@hpos' ] },
() => { () => {
let productId, orderId; let productId, orderId;

View File

@ -22,7 +22,7 @@ const storeName = 'WooCommerce Core E2E Test Suite';
test.describe( test.describe(
'Shopper Order Email Receiving', 'Shopper Order Email Receiving',
{ tag: [ '@payments', '@services' ] }, { tag: [ '@payments', '@services', '@hpos' ] },
() => { () => {
test.use( { storageState: process.env.ADMINSTATE } ); test.use( { storageState: process.env.ADMINSTATE } );