Skip to content

Commit a1e8d2d

Browse files
authored
feat: switch to the Firefox Stable equivalent by default (#6926)
This patch: - starts downloading Firefox Stable equivalent by default - starts running Firefox-Stable on our smoke tests (tests-1) - starts running Firefox-Beta on our CQ1 tests (tests-2) Note: there's a little confusion right now with browser names: - `firefox-stable` - firefox-stable equivalent - `firefox`- firefox-beta equivalent I'll rename `firefox` to `firefox-beta` in a follow-up. Fixes #6817
1 parent 15668f0 commit a1e8d2d

File tree

9 files changed

+36
-34
lines changed

9 files changed

+36
-34
lines changed

.github/workflows/infra.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ jobs:
1919
- uses: actions/setup-node@v2
2020
with:
2121
node-version: 12
22-
- uses: microsoft/playwright-github-action@v1
2322
- run: npm ci
2423
- run: npm run build
24+
- run: node lib/cli/cli install-deps chromium firefox webkit
2525
- run: npm run lint
2626
- name: Verify clean tree
2727
run: |
@@ -39,8 +39,8 @@ jobs:
3939
- uses: actions/setup-node@v2
4040
with:
4141
node-version: 12
42-
- uses: microsoft/playwright-github-action@v1
4342
- run: npm ci
4443
- run: npm run build
44+
- run: node lib/cli/cli install-deps chromium
4545
- run: node utils/build/update_canary_version.js --today-date
4646
- run: utils/build/build-playwright-driver.sh

.github/workflows/tests_secondary.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ jobs:
257257
name: chrome-stable-mac-test-results
258258
path: test-results
259259

260-
firefox_stable_linux:
261-
name: "Firefox Stable (Linux)"
260+
firefox_beta_linux:
261+
name: "Firefox Beta (Linux)"
262262
runs-on: ubuntu-20.04
263263
steps:
264264
- uses: actions/checkout@v2
@@ -270,20 +270,20 @@ jobs:
270270
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
271271
- run: npm run build
272272
- run: node lib/cli/cli install-deps firefox
273-
- run: node lib/cli/cli install firefox-stable chromium
273+
- run: node lib/cli/cli install firefox chromium
274274
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run ftest
275275
env:
276-
PWTEST_CHANNEL: firefox-stable
276+
PWTEST_CHANNEL: firefox-beta
277277
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
278278
if: always()
279279
- uses: actions/upload-artifact@v1
280280
if: ${{ always() }}
281281
with:
282-
name: firefox-stable-linux-test-results
282+
name: firefox-beta-linux-test-results
283283
path: test-results
284284

285-
firefox_stable_win:
286-
name: "Firefox Stable (Win)"
285+
firefox_beta_win:
286+
name: "Firefox Beta (Win)"
287287
runs-on: windows-latest
288288
steps:
289289
- uses: actions/checkout@v2
@@ -295,22 +295,22 @@ jobs:
295295
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
296296
- run: npm run build
297297
- run: node lib/cli/cli install-deps chromium
298-
- run: node lib/cli/cli install firefox-stable chromium
298+
- run: node lib/cli/cli install firefox chromium
299299
- run: npm run ftest
300300
shell: bash
301301
env:
302-
PWTEST_CHANNEL: firefox-stable
302+
PWTEST_CHANNEL: firefox-beta
303303
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
304304
if: always()
305305
shell: bash
306306
- uses: actions/upload-artifact@v1
307307
if: ${{ always() }}
308308
with:
309-
name: firefox-stable-win-test-results
309+
name: firefox-beta-win-test-results
310310
path: test-results
311311

312-
firefox_stable_mac:
313-
name: "Firefox Stable (Mac)"
312+
firefox_beta_mac:
313+
name: "Firefox Beta (Mac)"
314314
runs-on: macos-10.15
315315
steps:
316316
- uses: actions/checkout@v2
@@ -321,16 +321,16 @@ jobs:
321321
env:
322322
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
323323
- run: npm run build
324-
- run: node lib/cli/cli install firefox-stable chromium
324+
- run: node lib/cli/cli install firefox chromium
325325
- run: npm run ftest
326326
env:
327-
PWTEST_CHANNEL: firefox-stable
327+
PWTEST_CHANNEL: firefox-beta
328328
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
329329
if: always()
330330
- uses: actions/upload-artifact@v1
331331
if: ${{ always() }}
332332
with:
333-
name: firefox-stable-mac-test-results
333+
name: firefox-beta-mac-test-results
334334
path: test-results
335335

336336
edge_stable_mac:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 🎭 Playwright
22

3-
[![npm version](https://img.shields.io/npm/v/playwright.svg?style=flat)](https://www.npmjs.com/package/playwright) [![Join Slack](https://img.shields.io/badge/join-slack-infomational)](https://aka.ms/playwright-slack) <!-- GEN:chromium-version-badge -->[![Chromium version](https://img.shields.io/badge/chromium-93.0.4530.0-blue.svg?logo=google-chrome)](https://www.chromium.org/Home)<!-- GEN:stop --> <!-- GEN:firefox-version-badge -->[![Firefox version](https://img.shields.io/badge/firefox-89.0b15-blue.svg?logo=mozilla-firefox)](https://www.mozilla.org/en-US/firefox/new/)<!-- GEN:stop --> <!-- GEN:webkit-version-badge -->[![WebKit version](https://img.shields.io/badge/webkit-14.2-blue.svg?logo=safari)](https://webkit.org/)<!-- GEN:stop -->
3+
[![npm version](https://img.shields.io/npm/v/playwright.svg?style=flat)](https://www.npmjs.com/package/playwright) [![Join Slack](https://img.shields.io/badge/join-slack-infomational)](https://aka.ms/playwright-slack) <!-- GEN:chromium-version-badge -->[![Chromium version](https://img.shields.io/badge/chromium-93.0.4530.0-blue.svg?logo=google-chrome)](https://www.chromium.org/Home)<!-- GEN:stop --> <!-- GEN:firefox-version-badge -->[![Firefox version](https://img.shields.io/badge/firefox-89.0-blue.svg?logo=mozilla-firefox)](https://www.mozilla.org/en-US/firefox/new/)<!-- GEN:stop --> <!-- GEN:webkit-version-badge -->[![WebKit version](https://img.shields.io/badge/webkit-14.2-blue.svg?logo=safari)](https://webkit.org/)<!-- GEN:stop -->
44

55
## [Documentation](https://playwright.dev) | [API reference](https://playwright.dev/docs/api/class-playwright/)
66

@@ -10,7 +10,7 @@ Playwright is a Node.js library to automate [Chromium](https://www.chromium.org/
1010
| :--- | :---: | :---: | :---: |
1111
| Chromium <!-- GEN:chromium-version -->93.0.4530.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1212
| WebKit <!-- GEN:webkit-version -->14.2<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
13-
| Firefox <!-- GEN:firefox-version -->89.0b15<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
13+
| Firefox <!-- GEN:firefox-version -->89.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1414

1515
Headless execution is supported for all the browsers on all platforms. Check out [system requirements](https://playwright.dev/docs/intro/#system-requirements) for details.
1616

browsers.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
{
1010
"name": "firefox",
1111
"revision": "1268",
12-
"installByDefault": true
12+
"installByDefault": false
1313
},
1414
{
1515
"name": "firefox-stable",
1616
"revision": "1259",
17-
"installByDefault": false
17+
"installByDefault": true
1818
},
1919
{
2020
"name": "webkit",

packages/build_package.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const PLAYWRIGHT_CORE_FILES = ['bin', 'lib', 'types', 'NOTICE', 'LICENSE', ];
3333
const PACKAGES = {
3434
'playwright': {
3535
description: 'A high-level API to automate web browsers',
36-
browsers: ['chromium', 'firefox', 'webkit', 'ffmpeg'],
36+
browsers: ['chromium', 'firefox-stable', 'webkit', 'ffmpeg'],
3737
// We copy README.md additionally for Playwright so that it looks nice on NPM.
3838
files: [...PLAYWRIGHT_CORE_FILES, 'README.md'],
3939
},
@@ -44,7 +44,7 @@ const PACKAGES = {
4444
},
4545
'playwright-test': {
4646
description: 'Playwright Test Runner',
47-
browsers: ['chromium', 'firefox', 'webkit', 'ffmpeg'],
47+
browsers: ['chromium', 'firefox-stable', 'webkit', 'ffmpeg'],
4848
files: PLAYWRIGHT_CORE_FILES,
4949
name: '@playwright/test',
5050
},
@@ -55,7 +55,7 @@ const PACKAGES = {
5555
},
5656
'playwright-firefox': {
5757
description: 'A high-level API to automate Firefox',
58-
browsers: ['firefox'],
58+
browsers: ['firefox-stable'],
5959
files: PLAYWRIGHT_CORE_FILES,
6060
},
6161
'playwright-chromium': {

src/server/browserType.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,22 @@ import { CallMetadata, SdkObject } from './instrumentation';
3535
const ARTIFACTS_FOLDER = path.join(os.tmpdir(), 'playwright-artifacts-');
3636

3737
export abstract class BrowserType extends SdkObject {
38-
private _name: registry.BrowserName;
38+
private _name: 'chromium'|'firefox'|'webkit';
39+
private _binaryName: registry.BrowserName;
3940
readonly _registry: registry.Registry;
4041
readonly _playwrightOptions: PlaywrightOptions;
4142

42-
constructor(browserName: registry.BrowserName, playwrightOptions: PlaywrightOptions) {
43+
constructor(name: 'chromium'|'firefox'|'webkit', binaryName: registry.BrowserName, playwrightOptions: PlaywrightOptions) {
4344
super(playwrightOptions.rootSdkObject, 'browser-type');
4445
this.attribution.browserType = this;
4546
this._playwrightOptions = playwrightOptions;
46-
this._name = browserName;
47+
this._name = name;
48+
this._binaryName = binaryName;
4749
this._registry = playwrightOptions.registry;
4850
}
4951

5052
executablePath(channel?: string): string {
51-
return this._registry.executablePath(this._name) || '';
53+
return this._registry.executablePath(this._binaryName) || '';
5254
}
5355

5456
name(): string {
@@ -172,7 +174,7 @@ export abstract class BrowserType extends SdkObject {
172174

173175
// Only validate dependencies for downloadable browsers.
174176
if (!executablePath && !options.channel)
175-
await validateHostRequirements(this._registry, this._name);
177+
await validateHostRequirements(this._registry, this._binaryName);
176178
else if (!executablePath && options.channel && this._registry.isSupportedBrowser(options.channel))
177179
await validateHostRequirements(this._registry, options.channel as registry.BrowserName);
178180

src/server/chromium/chromium.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class Chromium extends BrowserType {
4242
private _devtools: CRDevTools | undefined;
4343

4444
constructor(playwrightOptions: PlaywrightOptions) {
45-
super('chromium', playwrightOptions);
45+
super('chromium', 'chromium', playwrightOptions);
4646

4747
if (debugMode())
4848
this._devtools = this._createDevTools();

src/server/firefox/firefox.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ import * as types from '../types';
2929

3030
export class Firefox extends BrowserType {
3131
constructor(playwrightOptions: PlaywrightOptions) {
32-
super('firefox', playwrightOptions);
32+
super('firefox', 'firefox-stable', playwrightOptions);
3333
}
3434

3535
executablePath(channel?: string): string {
3636
if (channel) {
3737
let executablePath = undefined;
38-
if ((channel as any) === 'firefox-stable')
39-
executablePath = this._registry.executablePath('firefox-stable');
38+
if ((channel as any) === 'firefox-beta')
39+
executablePath = this._registry.executablePath('firefox');
4040
assert(executablePath, `unsupported firefox channel "${channel}"`);
4141
assert(fs.existsSync(executablePath), `"${channel}" channel is not installed. Try running 'npx playwright install ${channel}'`);
4242
return executablePath;

src/server/webkit/webkit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { assert } from '../../utils/utils';
2828

2929
export class WebKit extends BrowserType {
3030
constructor(playwrightOptions: PlaywrightOptions) {
31-
super('webkit', playwrightOptions);
31+
super('webkit', 'webkit', playwrightOptions);
3232
}
3333

3434
executablePath(channel?: string): string {

0 commit comments

Comments
 (0)