Skips tests as they’re only designed to run in wp-env

This commit is contained in:
Jon Lane 2023-10-06 13:51:30 -07:00
parent a918e79093
commit 7091ac3d9a
1 changed files with 17 additions and 0 deletions

View File

@ -1,4 +1,5 @@
const { test, expect, request } = require( '@playwright/test' );
const { BASE_URL } = process.env;
const { features } = require( '../../utils' );
const { activateTheme } = require( '../../utils/themes' );
const { setOption } = require( '../../utils/options' );
@ -6,6 +7,22 @@ const { setOption } = require( '../../utils/options' );
const ASSEMBLER_HUB_URL =
'/wp-admin/admin.php?page=wc-admin&path=%2Fcustomize-store%2Fassembler-hub';
const skipTestIfUndefined = () => {
const skipMessage = `Skipping this test on daily run. Environment not compatible.`;
test.skip( () => {
const shouldSkip = BASE_URL != undefined;
if ( shouldSkip ) {
console.log( skipMessage );
}
return shouldSkip;
}, skipMessage );
};
skipTestIfUndefined();
test.describe( 'Store owner can view Assembler Hub for store customization', () => {
test.use( { storageState: process.env.ADMINSTATE } );