Skip to content

Commit 4588fd2

Browse files
Release build 8.7.0 [ci release]
1 parent d4bccd5 commit 4588fd2

File tree

12 files changed

+64
-47
lines changed

12 files changed

+64
-47
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

CHANGELOG.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
- Add support for non isolated messaging (#1586)
2-
- Adds last updated date to PR build-and-release comment (#1563)
3-
- add snapshot checking in CI (#1587)
4-
- build(deps-dev): bump typescript-eslint from 8.26.0 to 8.27.0 (#1582)
1+
- Revert "Add support for non isolated messaging (#1586)" (#1591)
2+
- enable snapshot tests in CI (#1588)

Sources/ContentScopeScripts/dist/contentScope.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5976,17 +5976,24 @@
59765976
const userUnprotectedDomains = $USER_UNPROTECTED_DOMAINS$;
59775977
const userPreferences = $USER_PREFERENCES$;
59785978
const processedConfig = processConfig(config, userUnprotectedDomains, userPreferences, platformSpecificFeatures);
5979-
const handlerNames = [];
59805979
if (false) {
5981-
handlerNames.push("contentScopeScriptsIsolated");
5980+
processedConfig.messagingConfig = new WebkitMessagingConfig({
5981+
webkitMessageHandlerNames: ["contentScopeScriptsIsolated"],
5982+
secret: "",
5983+
hasModernWebkitAPI: true
5984+
});
59825985
} else {
5983-
handlerNames.push("contentScopeScripts");
5986+
processedConfig.messagingConfig = new TestTransportConfig({
5987+
notify() {
5988+
},
5989+
request: async () => {
5990+
},
5991+
subscribe() {
5992+
return () => {
5993+
};
5994+
}
5995+
});
59845996
}
5985-
processedConfig.messagingConfig = new WebkitMessagingConfig({
5986-
webkitMessageHandlerNames: handlerNames,
5987-
secret: "",
5988-
hasModernWebkitAPI: true
5989-
});
59905997
load({
59915998
platform: processedConfig.platform,
59925999
site: processedConfig.site,

Sources/ContentScopeScripts/dist/contentScopeIsolated.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12098,17 +12098,24 @@
1209812098
const userUnprotectedDomains = $USER_UNPROTECTED_DOMAINS$;
1209912099
const userPreferences = $USER_PREFERENCES$;
1210012100
const processedConfig = processConfig(config2, userUnprotectedDomains, userPreferences, platformSpecificFeatures);
12101-
const handlerNames = [];
1210212101
if (true) {
12103-
handlerNames.push("contentScopeScriptsIsolated");
12102+
processedConfig.messagingConfig = new WebkitMessagingConfig({
12103+
webkitMessageHandlerNames: ["contentScopeScriptsIsolated"],
12104+
secret: "",
12105+
hasModernWebkitAPI: true
12106+
});
1210412107
} else {
12105-
handlerNames.push("contentScopeScripts");
12108+
processedConfig.messagingConfig = new TestTransportConfig({
12109+
notify() {
12110+
},
12111+
request: async () => {
12112+
},
12113+
subscribe() {
12114+
return () => {
12115+
};
12116+
}
12117+
});
1210612118
}
12107-
processedConfig.messagingConfig = new WebkitMessagingConfig({
12108-
webkitMessageHandlerNames: handlerNames,
12109-
secret: "",
12110-
hasModernWebkitAPI: true
12111-
});
1211212119
load({
1211312120
platform: processedConfig.platform,
1211412121
site: processedConfig.site,

injected/entry-points/apple.js

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
import { load, init } from '../src/content-scope-features.js';
55
import { processConfig, platformSpecificFeatures } from './../src/utils';
6-
import { WebkitMessagingConfig } from '../../messaging/index.js';
6+
import { WebkitMessagingConfig, TestTransportConfig } from '../../messaging/index.js';
77

88
function initCode() {
99
// @ts-expect-error https://app.asana.com/0/1201614831475344/1203979574128023/f
@@ -15,17 +15,27 @@ function initCode() {
1515

1616
const processedConfig = processConfig(config, userUnprotectedDomains, userPreferences, platformSpecificFeatures);
1717

18-
const handlerNames = [];
1918
if (import.meta.injectName === 'apple-isolated') {
20-
handlerNames.push('contentScopeScriptsIsolated');
19+
processedConfig.messagingConfig = new WebkitMessagingConfig({
20+
webkitMessageHandlerNames: ['contentScopeScriptsIsolated'],
21+
secret: '',
22+
hasModernWebkitAPI: true,
23+
});
2124
} else {
22-
handlerNames.push('contentScopeScripts');
25+
processedConfig.messagingConfig = new TestTransportConfig({
26+
notify() {
27+
// noop
28+
},
29+
request: async () => {
30+
// noop
31+
},
32+
subscribe() {
33+
return () => {
34+
// noop
35+
};
36+
},
37+
});
2338
}
24-
processedConfig.messagingConfig = new WebkitMessagingConfig({
25-
webkitMessageHandlerNames: handlerNames,
26-
secret: '',
27-
hasModernWebkitAPI: true,
28-
});
2939

3040
load({
3141
platform: processedConfig.platform,

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)