From 7091ac3d9a622e752537728d7998b42ccc680e01 Mon Sep 17 00:00:00 2001 From: Jon Lane Date: Fri, 6 Oct 2023 13:51:30 -0700 Subject: [PATCH] =?UTF-8?q?Skips=20tests=20as=20they=E2=80=99re=20only=20d?= =?UTF-8?q?esigned=20to=20run=20in=20wp-env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/customize-store/assembler-hub.spec.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugins/woocommerce/tests/e2e-pw/tests/customize-store/assembler-hub.spec.js b/plugins/woocommerce/tests/e2e-pw/tests/customize-store/assembler-hub.spec.js index d7b6a6a18c8..563edf98c49 100644 --- a/plugins/woocommerce/tests/e2e-pw/tests/customize-store/assembler-hub.spec.js +++ b/plugins/woocommerce/tests/e2e-pw/tests/customize-store/assembler-hub.spec.js @@ -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 } );