mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
fix screenshots (#18052)
This commit is contained in:
@@ -13,7 +13,7 @@ import * as mkdirp from 'mkdirp';
|
|||||||
import { ncp } from 'ncp';
|
import { ncp } from 'ncp';
|
||||||
import * as vscodetest from 'vscode-test';
|
import * as vscodetest from 'vscode-test';
|
||||||
import fetch from 'node-fetch';
|
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 { main as sqlMain, setup as sqlSetup } from './sql/main'; // {{SQL CARBON EDIT}}
|
||||||
/*import { setup as setupDataMigrationTests } from './areas/workbench/data-migration.test';
|
/*import { setup as setupDataMigrationTests } from './areas/workbench/data-migration.test';
|
||||||
@@ -362,18 +362,6 @@ after(async function () {
|
|||||||
|
|
||||||
sqlMain(opts);
|
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']) {
|
if (!opts.web && opts['build'] && !opts['remote']) {
|
||||||
describe(`Stable vs Insiders Smoke Tests: This test MUST run before releasing`, () => {
|
describe(`Stable vs Insiders Smoke Tests: This test MUST run before releasing`, () => {
|
||||||
// setupDataMigrationTests(opts, testDataPath); {{SQL CARBON EDIT}} Remove unused tests
|
// setupDataMigrationTests(opts, testDataPath); {{SQL CARBON EDIT}} Remove unused tests
|
||||||
|
|||||||
@@ -43,13 +43,17 @@ export function beforeSuite(opts: minimist.ParsedArgs, optionsTransform?: (opts:
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function afterSuite(opts: minimist.ParsedArgs) {
|
export function afterSuite(opts: minimist.ParsedArgs) {
|
||||||
after(async function () {
|
afterEach(async function () {
|
||||||
const app = this.app as Application;
|
const app = this.app as Application;
|
||||||
|
|
||||||
if (this.currentTest?.state === 'failed' && opts.screenshots) {
|
if (this.currentTest?.state === 'failed' && opts.screenshots) {
|
||||||
const name = this.currentTest!.fullTitle().replace(/[^a-z0-9\-]/ig, '_');
|
const name = this.currentTest!.fullTitle().replace(/[^a-z0-9\-]/ig, '_');
|
||||||
await app.captureScreenshot(name);
|
await app.captureScreenshot(name);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
after(async function () {
|
||||||
|
const app = this.app as Application;
|
||||||
|
|
||||||
if (app) {
|
if (app) {
|
||||||
await app.stop();
|
await app.stop();
|
||||||
|
|||||||
Reference in New Issue
Block a user