mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: warn when browser with revision override is getting installed (#33226)
This commit is contained in:
parent
0d12fbe002
commit
f1f2a7b33a
@ -372,6 +372,7 @@ type BrowsersJSON = {
|
|||||||
type BrowsersJSONDescriptor = {
|
type BrowsersJSONDescriptor = {
|
||||||
name: string,
|
name: string,
|
||||||
revision: string,
|
revision: string,
|
||||||
|
hasRevisionOverride: boolean
|
||||||
browserVersion?: string,
|
browserVersion?: string,
|
||||||
installByDefault: boolean,
|
installByDefault: boolean,
|
||||||
dir: string,
|
dir: string,
|
||||||
@ -386,6 +387,7 @@ function readDescriptors(browsersJSON: BrowsersJSON): BrowsersJSONDescriptor[] {
|
|||||||
const descriptor: BrowsersJSONDescriptor = {
|
const descriptor: BrowsersJSONDescriptor = {
|
||||||
name,
|
name,
|
||||||
revision,
|
revision,
|
||||||
|
hasRevisionOverride: !!revisionOverride,
|
||||||
// We only put browser version for the supported operating systems.
|
// We only put browser version for the supported operating systems.
|
||||||
browserVersion: revisionOverride ? undefined : obj.browserVersion,
|
browserVersion: revisionOverride ? undefined : obj.browserVersion,
|
||||||
installByDefault: !!obj.installByDefault,
|
installByDefault: !!obj.installByDefault,
|
||||||
@ -492,7 +494,8 @@ export class Registry {
|
|||||||
revision: chromium.revision,
|
revision: chromium.revision,
|
||||||
browserVersion: chromium.browserVersion,
|
browserVersion: chromium.browserVersion,
|
||||||
dir: chromium.dir.replace(/(.*)(-\d+)$/, '$1-headless-shell$2'),
|
dir: chromium.dir.replace(/(.*)(-\d+)$/, '$1-headless-shell$2'),
|
||||||
installByDefault: false
|
installByDefault: false,
|
||||||
|
hasRevisionOverride: false,
|
||||||
};
|
};
|
||||||
const chromiumHeadlessShellExecutable = findExecutablePath(chromiumHeadlessShellDescriptor.dir, 'chromium-headless-shell');
|
const chromiumHeadlessShellExecutable = findExecutablePath(chromiumHeadlessShellDescriptor.dir, 'chromium-headless-shell');
|
||||||
this._executables.push({
|
this._executables.push({
|
||||||
@ -1069,6 +1072,13 @@ export class Registry {
|
|||||||
throw new Error(`ERROR: Playwright does not support ${descriptor.name} on ${hostPlatform}`);
|
throw new Error(`ERROR: Playwright does not support ${descriptor.name} on ${hostPlatform}`);
|
||||||
if (!isOfficiallySupportedPlatform)
|
if (!isOfficiallySupportedPlatform)
|
||||||
logPolitely(`BEWARE: your OS is not officially supported by Playwright; downloading fallback build for ${hostPlatform}.`);
|
logPolitely(`BEWARE: your OS is not officially supported by Playwright; downloading fallback build for ${hostPlatform}.`);
|
||||||
|
if (descriptor.hasRevisionOverride) {
|
||||||
|
const message = `You are using a frozen ${descriptor.name} browser which does not receive updates anymore on ${hostPlatform}. Please update to the latest version of your operating system to test up-to-date browsers.`;
|
||||||
|
if (process.env.GITHUB_ACTIONS)
|
||||||
|
console.log(`::warning title=Playwright::${message}`); // eslint-disable-line no-console
|
||||||
|
else
|
||||||
|
logPolitely(message);
|
||||||
|
}
|
||||||
|
|
||||||
const displayName = descriptor.name.split('-').map(word => {
|
const displayName = descriptor.name.split('-').map(word => {
|
||||||
return word === 'ffmpeg' ? 'FFMPEG' : word.charAt(0).toUpperCase() + word.slice(1);
|
return word === 'ffmpeg' ? 'FFMPEG' : word.charAt(0).toUpperCase() + word.slice(1);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user