Skip to content

Commit 9df763e

Browse files
committed
πŸ‘Œ skip NEG tests on non-Chromium and pinned Chromium < 146
1 parent 950fb9c commit 9df763e

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

β€Žtest/e2e/playwright.config.tsβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,14 @@ function getProjects() {
168168
}
169169

170170
function project(name: string, device: string) {
171-
const isChromium = name.startsWith('chromium')
171+
const isChromium = name === 'chromium'
172172
return {
173173
name,
174174
metadata: { sessionName: device, name } satisfies BrowserConfiguration,
175175
use: {
176176
...devices[device],
177-
// Required for experimental APIs (e.g. Network Efficiency Guardrails) that are
178-
// gated behind this flag in Chromium. Ignored for non-Chromium browsers.
177+
// Required for experimental APIs (e.g. Network Efficiency Guardrails).
178+
// Only passed to current Chromium β€” pinned browsers use pinnedProject() and may not support it.
179179
...(isChromium ? { launchOptions: { args: ['--enable-experimental-web-platform-features'] } } : {}),
180180
},
181181
}

β€Žtest/e2e/scenario/networkEfficiencyGuardrails.scenario.tsβ€Ž

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
import { test, expect } from '@playwright/test'
22
import { createTest } from '../lib/framework'
3+
import type { BrowserConfiguration } from '../../browsers.conf'
34

45
// Network Efficiency Guardrails is a Document Policy feature currently only available in Edge 146+
56
// and in Chromium behind the "Experimental Web Platform features" flag.
67
// We run these tests only on Chromium.
78

89
test.describe('network efficiency guardrails', () => {
910
test.beforeEach(({ browserName }) => {
10-
test.skip(browserName !== 'chromium', 'Network Efficiency Guardrails is only available in Chromium-based browsers')
11+
const { version } = test.info().project.metadata as BrowserConfiguration
12+
// Network Efficiency Guardrails requires Chromium 146+. Pinned projects set an explicit
13+
// version; current (unversioned) Chromium is always new enough.
14+
test.skip(
15+
browserName !== 'chromium' || (version !== undefined && Number(version) < 146),
16+
'Network Efficiency Guardrails requires Chromium 146+'
17+
)
1118
})
1219

1320
test.describe('RUM', () => {

0 commit comments

Comments
Β (0)