Skip to content

Commit

Permalink
smoke tests - run with snapshots: true for tests that install exten…
Browse files Browse the repository at this point in the history
…sions (#238855)
  • Loading branch information
bpasero authored Jan 27, 2025
1 parent d863046 commit 5e667f7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions test/automation/src/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions test/automation/src/playwrightBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions test/automation/src/playwrightElectron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
}
Expand Down
5 changes: 4 additions & 1 deletion test/smoke/src/areas/extensions/extensions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 5 additions & 1 deletion test/smoke/src/areas/workbench/localization.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5e667f7

Please sign in to comment.