fix screenshots (#18052)

This commit is contained in:
Lucy Zhang
2022-01-11 18:10:29 -08:00
committed by GitHub
parent 292e60a767
commit 4f18180672
2 changed files with 6 additions and 14 deletions

View File

@@ -13,7 +13,7 @@ import * as mkdirp from 'mkdirp';
import { ncp } from 'ncp';
import * as vscodetest from 'vscode-test';
import fetch from 'node-fetch';
import { Quality, ApplicationOptions, MultiLogger, Logger, ConsoleLogger, FileLogger, Application } from '../../automation';
import { Quality, ApplicationOptions, MultiLogger, Logger, ConsoleLogger, FileLogger } from '../../automation';
import { main as sqlMain, setup as sqlSetup } from './sql/main'; // {{SQL CARBON EDIT}}
/*import { setup as setupDataMigrationTests } from './areas/workbench/data-migration.test';
@@ -362,18 +362,6 @@ after(async function () {
sqlMain(opts);
if (screenshotsPath) {
afterEach(async function () {
if (this.currentTest!.state !== 'failed') {
return;
}
const app = this.app as Application;
const name = this.currentTest!.fullTitle().replace(/[^a-z0-9\-]/ig, '_');
await app.captureScreenshot(name);
});
}
if (!opts.web && opts['build'] && !opts['remote']) {
describe(`Stable vs Insiders Smoke Tests: This test MUST run before releasing`, () => {
// setupDataMigrationTests(opts, testDataPath); {{SQL CARBON EDIT}} Remove unused tests

View File

@@ -43,13 +43,17 @@ export function beforeSuite(opts: minimist.ParsedArgs, optionsTransform?: (opts:
}
export function afterSuite(opts: minimist.ParsedArgs) {
after(async function () {
afterEach(async function () {
const app = this.app as Application;
if (this.currentTest?.state === 'failed' && opts.screenshots) {
const name = this.currentTest!.fullTitle().replace(/[^a-z0-9\-]/ig, '_');
await app.captureScreenshot(name);
}
});
after(async function () {
const app = this.app as Application;
if (app) {
await app.stop();