Revert "[e2e tests blocks] Configure the number of shards for each ma… (#45324)

* Revert "[e2e tests blocks] Configure the number of shards for each matrix project (#45212)"

This reverts commit 72789656cf.

* trigger CI

* run E2E tests

* restore ci.yml file

* trigger E2E tests

* disable E2E tests about mini cart translations

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

* Fix the setupAndFetchQueryContextURL utility

* add comment

* Remove obsolete test

* Blocks E2E: Update timeout values (#45353)

Set timeout values same as core

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>
This commit is contained in:
Luigi Teschio 2024-03-06 17:52:37 +01:00 committed by GitHub
parent 56d087f536
commit 26c19fa1f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 30 additions and 58 deletions

View File

@ -6,7 +6,6 @@ on:
- 'plugins/woocommerce/src/Blocks/**'
- 'plugins/woocommerce/templates/**'
- 'plugins/woocommerce/patterns/**'
- '.github/workflows/blocks-playwright.yml'
env:
FORCE_COLOR: 1
@ -26,35 +25,21 @@ jobs:
- name: Normal
file: playwright.config.ts
resultPath: test-results
shard: 1/3
- name: Normal
file: playwright.config.ts
resultPath: test-results
shard: 2/3
- name: Normal
file: playwright.config.ts
resultPath: test-results
shard: 3/3
- name: Classic
file: playwright.classic-theme.config.ts
resultPath: test-results-classic-theme
shard: 1/1
- name: SideEffects
file: playwright.side-effects.config.ts
resultPath: test-results-side-effects
shard: 1/3
- name: SideEffects
file: playwright.side-effects.config.ts
resultPath: test-results-side-effects
shard: 2/3
- name: SideEffects
file: playwright.side-effects.config.ts
resultPath: test-results-side-effects
shard: 3/3
- name: BlockThemeWithTemplates
file: playwright.block-theme-with-templates.config.ts
resultPath: test-results-block-theme-with-templates
shard: 1/1
shards:
- name: 1/5
- name: 2/5
- name: 3/5
- name: 4/5
- name: 5/5
steps:
- uses: actions/checkout@v3
@ -72,7 +57,7 @@ jobs:
- name: Run Playwright tests
working-directory: plugins/woocommerce-blocks
run: pnpm playwright test --config=tests/e2e/${{ matrix.config.file }} --shard ${{ matrix.config.shard }}
run: pnpm playwright test --config=tests/e2e/${{ matrix.config.file }} --shard ${{ matrix.shards.name }}
- uses: actions/upload-artifact@v3
if: ${{ failure() }}

View File

@ -17,10 +17,7 @@ interface ExtendedPlaywrightTestConfig extends PlaywrightTestConfig {
const { CI, DEFAULT_TIMEOUT_OVERRIDE, E2E_MAX_FAILURES } = process.env;
const config: ExtendedPlaywrightTestConfig = {
timeout: DEFAULT_TIMEOUT_OVERRIDE
? Number( DEFAULT_TIMEOUT_OVERRIDE )
: 90 * 1000,
expect: { timeout: 20 * 1000 },
timeout: parseInt( DEFAULT_TIMEOUT_OVERRIDE || '', 10 ) || 100_000, // Defaults to 100s.
outputDir: 'artifacts/test-results',
globalSetup: fileURLToPath(
new URL( 'global-setup.ts', 'file:' + __filename ).href
@ -43,6 +40,7 @@ const config: ExtendedPlaywrightTestConfig = {
video: 'on-first-retry',
viewport: { width: 1280, height: 720 },
storageState: STORAGE_STATE_PATH,
actionTimeout: 10_000,
},
projects: [
{

View File

@ -22,7 +22,9 @@ test.describe( 'Shopper → Translations', () => {
);
} );
test( 'User can see translation in empty Mini-Cart', async ( {
// For more details: https://github.com/woocommerce/woocommerce/issues/45346
// eslint-disable-next-line playwright/no-skipped-test
test.skip( 'User can see translation in empty Mini-Cart', async ( {
page,
frontendUtils,
miniCartUtils,

View File

@ -941,26 +941,6 @@ test.describe( 'Product Collection', () => {
} );
test.describe( 'Query Context in Editor', () => {
test( 'Product Catalog: Sends only ID in Query Context', async ( {
pageObject,
} ) => {
const url = await pageObject.setupAndFetchQueryContextURL( {
collection: 'productCatalog',
} );
expect(
url.searchParams.has( 'productCollectionQueryContext[id]' )
).toBeTruthy();
// There shouldn't be collection in the query context
// Because Product Catalog isn't a collection
expect(
url.searchParams.has(
'productCollectionQueryContext[collection]'
)
).toBeFalsy();
} );
test( 'Collections: collection should be present in query context', async ( {
pageObject,
} ) => {

View File

@ -141,20 +141,23 @@ class ProductCollectionPage {
await this.admin.createNewPost();
await this.editorUtils.closeWelcomeGuideModal();
await this.insertProductCollection();
await this.chooseCollectionInPost( collection );
// Wait for response with productCollectionQueryContext query parameter.
const WP_PRODUCT_ENDPOINT = '/wp/v2/product';
const QUERY_CONTEXT_PARAM = 'productCollectionQueryContext';
const response = await this.page.waitForResponse(
( currentResponse ) =>
currentResponse.url().includes( WP_PRODUCT_ENDPOINT ) &&
currentResponse.url().includes( QUERY_CONTEXT_PARAM ) &&
currentResponse.status() === 200
const productResponsePromise = this.page.waitForResponse(
( response ) => {
return (
response.url().includes( '/wp/v2/product' ) &&
response
.url()
.includes( 'productCollectionQueryContext' ) &&
response.status() === 200
);
}
);
const url = new URL( response.url() );
return url;
await this.chooseCollectionInPost( collection );
const productResponse = await productResponsePromise;
return new URL( productResponse.url() );
}
async publishAndGoToFrontend() {

View File

@ -0,0 +1,4 @@
Significance: patch
Type: dev
Comment: Revert "[e2e tests blocks] Configure the number of shards for each matrix project"