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:
parent
56d087f536
commit
26c19fa1f8
|
@ -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() }}
|
||||
|
|
|
@ -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: [
|
||||
{
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
} ) => {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: dev
|
||||
Comment: Revert "[e2e tests blocks] Configure the number of shards for each matrix project"
|
||||
|
Loading…
Reference in New Issue