smoke tests - run with snapshots: true for tests that install extensions (#238855)

This commit is contained in:
Benjamin Pasero
2025-01-27 17:30:59 +01:00
committed by GitHub
parent d863046088
commit 5e667f741b
5 changed files with 14 additions and 6 deletions
+1
View File
@@ -27,6 +27,7 @@ export interface LaunchOptions {
readonly remote?: boolean;
readonly web?: boolean;
readonly tracing?: boolean;
snapshots?: boolean;
readonly headless?: boolean;
readonly browser?: 'chromium' | 'webkit' | 'firefox';
readonly quality: Quality;
+2 -2
View File
@@ -88,7 +88,7 @@ async function launchServer(options: LaunchOptions) {
}
async function launchBrowser(options: LaunchOptions, endpoint: string) {
const { logger, workspacePath, tracing, headless } = options;
const { logger, workspacePath, tracing, snapshots, headless } = options;
const browser = await measureAndLog(() => playwright[options.browser ?? 'chromium'].launch({
headless: headless ?? false,
@@ -101,7 +101,7 @@ async function launchBrowser(options: LaunchOptions, endpoint: string) {
if (tracing) {
try {
await measureAndLog(() => context.tracing.start({ screenshots: true, /* remaining options are off for perf reasons */ }), 'context.tracing.start()', logger);
await measureAndLog(() => context.tracing.start({ screenshots: true, snapshots }), 'context.tracing.start()', logger);
} catch (error) {
logger.log(`Playwright (Browser): Failed to start playwright tracing (${error})`); // do not fail the build when this fails
}
+2 -2
View File
@@ -27,7 +27,7 @@ export async function launch(options: LaunchOptions): Promise<{ electronProcess:
}
async function launchElectron(configuration: IElectronConfiguration, options: LaunchOptions) {
const { logger, tracing } = options;
const { logger, tracing, snapshots } = options;
const electron = await measureAndLog(() => playwright._electron.launch({
executablePath: configuration.electronPath,
@@ -45,7 +45,7 @@ async function launchElectron(configuration: IElectronConfiguration, options: La
if (tracing) {
try {
await measureAndLog(() => context.tracing.start({ screenshots: true, /* remaining options are off for perf reasons */ }), 'context.tracing.start()', logger);
await measureAndLog(() => context.tracing.start({ screenshots: true, snapshots }), 'context.tracing.start()', logger);
} catch (error) {
logger.log(`Playwright (Electron): Failed to start playwright tracing (${error})`); // do not fail the build when this fails
}
@@ -10,7 +10,10 @@ export function setup(logger: Logger) {
describe('Extensions', () => {
// Shared before/after handling
installAllHandlers(logger);
installAllHandlers(logger, opts => {
opts.snapshots = true; // enable network tab in devtools for tracing since we install an extension
return opts;
});
it('install and enable vscode-smoketest-check extension', async function () {
const app = this.app as Application;
@@ -9,8 +9,12 @@ import { installAllHandlers } from '../../utils';
export function setup(logger: Logger) {
describe('Localization', () => {
// Shared before/after handling
installAllHandlers(logger);
installAllHandlers(logger, opts => {
opts.snapshots = true; // enable network tab in devtools for tracing since we install an extension
return opts;
});
it('starts with "DE" locale and verifies title and viewlets text is in German', async function () {
const app = this.app as Application;