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
This commit is contained in:
parent
15668f04a8
commit
a1e8d2d531
4
.github/workflows/infra.yml
vendored
4
.github/workflows/infra.yml
vendored
|
|
@ -19,9 +19,9 @@ jobs:
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: 12
|
node-version: 12
|
||||||
- uses: microsoft/playwright-github-action@v1
|
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
|
- run: node lib/cli/cli install-deps chromium firefox webkit
|
||||||
- run: npm run lint
|
- run: npm run lint
|
||||||
- name: Verify clean tree
|
- name: Verify clean tree
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -39,8 +39,8 @@ jobs:
|
||||||
- uses: actions/setup-node@v2
|
- uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: 12
|
node-version: 12
|
||||||
- uses: microsoft/playwright-github-action@v1
|
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
|
- run: node lib/cli/cli install-deps chromium
|
||||||
- run: node utils/build/update_canary_version.js --today-date
|
- run: node utils/build/update_canary_version.js --today-date
|
||||||
- run: utils/build/build-playwright-driver.sh
|
- run: utils/build/build-playwright-driver.sh
|
||||||
|
|
|
||||||
30
.github/workflows/tests_secondary.yml
vendored
30
.github/workflows/tests_secondary.yml
vendored
|
|
@ -257,8 +257,8 @@ jobs:
|
||||||
name: chrome-stable-mac-test-results
|
name: chrome-stable-mac-test-results
|
||||||
path: test-results
|
path: test-results
|
||||||
|
|
||||||
firefox_stable_linux:
|
firefox_beta_linux:
|
||||||
name: "Firefox Stable (Linux)"
|
name: "Firefox Beta (Linux)"
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
@ -270,20 +270,20 @@ jobs:
|
||||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
- run: node lib/cli/cli install-deps firefox
|
- run: node lib/cli/cli install-deps firefox
|
||||||
- run: node lib/cli/cli install firefox-stable chromium
|
- run: node lib/cli/cli install firefox chromium
|
||||||
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run ftest
|
- run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run ftest
|
||||||
env:
|
env:
|
||||||
PWTEST_CHANNEL: firefox-stable
|
PWTEST_CHANNEL: firefox-beta
|
||||||
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
|
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
|
||||||
if: always()
|
if: always()
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
with:
|
with:
|
||||||
name: firefox-stable-linux-test-results
|
name: firefox-beta-linux-test-results
|
||||||
path: test-results
|
path: test-results
|
||||||
|
|
||||||
firefox_stable_win:
|
firefox_beta_win:
|
||||||
name: "Firefox Stable (Win)"
|
name: "Firefox Beta (Win)"
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
@ -295,22 +295,22 @@ jobs:
|
||||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
- run: node lib/cli/cli install-deps chromium
|
- run: node lib/cli/cli install-deps chromium
|
||||||
- run: node lib/cli/cli install firefox-stable chromium
|
- run: node lib/cli/cli install firefox chromium
|
||||||
- run: npm run ftest
|
- run: npm run ftest
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
PWTEST_CHANNEL: firefox-stable
|
PWTEST_CHANNEL: firefox-beta
|
||||||
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
|
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
|
||||||
if: always()
|
if: always()
|
||||||
shell: bash
|
shell: bash
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
with:
|
with:
|
||||||
name: firefox-stable-win-test-results
|
name: firefox-beta-win-test-results
|
||||||
path: test-results
|
path: test-results
|
||||||
|
|
||||||
firefox_stable_mac:
|
firefox_beta_mac:
|
||||||
name: "Firefox Stable (Mac)"
|
name: "Firefox Beta (Mac)"
|
||||||
runs-on: macos-10.15
|
runs-on: macos-10.15
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
@ -321,16 +321,16 @@ jobs:
|
||||||
env:
|
env:
|
||||||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
- run: node lib/cli/cli install firefox-stable chromium
|
- run: node lib/cli/cli install firefox chromium
|
||||||
- run: npm run ftest
|
- run: npm run ftest
|
||||||
env:
|
env:
|
||||||
PWTEST_CHANNEL: firefox-stable
|
PWTEST_CHANNEL: firefox-beta
|
||||||
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
|
- run: ./utils/upload_flakiness_dashboard.sh ./test-results/report.json
|
||||||
if: always()
|
if: always()
|
||||||
- uses: actions/upload-artifact@v1
|
- uses: actions/upload-artifact@v1
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
with:
|
with:
|
||||||
name: firefox-stable-mac-test-results
|
name: firefox-beta-mac-test-results
|
||||||
path: test-results
|
path: test-results
|
||||||
|
|
||||||
edge_stable_mac:
|
edge_stable_mac:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# 🎭 Playwright
|
# 🎭 Playwright
|
||||||
|
|
||||||
[](https://www.npmjs.com/package/playwright) [](https://aka.ms/playwright-slack) <!-- GEN:chromium-version-badge -->[](https://www.chromium.org/Home)<!-- GEN:stop --> <!-- GEN:firefox-version-badge -->[](https://www.mozilla.org/en-US/firefox/new/)<!-- GEN:stop --> <!-- GEN:webkit-version-badge -->[](https://webkit.org/)<!-- GEN:stop -->
|
[](https://www.npmjs.com/package/playwright) [](https://aka.ms/playwright-slack) <!-- GEN:chromium-version-badge -->[](https://www.chromium.org/Home)<!-- GEN:stop --> <!-- GEN:firefox-version-badge -->[](https://www.mozilla.org/en-US/firefox/new/)<!-- GEN:stop --> <!-- GEN:webkit-version-badge -->[](https://webkit.org/)<!-- GEN:stop -->
|
||||||
|
|
||||||
## [Documentation](https://playwright.dev) | [API reference](https://playwright.dev/docs/api/class-playwright/)
|
## [Documentation](https://playwright.dev) | [API reference](https://playwright.dev/docs/api/class-playwright/)
|
||||||
|
|
||||||
|
|
@ -10,7 +10,7 @@ Playwright is a Node.js library to automate [Chromium](https://www.chromium.org/
|
||||||
| :--- | :---: | :---: | :---: |
|
| :--- | :---: | :---: | :---: |
|
||||||
| Chromium <!-- GEN:chromium-version -->93.0.4530.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| Chromium <!-- GEN:chromium-version -->93.0.4530.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||||
| WebKit <!-- GEN:webkit-version -->14.2<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| WebKit <!-- GEN:webkit-version -->14.2<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||||
| Firefox <!-- GEN:firefox-version -->89.0b15<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| Firefox <!-- GEN:firefox-version -->89.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
||||||
|
|
||||||
Headless execution is supported for all the browsers on all platforms. Check out [system requirements](https://playwright.dev/docs/intro/#system-requirements) for details.
|
Headless execution is supported for all the browsers on all platforms. Check out [system requirements](https://playwright.dev/docs/intro/#system-requirements) for details.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,12 @@
|
||||||
{
|
{
|
||||||
"name": "firefox",
|
"name": "firefox",
|
||||||
"revision": "1268",
|
"revision": "1268",
|
||||||
"installByDefault": true
|
"installByDefault": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "firefox-stable",
|
"name": "firefox-stable",
|
||||||
"revision": "1259",
|
"revision": "1259",
|
||||||
"installByDefault": false
|
"installByDefault": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "webkit",
|
"name": "webkit",
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ const PLAYWRIGHT_CORE_FILES = ['bin', 'lib', 'types', 'NOTICE', 'LICENSE', ];
|
||||||
const PACKAGES = {
|
const PACKAGES = {
|
||||||
'playwright': {
|
'playwright': {
|
||||||
description: 'A high-level API to automate web browsers',
|
description: 'A high-level API to automate web browsers',
|
||||||
browsers: ['chromium', 'firefox', 'webkit', 'ffmpeg'],
|
browsers: ['chromium', 'firefox-stable', 'webkit', 'ffmpeg'],
|
||||||
// We copy README.md additionally for Playwright so that it looks nice on NPM.
|
// We copy README.md additionally for Playwright so that it looks nice on NPM.
|
||||||
files: [...PLAYWRIGHT_CORE_FILES, 'README.md'],
|
files: [...PLAYWRIGHT_CORE_FILES, 'README.md'],
|
||||||
},
|
},
|
||||||
|
|
@ -44,7 +44,7 @@ const PACKAGES = {
|
||||||
},
|
},
|
||||||
'playwright-test': {
|
'playwright-test': {
|
||||||
description: 'Playwright Test Runner',
|
description: 'Playwright Test Runner',
|
||||||
browsers: ['chromium', 'firefox', 'webkit', 'ffmpeg'],
|
browsers: ['chromium', 'firefox-stable', 'webkit', 'ffmpeg'],
|
||||||
files: PLAYWRIGHT_CORE_FILES,
|
files: PLAYWRIGHT_CORE_FILES,
|
||||||
name: '@playwright/test',
|
name: '@playwright/test',
|
||||||
},
|
},
|
||||||
|
|
@ -55,7 +55,7 @@ const PACKAGES = {
|
||||||
},
|
},
|
||||||
'playwright-firefox': {
|
'playwright-firefox': {
|
||||||
description: 'A high-level API to automate Firefox',
|
description: 'A high-level API to automate Firefox',
|
||||||
browsers: ['firefox'],
|
browsers: ['firefox-stable'],
|
||||||
files: PLAYWRIGHT_CORE_FILES,
|
files: PLAYWRIGHT_CORE_FILES,
|
||||||
},
|
},
|
||||||
'playwright-chromium': {
|
'playwright-chromium': {
|
||||||
|
|
|
||||||
|
|
@ -35,20 +35,22 @@ import { CallMetadata, SdkObject } from './instrumentation';
|
||||||
const ARTIFACTS_FOLDER = path.join(os.tmpdir(), 'playwright-artifacts-');
|
const ARTIFACTS_FOLDER = path.join(os.tmpdir(), 'playwright-artifacts-');
|
||||||
|
|
||||||
export abstract class BrowserType extends SdkObject {
|
export abstract class BrowserType extends SdkObject {
|
||||||
private _name: registry.BrowserName;
|
private _name: 'chromium'|'firefox'|'webkit';
|
||||||
|
private _binaryName: registry.BrowserName;
|
||||||
readonly _registry: registry.Registry;
|
readonly _registry: registry.Registry;
|
||||||
readonly _playwrightOptions: PlaywrightOptions;
|
readonly _playwrightOptions: PlaywrightOptions;
|
||||||
|
|
||||||
constructor(browserName: registry.BrowserName, playwrightOptions: PlaywrightOptions) {
|
constructor(name: 'chromium'|'firefox'|'webkit', binaryName: registry.BrowserName, playwrightOptions: PlaywrightOptions) {
|
||||||
super(playwrightOptions.rootSdkObject, 'browser-type');
|
super(playwrightOptions.rootSdkObject, 'browser-type');
|
||||||
this.attribution.browserType = this;
|
this.attribution.browserType = this;
|
||||||
this._playwrightOptions = playwrightOptions;
|
this._playwrightOptions = playwrightOptions;
|
||||||
this._name = browserName;
|
this._name = name;
|
||||||
|
this._binaryName = binaryName;
|
||||||
this._registry = playwrightOptions.registry;
|
this._registry = playwrightOptions.registry;
|
||||||
}
|
}
|
||||||
|
|
||||||
executablePath(channel?: string): string {
|
executablePath(channel?: string): string {
|
||||||
return this._registry.executablePath(this._name) || '';
|
return this._registry.executablePath(this._binaryName) || '';
|
||||||
}
|
}
|
||||||
|
|
||||||
name(): string {
|
name(): string {
|
||||||
|
|
@ -172,7 +174,7 @@ export abstract class BrowserType extends SdkObject {
|
||||||
|
|
||||||
// Only validate dependencies for downloadable browsers.
|
// Only validate dependencies for downloadable browsers.
|
||||||
if (!executablePath && !options.channel)
|
if (!executablePath && !options.channel)
|
||||||
await validateHostRequirements(this._registry, this._name);
|
await validateHostRequirements(this._registry, this._binaryName);
|
||||||
else if (!executablePath && options.channel && this._registry.isSupportedBrowser(options.channel))
|
else if (!executablePath && options.channel && this._registry.isSupportedBrowser(options.channel))
|
||||||
await validateHostRequirements(this._registry, options.channel as registry.BrowserName);
|
await validateHostRequirements(this._registry, options.channel as registry.BrowserName);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ export class Chromium extends BrowserType {
|
||||||
private _devtools: CRDevTools | undefined;
|
private _devtools: CRDevTools | undefined;
|
||||||
|
|
||||||
constructor(playwrightOptions: PlaywrightOptions) {
|
constructor(playwrightOptions: PlaywrightOptions) {
|
||||||
super('chromium', playwrightOptions);
|
super('chromium', 'chromium', playwrightOptions);
|
||||||
|
|
||||||
if (debugMode())
|
if (debugMode())
|
||||||
this._devtools = this._createDevTools();
|
this._devtools = this._createDevTools();
|
||||||
|
|
|
||||||
|
|
@ -29,14 +29,14 @@ import * as types from '../types';
|
||||||
|
|
||||||
export class Firefox extends BrowserType {
|
export class Firefox extends BrowserType {
|
||||||
constructor(playwrightOptions: PlaywrightOptions) {
|
constructor(playwrightOptions: PlaywrightOptions) {
|
||||||
super('firefox', playwrightOptions);
|
super('firefox', 'firefox-stable', playwrightOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
executablePath(channel?: string): string {
|
executablePath(channel?: string): string {
|
||||||
if (channel) {
|
if (channel) {
|
||||||
let executablePath = undefined;
|
let executablePath = undefined;
|
||||||
if ((channel as any) === 'firefox-stable')
|
if ((channel as any) === 'firefox-beta')
|
||||||
executablePath = this._registry.executablePath('firefox-stable');
|
executablePath = this._registry.executablePath('firefox');
|
||||||
assert(executablePath, `unsupported firefox channel "${channel}"`);
|
assert(executablePath, `unsupported firefox channel "${channel}"`);
|
||||||
assert(fs.existsSync(executablePath), `"${channel}" channel is not installed. Try running 'npx playwright install ${channel}'`);
|
assert(fs.existsSync(executablePath), `"${channel}" channel is not installed. Try running 'npx playwright install ${channel}'`);
|
||||||
return executablePath;
|
return executablePath;
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ import { assert } from '../../utils/utils';
|
||||||
|
|
||||||
export class WebKit extends BrowserType {
|
export class WebKit extends BrowserType {
|
||||||
constructor(playwrightOptions: PlaywrightOptions) {
|
constructor(playwrightOptions: PlaywrightOptions) {
|
||||||
super('webkit', playwrightOptions);
|
super('webkit', 'webkit', playwrightOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
executablePath(channel?: string): string {
|
executablePath(channel?: string): string {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue