Skip to content

Commit

Permalink
chore: slow operations on deep tests
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Dec 13, 2024
1 parent f8ea2f2 commit ddceed0
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 22 deletions.
1 change: 0 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ jobs:
needs: [build-demo]
strategy:
fail-fast: false
max-parallel: 9
matrix:
shard: [
# Safari
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ test.describe('InputDate and mobile user agent', () => {
.click();

await page.waitForSelector('tui-mobile-calendar-dropdown', {state: 'visible'});
await page.waitForTimeout(300); // safari flaky

await expect(page).toHaveScreenshot('01-input-date-range-mobile-1.png');

Expand Down Expand Up @@ -49,6 +50,7 @@ test.describe('InputDate and mobile user agent', () => {
.click();

await page.waitForSelector('tui-mobile-calendar-dropdown', {state: 'visible'});
await page.waitForTimeout(300); // safari flaky

await expect(page).toHaveScreenshot('02-input-date-range-mobile-1.png');

Expand Down Expand Up @@ -84,6 +86,7 @@ test.describe('InputDate and mobile user agent', () => {
.click();

await page.waitForSelector('tui-mobile-calendar-dropdown', {state: 'visible'});
await page.waitForTimeout(300); // safari flaky

await expect(page).toHaveScreenshot('03-input-date-range-mobile-1.png');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ test.describe('Dropdown', () => {

await example.scrollIntoViewIfNeeded();
await example.locator('button').click();
await page.waitForTimeout(300);

await expect(page).toHaveScreenshot('01-dropdown.png');
});
Expand All @@ -21,6 +22,7 @@ test.describe('Dropdown', () => {

await example.scrollIntoViewIfNeeded();
await example.locator('input').click();
await page.waitForTimeout(300);

await expect(page).toHaveScreenshot('02-dropdown.png');
});
Expand All @@ -31,6 +33,7 @@ test.describe('Dropdown', () => {

await example.scrollIntoViewIfNeeded();
await example.locator('input').click();
await page.waitForTimeout(300);

await expect(page).toHaveScreenshot('03-dropdown.png');
});
Expand All @@ -41,6 +44,7 @@ test.describe('Dropdown', () => {

await example.scrollIntoViewIfNeeded();
await example.locator('button').click();
await page.waitForTimeout(300);

await expect(page).toHaveScreenshot('04-dropdown.png');
});
Expand All @@ -51,6 +55,7 @@ test.describe('Dropdown', () => {

await example.scrollIntoViewIfNeeded();
await example.locator('button').click();
await page.waitForTimeout(300);

await expect(page).toHaveScreenshot('05-dropdown.png');
});
Expand All @@ -60,7 +65,9 @@ test.describe('Dropdown', () => {
const example = new TuiDocumentationPagePO(page).getExample('#portal');

await example.scrollIntoViewIfNeeded();
// eslint-disable-next-line playwright/no-force-option
await example.locator('.t2').click({force: true});
await page.waitForTimeout(300);

await expect(page).toHaveScreenshot('13-dropdown.png');
});
Expand Down Expand Up @@ -123,6 +130,7 @@ test.describe('Dropdown', () => {

await example.scrollIntoViewIfNeeded();
await example.locator('button').click();
await page.waitForTimeout(300);

expect(page.locator('tui-dropdown')).toBeDefined();

Expand Down
6 changes: 2 additions & 4 deletions projects/demo-playwright/tests/deep/deep-select.pw.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ test.describe('Deep / Select', () => {
await expect(select).toBeVisible();

await select.click();
await api.waitTuiIcons();

const options = await api.getOptions();

Expand All @@ -47,14 +46,13 @@ test.describe('Deep / Select', () => {
await api.focusOnBody();
await api.hideNotifications();
await api.waitStableState();
await api.waitTuiIcons();
await page.waitForTimeout(300);

await expect(api.apiPageExample).toHaveScreenshot(

Check failure on line 51 in projects/demo-playwright/tests/deep/deep-select.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / macos-latest / 3 of 9

[webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/input-month

1) [webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/input-month ── Error: expect(locator).toHaveScreenshot(expected) 581 pixels (ratio 0.01 of all image pixels) are different. Expected: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/snapshots/tests/deep/deep-select.pw.spec.ts-snapshots/deep--components-input-month--style-text-align--row—23-select-option-1-webkit-darwin.png Received: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw-Deep-Select-components-input-month-webkit/deep--components-input-mon-62bf8--row—23-select-option-1-actual.png Diff: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw-Deep-Select-components-input-month-webkit/deep--components-input-mon-62bf8--row—23-select-option-1-diff.png Call log: - expect.toHaveScreenshot(deep-/components/input-month-[style.text-align]-row—23-select-option-1.png) with timeout 5000ms - verifying given screenshot expectation - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 581 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - 581 pixels (ratio 0.01 of all image pixels) are different. 49 | await page.waitForTimeout(300); 50 | > 51 | await expect(api.apiPageExample).toHaveScreenshot( | ^ 52 | `deep-${path}-${name}-row—${rowIndex}-select-option-${index}.png`, 53 | ); 54 | at /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/deep/deep-select.pw.spec.ts:51:54

Check failure on line 51 in projects/demo-playwright/tests/deep/deep-select.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / macos-latest / 3 of 9

[webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/input-month

1) [webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/input-month ── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toHaveScreenshot(expected) 581 pixels (ratio 0.01 of all image pixels) are different. Expected: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/snapshots/tests/deep/deep-select.pw.spec.ts-snapshots/deep--components-input-month--style-text-align--row—23-select-option-1-webkit-darwin.png Received: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw-Deep-Select-components-input-month-webkit-retry1/deep--components-input-mon-62bf8--row—23-select-option-1-actual.png Diff: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw-Deep-Select-components-input-month-webkit-retry1/deep--components-input-mon-62bf8--row—23-select-option-1-diff.png Call log: - expect.toHaveScreenshot(deep-/components/input-month-[style.text-align]-row—23-select-option-1.png) with timeout 5000ms - verifying given screenshot expectation - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 581 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - 581 pixels (ratio 0.01 of all image pixels) are different. 49 | await page.waitForTimeout(300); 50 | > 51 | await expect(api.apiPageExample).toHaveScreenshot( | ^ 52 | `deep-${path}-${name}-row—${rowIndex}-select-option-${index}.png`, 53 | ); 54 | at /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/deep/deep-select.pw.spec.ts:51:54

Check failure on line 51 in projects/demo-playwright/tests/deep/deep-select.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / macos-latest / 3 of 9

[webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/input-month

1) [webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/input-month ── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toHaveScreenshot(expected) 581 pixels (ratio 0.01 of all image pixels) are different. Expected: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/snapshots/tests/deep/deep-select.pw.spec.ts-snapshots/deep--components-input-month--style-text-align--row—23-select-option-1-webkit-darwin.png Received: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw-Deep-Select-components-input-month-webkit-retry2/deep--components-input-mon-62bf8--row—23-select-option-1-actual.png Diff: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw-Deep-Select-components-input-month-webkit-retry2/deep--components-input-mon-62bf8--row—23-select-option-1-diff.png Call log: - expect.toHaveScreenshot(deep-/components/input-month-[style.text-align]-row—23-select-option-1.png) with timeout 5000ms - verifying given screenshot expectation - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 581 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - 581 pixels (ratio 0.01 of all image pixels) are different. 49 | await page.waitForTimeout(300); 50 | > 51 | await expect(api.apiPageExample).toHaveScreenshot( | ^ 52 | `deep-${path}-${name}-row—${rowIndex}-select-option-${index}.png`, 53 | ); 54 | at /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/deep/deep-select.pw.spec.ts:51:54

Check failure on line 51 in projects/demo-playwright/tests/deep/deep-select.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / macos-latest / 3 of 9

[webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/input-month-range

2) [webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/input-month-range Error: expect(locator).toHaveScreenshot(expected) Expected an image 1356px by 192px, received 1356px by 216px. 31317 pixels (ratio 0.11 of all image pixels) are different. Expected: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/snapshots/tests/deep/deep-select.pw.spec.ts-snapshots/deep--components-input-month-range--tuiTextfieldSize--row—12-select-option-2-webkit-darwin.png Received: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw--67016-omponents-input-month-range-webkit/deep--components-input-mon-dc834--row—12-select-option-2-actual.png Diff: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw--67016-omponents-input-month-range-webkit/deep--components-input-mon-dc834--row—12-select-option-2-diff.png Call log: - expect.toHaveScreenshot(deep-/components/input-month-range-[tuiTextfieldSize]-row—12-select-option-2.png) with timeout 5000ms - verifying given screenshot expectation - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - Expected an image 1356px by 192px, received 1356px by 216px. 31317 pixels (ratio 0.11 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - Expected an image 1356px by 192px, received 1356px by 216px. 31317 pixels (ratio 0.11 of all image pixels) are different. 49 | await page.waitForTimeout(300); 50 | > 51 | await expect(api.apiPageExample).toHaveScreenshot( | ^ 52 | `deep-${path}-${name}-row—${rowIndex}-select-option-${index}.png`, 53 | ); 54 | at /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/deep/deep-select.pw.spec.ts:51:54

Check failure on line 51 in projects/demo-playwright/tests/deep/deep-select.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / macos-latest / 3 of 9

[webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/input-month-range

2) [webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/input-month-range Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toHaveScreenshot(expected) Expected an image 1356px by 192px, received 1356px by 216px. 31317 pixels (ratio 0.11 of all image pixels) are different. Expected: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/snapshots/tests/deep/deep-select.pw.spec.ts-snapshots/deep--components-input-month-range--tuiTextfieldSize--row—12-select-option-2-webkit-darwin.png Received: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw--67016-omponents-input-month-range-webkit-retry1/deep--components-input-mon-dc834--row—12-select-option-2-actual.png Diff: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw--67016-omponents-input-month-range-webkit-retry1/deep--components-input-mon-dc834--row—12-select-option-2-diff.png Call log: - expect.toHaveScreenshot(deep-/components/input-month-range-[tuiTextfieldSize]-row—12-select-option-2.png) with timeout 5000ms - verifying given screenshot expectation - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - Expected an image 1356px by 192px, received 1356px by 216px. 31317 pixels (ratio 0.11 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - Expected an image 1356px by 192px, received 1356px by 216px. 31317 pixels (ratio 0.11 of all image pixels) are different. 49 | await page.waitForTimeout(300); 50 | > 51 | await expect(api.apiPageExample).toHaveScreenshot( | ^ 52 | `deep-${path}-${name}-row—${rowIndex}-select-option-${index}.png`, 53 | ); 54 | at /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/deep/deep-select.pw.spec.ts:51:54

Check failure on line 51 in projects/demo-playwright/tests/deep/deep-select.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / macos-latest / 3 of 9

[webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/input-month-range

2) [webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/input-month-range Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toHaveScreenshot(expected) Expected an image 1356px by 192px, received 1356px by 216px. 31317 pixels (ratio 0.11 of all image pixels) are different. Expected: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/snapshots/tests/deep/deep-select.pw.spec.ts-snapshots/deep--components-input-month-range--tuiTextfieldSize--row—12-select-option-2-webkit-darwin.png Received: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw--67016-omponents-input-month-range-webkit-retry2/deep--components-input-mon-dc834--row—12-select-option-2-actual.png Diff: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw--67016-omponents-input-month-range-webkit-retry2/deep--components-input-mon-dc834--row—12-select-option-2-diff.png Call log: - expect.toHaveScreenshot(deep-/components/input-month-range-[tuiTextfieldSize]-row—12-select-option-2.png) with timeout 5000ms - verifying given screenshot expectation - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - Expected an image 1356px by 192px, received 1356px by 216px. 31317 pixels (ratio 0.11 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - Expected an image 1356px by 192px, received 1356px by 216px. 31317 pixels (ratio 0.11 of all image pixels) are different. 49 | await page.waitForTimeout(300); 50 | > 51 | await expect(api.apiPageExample).toHaveScreenshot( | ^ 52 | `deep-${path}-${name}-row—${rowIndex}-select-option-${index}.png`, 53 | ); 54 | at /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/deep/deep-select.pw.spec.ts:51:54

Check failure on line 51 in projects/demo-playwright/tests/deep/deep-select.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / macos-latest / 3 of 9

[webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/input-time

3) [webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/input-time ─── Error: expect(locator).toHaveScreenshot(expected) 5558 pixels (ratio 0.03 of all image pixels) are different. Expected: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/snapshots/tests/deep/deep-select.pw.spec.ts-snapshots/deep--components-input-time--pseudoInvalid--row—18-select-option-1-webkit-darwin.png Received: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw-Deep-Select-components-input-time-webkit/deep--components-input-tim-4adb2--row—18-select-option-1-actual.png Diff: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw-Deep-Select-components-input-time-webkit/deep--components-input-tim-4adb2--row—18-select-option-1-diff.png Call log: - expect.toHaveScreenshot(deep-/components/input-time-[pseudoInvalid]-row—18-select-option-1.png) with timeout 5000ms - verifying given screenshot expectation - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 5558 pixels (ratio 0.03 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - 5558 pixels (ratio 0.03 of all image pixels) are different. 49 | await page.waitForTimeout(300); 50 | > 51 | await expect(api.apiPageExample).toHaveScreenshot( | ^ 52 | `deep-${path}-${name}-row—${rowIndex}-select-option-${index}.png`, 53 | ); 54 | at /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/deep/deep-select.pw.spec.ts:51:54

Check failure on line 51 in projects/demo-playwright/tests/deep/deep-select.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / macos-latest / 3 of 9

[webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/input-time

3) [webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/input-time ─── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toHaveScreenshot(expected) 5558 pixels (ratio 0.03 of all image pixels) are different. Expected: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/snapshots/tests/deep/deep-select.pw.spec.ts-snapshots/deep--components-input-time--pseudoInvalid--row—18-select-option-1-webkit-darwin.png Received: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw-Deep-Select-components-input-time-webkit-retry1/deep--components-input-tim-4adb2--row—18-select-option-1-actual.png Diff: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw-Deep-Select-components-input-time-webkit-retry1/deep--components-input-tim-4adb2--row—18-select-option-1-diff.png Call log: - expect.toHaveScreenshot(deep-/components/input-time-[pseudoInvalid]-row—18-select-option-1.png) with timeout 5000ms - verifying given screenshot expectation - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 5558 pixels (ratio 0.03 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - 5558 pixels (ratio 0.03 of all image pixels) are different. 49 | await page.waitForTimeout(300); 50 | > 51 | await expect(api.apiPageExample).toHaveScreenshot( | ^ 52 | `deep-${path}-${name}-row—${rowIndex}-select-option-${index}.png`, 53 | ); 54 | at /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/deep/deep-select.pw.spec.ts:51:54

Check failure on line 51 in projects/demo-playwright/tests/deep/deep-select.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / macos-latest / 3 of 9

[webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/input-time

3) [webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/input-time ─── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator).toHaveScreenshot(expected) 301 pixels (ratio 0.01 of all image pixels) are different. Expected: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/snapshots/tests/deep/deep-select.pw.spec.ts-snapshots/deep--components-input-time--tuiHintContent--row—7-select-option-1-webkit-darwin.png Received: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw-Deep-Select-components-input-time-webkit-retry2/deep--components-input-tim-4c9d9---row—7-select-option-1-actual.png Diff: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw-Deep-Select-components-input-time-webkit-retry2/deep--components-input-tim-4c9d9---row—7-select-option-1-diff.png Call log: - expect.toHaveScreenshot(deep-/components/input-time-[tuiHintContent]-row—7-select-option-1.png) with timeout 5000ms - verifying given screenshot expectation - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 301 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - 301 pixels (ratio 0.01 of all image pixels) are different. 49 | await page.waitForTimeout(300); 50 | > 51 | await expect(api.apiPageExample).toHaveScreenshot( | ^ 52 | `deep-${path}-${name}-row—${rowIndex}-select-option-${index}.png`, 53 | ); 54 | at /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/deep/deep-select.pw.spec.ts:51:54

Check failure on line 51 in projects/demo-playwright/tests/deep/deep-select.pw.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright / macos-latest / 3 of 9

[webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/primitive-textfield

4) [webkit] › tests/deep/deep-select.pw.spec.ts:13:13 › Deep / Select › /components/primitive-textfield Error: expect(locator).toHaveScreenshot(expected) 323 pixels (ratio 0.01 of all image pixels) are different. Expected: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/snapshots/tests/deep/deep-select.pw.spec.ts-snapshots/deep--components-primitive-textfield--tuiTextfieldIcon--row—3-select-option-1-webkit-darwin.png Received: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw--e8c6d-ponents-primitive-textfield-webkit/deep--components-primitive-af857---row—3-select-option-1-actual.png Diff: /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests-results/tests-deep-deep-select.pw--e8c6d-ponents-primitive-textfield-webkit/deep--components-primitive-af857---row—3-select-option-1-diff.png Call log: - expect.toHaveScreenshot(deep-/components/primitive-textfield-[tuiTextfieldIcon]-row—3-select-option-1.png) with timeout 5000ms - verifying given screenshot expectation - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - 323 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('#demo-content') - locator resolved to <div id="demo-content" _ngcontent-ng-c2476019924="">…</div> - taking element screenshot - disabled all CSS animations - waiting for fonts to load... - fonts loaded - attempting scroll into view action - waiting for element to be stable - captured a stable screenshot - 323 pixels (ratio 0.01 of all image pixels) are different. 49 | await page.waitForTimeout(300); 50 | > 51 | await expect(api.apiPageExample).toHaveScreenshot( | ^ 52 | `deep-${path}-${name}-row—${rowIndex}-select-option-${index}.png`, 53 | ); 54 | at /Users/runner/work/taiga-ui/taiga-ui/projects/demo-playwright/tests/deep/deep-select.pw.spec.ts:51:54
`deep-${path}-${name}-row—${rowIndex}-select-option-${index}.png`,
);

await select.click();
await api.waitTuiIcons();
}

const cleaner = await api.getCleaner(select);
Expand All @@ -67,9 +65,9 @@ test.describe('Deep / Select', () => {
await page.keyboard.down('Enter');
}

await page.waitForTimeout(100);
await api.waitStableState();
await api.focusOnBody();
await api.waitTuiIcons();
}
}),
);
Expand Down
5 changes: 2 additions & 3 deletions projects/demo-playwright/tests/deep/deep-toggle.pw.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,16 @@ test.describe('Deep / Toggle', () => {
await expect(toggle).toBeVisible();

await toggle.click();
await api.waitTuiIcons();
await api.hideNotifications();
await api.waitStableState();
await page.waitForTimeout(100);
await page.waitForTimeout(300);

await expect(api.apiPageExample).toHaveScreenshot(
`deep-${path}-${name}-row-${rowIndex}-toggled.png`,
);

await toggle.click();
await api.waitTuiIcons();
await page.waitForTimeout(100);
}
}),
);
Expand Down
4 changes: 2 additions & 2 deletions projects/demo-playwright/tests/demo/demo.pw.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test.describe('Demo', () => {
const demoPaths: string[] = JSON.parse(process.env['DEMO_PATHS']!);

demoPaths.forEach((path) => {
test(`${path}`, async ({page}) => {
test(`${path}`, async ({page, browserName}) => {
const documentation = new TuiDocumentationPagePO(page);

await tuiMockImages(page);
Expand All @@ -29,7 +29,7 @@ test.describe('Demo', () => {

for (const [i, example] of examples.entries()) {
// eslint-disable-next-line playwright/no-conditional-in-test
if (tuiIsFlakyExample(path, i)) {
if (tuiIsFlakyExample(path, i, browserName)) {
continue;
}

Expand Down
39 changes: 27 additions & 12 deletions projects/demo-playwright/utils/is-flaky-examples.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,41 @@
import {DemoRoute} from '@demo/routes';

const FLAKY_EXAMPLES = new Map<string, number[]>([
const FLAKY_EXAMPLES = new Map<
string,
Array<{exampleIndex: number; browserName?: string}>
>([
[DemoRoute.AppBar, [{exampleIndex: 0, browserName: 'webkit'}]], // Flaky in safari, need to investigate a problem
[DemoRoute.Carousel, [{exampleIndex: 2, browserName: 'webkit'}]], // Flaky in safari, need to investigate a problem
[
DemoRoute.Carousel,
[
0, // [duration]="4000"
3, // just button (to open dialog)
{exampleIndex: 0}, // [duration]="4000"
{exampleIndex: 3}, // just button (to open dialog)
],
],
[DemoRoute.IconsCustomization, [0]], // TODO: investigate flaky test
[DemoRoute.MultiSelect, [3]], // Imitating server response (timer(5000))
[DemoRoute.Select, [4]], // Imitating server response (delay(3000))
[DemoRoute.Stepper, [2]], // TODO: flaky test for proprietary demo (autoscroll problems)
[DemoRoute.TabBar, [3]], // Imitating server response (timer(3000))
[DemoRoute.Table, [3, 4]], // Imitating server response (delay(3000)) and virtual scroll
[DemoRoute.Tiles, [0]], // YouTube iframe player
[DemoRoute.IconsCustomization, [{exampleIndex: 0}]], // TODO: investigate flaky test
[DemoRoute.LegendItem, [{exampleIndex: 0, browserName: 'webkit'}]], // Flaky in safari, need to investigate a problem
[DemoRoute.MultiSelect, [{exampleIndex: 3}]], // Imitating server response (timer(5000))
[DemoRoute.RingChart, [{exampleIndex: 0, browserName: 'webkit'}]], // Flaky in safari, need to investigate a problem
[DemoRoute.Select, [{exampleIndex: 4}]], // Imitating server response (delay(3000))
[DemoRoute.Stepper, [{exampleIndex: 2}]], // TODO: flaky test for proprietary demo (autoscroll problems)
[DemoRoute.TabBar, [{exampleIndex: 3}]], // Imitating server response (timer(3000))
[DemoRoute.Table, [{exampleIndex: 3}, {exampleIndex: 4}]], // Imitating server response (delay(3000)) and virtual scroll
[DemoRoute.Tiles, [{exampleIndex: 0}]], // YouTube iframe player
]);

export function tuiIsFlakyExample(path: string, exampleIndex: number): boolean {
export function tuiIsFlakyExample(
path: string,
exampleIndex: number,
browserName: string,
): boolean {
const exclusions = FLAKY_EXAMPLES.get(path) ?? [];

const excluded = !!exclusions?.includes(exampleIndex);
const excluded = !!exclusions.find(
(exclusion) =>
exclusion.exampleIndex === exampleIndex &&
(exclusion.browserName ? exclusion.browserName === browserName : true),
);

if (excluded) {
console.info(`skip test for: ${path}[${exampleIndex}]`);
Expand Down

0 comments on commit ddceed0

Please sign in to comment.