Remove core-profiler checks from the tests (#40260)

* Remove core-profiler check

* Fix broken test

* Skip onboarding wizard tests

* Add changefile(s) from automation for the following project(s): woocommerce

* Change to trigger GH jobs

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Moon 2023-09-19 12:14:50 -07:00 committed by GitHub
parent b1cb7c9f3d
commit 35ed71f6ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 46 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: update
Remove core-profiler checks from the tests -- core profiler is enabled by default now.

View File

@ -3,13 +3,9 @@ const { onboarding } = require( '../../utils' );
const { storeDetails } = require( '../../test-data/data' );
const { api } = require( '../../utils' );
const { features } = require( '../../utils' );
const { describe } = require('node:test');
// Skipping Onbaording tests when the core-profiler is enabled.
const testRunner = features.is_enabled( 'core-profiler' )
? test.describe.skip
: test.describe;
testRunner( 'Store owner can complete onboarding wizard', () => {
test.skip( 'Store owner can complete onboarding wizard', () => {
test.use( { storageState: process.env.ADMINSTATE } );
test.beforeEach( async () => {
@ -162,7 +158,7 @@ testRunner( 'Store owner can complete onboarding wizard', () => {
// Skipping Onbaording tests as we're replacing StoreDetails with Core Profiler
// !Changed from Japanese to Liberian store, as Japanese Yen does not use decimals
testRunner(
test.skip(
'A Liberian store can complete the selective bundle install but does not include WCPay.',
() => {
test.use( { storageState: process.env.ADMINSTATE } );
@ -257,7 +253,7 @@ testRunner(
);
// Skipping this test because it's very flaky.
testRunner( 'Store owner can go through setup Task List', () => {
test.skip( 'Store owner can go through setup Task List', () => {
test.use( { storageState: process.env.ADMINSTATE } );
test.beforeEach( async ( { page } ) => {

View File

@ -6,25 +6,14 @@ test.describe( 'Payment setup task', () => {
test.use( { storageState: process.env.ADMINSTATE } );
test.beforeEach( async ( { page, baseURL } ) => {
// Skip skipping the setup wizard if the core profiler is enabled.
// When the core-profiler is enabled, the following code won't work, causing the tests to fail.
if ( ! features.is_enabled( 'core-profiler' ) ) {
await page.goto(
'wp-admin/admin.php?page=wc-admin&path=/setup-wizard'
);
await page.locator( 'text=Skip setup store details' ).click();
await page.locator( 'button >> text=No thanks' ).click();
await page.waitForLoadState( 'networkidle' );
} else {
await new wcApi( {
url: baseURL,
consumerKey: process.env.CONSUMER_KEY,
consumerSecret: process.env.CONSUMER_SECRET,
version: 'wc-admin',
} ).post( 'onboarding/profile', {
skipped: true,
} );
}
await new wcApi( {
url: baseURL,
consumerKey: process.env.CONSUMER_KEY,
consumerSecret: process.env.CONSUMER_SECRET,
version: 'wc-admin',
} ).post( 'onboarding/profile', {
skipped: true,
} );
} );
test.afterAll( async ( { baseURL } ) => {

View File

@ -122,27 +122,23 @@ for ( const currentPage of wcPages ) {
test.use( { storageState: process.env.ADMINSTATE } );
test.beforeAll( async ( { baseURL } ) => {
const coreProfilerEnabled = features.is_enabled( 'core-profiler' );
const response = await new wcApi( {
url: baseURL,
consumerKey: process.env.CONSUMER_KEY,
consumerSecret: process.env.CONSUMER_SECRET,
version: 'wc-admin',
} ).post( 'onboarding/profile', {
skipped: true,
} );
if ( coreProfilerEnabled ) {
const response = await new wcApi( {
url: baseURL,
consumerKey: process.env.CONSUMER_KEY,
consumerSecret: process.env.CONSUMER_SECRET,
version: 'wc-admin',
} ).post( 'onboarding/profile', {
skipped: true,
} );
const httpStatus = response.status;
const { status, message } = response.data;
const httpStatus = response.status;
const { status, message } = response.data;
expect( httpStatus ).toEqual( 200 );
expect( status ).toEqual( 'success' );
expect( message ).toEqual(
'Onboarding profile data has been updated.'
);
}
expect( httpStatus ).toEqual( 200 );
expect( status ).toEqual( 'success' );
expect( message ).toEqual(
'Onboarding profile data has been updated.'
);
const api = new wcApi( {
url: baseURL,
consumerKey: process.env.CONSUMER_KEY,