[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",
"testType": "e2e",
"command": "test:e2e",
"shardingArguments": [
"--shard=1/5",
"--shard=2/5",
"--shard=3/5",
"--shard=4/5",
"--shard=5/5"
],
"command": "test:e2e:with-env default-hpos-disabled --project=ui",
"shardingArguments": [],
"events": [
"daily-checks",
"release-checks"
@ -349,7 +343,7 @@
}
},
"report": {
"resultsBlobName": "core-e2e-reports-non-hpos",
"resultsBlobName": "core-e2e-reports-hpos-disabled",
"resultsPath": "tests/e2e-pw/test-results",
"allure": true
}
@ -443,7 +437,7 @@
{
"name": "Core API tests - HPOS disabled",
"testType": "api",
"command": "test:api",
"command": "test:e2e:with-env default-hpos-disabled --project=api",
"optional": false,
"changes": [
"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(
'WooCommerce Orders > Add new order',
{ tag: '@services' },
{ tag: [ '@services', '@hpos' ] },
() => {
test.use( { storageState: process.env.ADMINSTATE } );

View File

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

View File

@ -1,7 +1,7 @@
const { test, expect } = require( '@playwright/test' );
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 } );
let orderId1, orderId2, orderId3, orderId4, orderId5;

View File

@ -11,7 +11,7 @@ const discountedPrice = ( productPrice - couponAmount ).toString();
test.describe(
'WooCommerce Orders > Apply Coupon',
{ tag: '@services' },
{ tag: [ '@services', '@hpos' ] },
() => {
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 uuid = require( 'uuid' );
test.describe( 'Edit order', { tag: '@services' }, () => {
test.describe( 'Edit order', { tag: [ '@services', '@hpos' ] }, () => {
test.use( { storageState: process.env.ADMINSTATE } );
let orderId, orderToCancel;
@ -286,7 +286,7 @@ test.describe( 'Edit order', { tag: '@services' }, () => {
test.describe(
'Edit order > Downloadable product permissions',
{ tag: '@services' },
{ tag: [ '@services', '@hpos' ] },
() => {
test.use( { storageState: process.env.ADMINSTATE } );

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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