-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: switch to the Firefox Stable equivalent by default #6926
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,20 +35,22 @@ import { CallMetadata, SdkObject } from './instrumentation'; | |
const ARTIFACTS_FOLDER = path.join(os.tmpdir(), 'playwright-artifacts-'); | ||
|
||
export abstract class BrowserType extends SdkObject { | ||
private _name: registry.BrowserName; | ||
private _name: 'chromium'|'firefox'|'webkit'; | ||
private _binaryName: registry.BrowserName; | ||
readonly _registry: registry.Registry; | ||
readonly _playwrightOptions: PlaywrightOptions; | ||
|
||
constructor(browserName: registry.BrowserName, playwrightOptions: PlaywrightOptions) { | ||
constructor(name: 'chromium'|'firefox'|'webkit', binaryName: registry.BrowserName, playwrightOptions: PlaywrightOptions) { | ||
super(playwrightOptions.rootSdkObject, 'browser-type'); | ||
this.attribution.browserType = this; | ||
this._playwrightOptions = playwrightOptions; | ||
this._name = browserName; | ||
this._name = name; | ||
this._binaryName = binaryName; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: I'm not a huge fan of
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The word "browser" is very overloaded, so I'd prefer to have distinct names for distinct entities. To elaborate: both
If we were to start over, we'd establish some other terminology for the registry that doesn't include name "browser" - "binary" seems to be fine since it's distinct enough and is not overused around the codebase. |
||
this._registry = playwrightOptions.registry; | ||
} | ||
|
||
executablePath(channel?: string): string { | ||
return this._registry.executablePath(this._name) || ''; | ||
return this._registry.executablePath(this._binaryName) || ''; | ||
} | ||
|
||
name(): string { | ||
|
@@ -172,7 +174,7 @@ export abstract class BrowserType extends SdkObject { | |
|
||
// Only validate dependencies for downloadable browsers. | ||
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)) | ||
await validateHostRequirements(this._registry, options.channel as registry.BrowserName); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this PR: We use
microsoft/playwright-github-action
in quite a few other places in this repository. Can we fully remove it from the repo?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yess good point