Skip to content

Commit 89e55d7

Browse files
authored
Merge 2b5355a into 8200587
2 parents 8200587 + 2b5355a commit 89e55d7

File tree

8 files changed

+13
-18
lines changed

8 files changed

+13
-18
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,12 @@ jobs:
6464
key: docs-output-${{ github.run_id }}
6565
- name: Install Playwright Browsers
6666
run: npx playwright install --with-deps
67-
- name: Install dependencies for CI integration tests
68-
run: sudo apt-get install xvfb
6967
- run: npm run test-int-x
7068
- uses: actions/upload-artifact@v4
7169
if: always()
7270
with:
7371
name: playwright-report-pages
74-
path: special-pages/test-results
72+
path: special-pages/playwright-report
7573
retention-days: 5
7674
- name: Build docs
7775
run: npm run docs

special-pages/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"test-int": "playwright test --grep-invert '@screenshots'",
1515
"test-int-x": "npm run test-int",
1616
"test-int-snapshots": "playwright test --grep '@screenshots'",
17-
"test-int-snapshots-update": "playwright test --grep '@screenshots' --update-snapshots --last-failed",
17+
"test-int-snapshots-update": "playwright test --grep '@screenshots' --update-snapshots --last-failed --pass-with-no-tests",
1818
"test.screenshots": "playwright test --grep '@screenshots'",
1919
"test.windows": "npm run test-int -- --project windows",
2020
"test.macos": "npm run test-int -- --project macos",

special-pages/pages/duckplayer/integration-tests/duckplayer-screenshots.spec.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
/* global process */
21
import { expect, test } from '@playwright/test';
32
import { DuckPlayerPage } from './duck-player.js';
43

54
test.describe('screenshots @screenshots', () => {
6-
test.skip(process.env.CI === 'true');
75
test('regular layout', async ({ page }, workerInfo) => {
86
const duckplayer = DuckPlayerPage.create(page, workerInfo);
97
// load as normal

special-pages/pages/new-tab/app/favorites/integration-tests/favorites.page.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ export class FavoritesPage {
201201
await body.press('Tab');
202202
await body.press('Tab');
203203
const statsToggle = page.getByLabel('Hide recent activity');
204-
const isActive = await statsToggle.evaluate((handle) => handle === document.activeElement);
205-
expect(isActive).toBe(true);
204+
await expect(statsToggle).toBeFocused();
206205
}
207206

208207
/**

special-pages/pages/new-tab/app/privacy-stats/integration-tests/privacy-stats.page.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class PrivacyStatsPage {
4141
*/
4242
async hasRows(count) {
4343
const rows = this.rows();
44-
expect(await rows.count()).toBe(count);
44+
await expect(rows).toHaveCount(count);
4545
}
4646

4747
/**
@@ -76,7 +76,7 @@ export class PrivacyStatsPage {
7676
await this.ntp.openPage({ additional: { stats: 'manyOnlyTop' } });
7777

7878
// control, ensure we have 5 rows
79-
expect(await rows.count()).toBe(5);
79+
await expect(rows).toHaveCount(5);
8080

8181
// check the initial values
8282
expect(await rows.nth(0).textContent()).toBe('Facebook310');
@@ -103,8 +103,8 @@ export class PrivacyStatsPage {
103103
// open the NTP with the correct param
104104
await this.ntp.openPage({ additional: { stats: 'fewOnlyTop' } });
105105

106-
// control, ensure we have 5 rows
107-
expect(await rows.count()).toBe(3);
106+
// control, ensure we have 3 rows
107+
await expect(rows).toHaveCount(3);
108108

109109
// check the initial values
110110
expect(await rows.nth(0).textContent()).toBe('Facebook310');
@@ -126,7 +126,7 @@ export class PrivacyStatsPage {
126126
await this.ntp.openPage({ additional: { stats: 'topAndOneOther' } });
127127

128128
// should show all 5 items
129-
expect(await rows.count()).toBe(5);
129+
await expect(rows).toHaveCount(5);
130130

131131
// And should also show the text, but no expander
132132
// ensure the toggle is absent
@@ -145,7 +145,7 @@ export class PrivacyStatsPage {
145145
await this.ntp.openPage({ additional: { stats: 'manyTopAndOther' } });
146146

147147
// control, ensure we have 5 rows
148-
expect(await rows.count()).toBe(5);
148+
await expect(rows).toHaveCount(5);
149149

150150
// control: ensure 'other' text is absent here
151151
await expect(this.page.getByTestId('ListFooter')).not.toContainText('2 attempts from other networks');

special-pages/pages/new-tab/app/privacy-stats/integration-tests/privacy-stats.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ test.describe('newtab privacy stats', () => {
9595
const psp = new PrivacyStatsPage(page, ntp);
9696
await ntp.reducedMotion();
9797
await ntp.openPage({ additional: { stats: 'none' } });
98+
await page.getByText('Tracking protections active').waitFor();
9899

99100
await psp.receiveData({
100101
totalCount: 2,

special-pages/pages/special-error/integration-tests/special-error-screenshots.spec.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
/* global process */
21
import { expect, test } from '@playwright/test';
32
import { SpecialErrorPage } from './special-error';
43

54
const maxDiffPixels = 20;
65

76
test.describe('screenshots @screenshots', () => {
8-
test.skip(process.env.CI === 'true');
9-
107
test('SSL expired cert error', async ({ page }, workerInfo) => {
118
const special = SpecialErrorPage.create(page, workerInfo);
129
await special.openPage({ errorId: 'ssl.expired' });

special-pages/playwright.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ export default defineConfig({
9696
retries: process.env.CI ? 2 : 0,
9797
/* Opt out of parallel tests on CI. */
9898
workers: process.env.CI ? 1 : undefined,
99-
reporter: process.env.CI ? 'github' : [['html', { open: 'never' }]],
99+
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
100+
reporter: 'html',
100101
// @ts-expect-error - Type 'undefined' is not assignable to type 'string'. process.env
101102
webServer: {
102103
command: process.env.PAGE ? `npm run watch -- --page ${process.env.PAGE}` : 'npm run serve',
@@ -107,5 +108,6 @@ export default defineConfig({
107108
use: {
108109
actionTimeout: 5000,
109110
trace: 'on-first-retry',
111+
video: { mode: 'on-first-retry' },
110112
},
111113
});

0 commit comments

Comments
 (0)