mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 79a1f5a5ca0c6c53db617aa1fa5a2396d2caebe2
This commit is contained in:
66
test/smoke/src/areas/notebook/notebook.test.ts
Normal file
66
test/smoke/src/areas/notebook/notebook.test.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as cp from 'child_process';
|
||||
import { Application } from '../../../../automation';
|
||||
|
||||
// function wait(ms: number): Promise<void> {
|
||||
// return new Promise(r => setTimeout(r, ms));
|
||||
// }
|
||||
|
||||
|
||||
export function setup() {
|
||||
describe('Notebooks', () => {
|
||||
after(async function () {
|
||||
const app = this.app as Application;
|
||||
cp.execSync('git checkout . --quiet', { cwd: app.workspacePathOrFolder });
|
||||
cp.execSync('git reset --hard origin/master --quiet', { cwd: app.workspacePathOrFolder });
|
||||
});
|
||||
|
||||
afterEach(async function () {
|
||||
const app = this.app as Application;
|
||||
await app.workbench.quickaccess.runCommand('workbench.action.files.save');
|
||||
await app.workbench.quickaccess.runCommand('workbench.action.closeActiveEditor');
|
||||
});
|
||||
|
||||
it('inserts/edits code cell', async function () {
|
||||
const app = this.app as Application;
|
||||
await app.workbench.notebook.openNotebook();
|
||||
await app.workbench.notebook.focusNextCell();
|
||||
await app.workbench.notebook.insertNotebookCell('code');
|
||||
await app.workbench.notebook.waitForTypeInEditor('// some code');
|
||||
await app.workbench.notebook.stopEditingCell();
|
||||
});
|
||||
|
||||
it('inserts/edits markdown cell', async function () {
|
||||
const app = this.app as Application;
|
||||
await app.workbench.notebook.openNotebook();
|
||||
await app.workbench.notebook.focusNextCell();
|
||||
await app.workbench.notebook.insertNotebookCell('markdown');
|
||||
await app.workbench.notebook.waitForTypeInEditor('## hello2! ');
|
||||
await app.workbench.notebook.stopEditingCell();
|
||||
await app.workbench.notebook.waitForMarkdownContents('h2', 'hello2!');
|
||||
});
|
||||
|
||||
it('moves focus as it inserts/deletes a cell', async function () {
|
||||
const app = this.app as Application;
|
||||
await app.workbench.notebook.openNotebook();
|
||||
await app.workbench.notebook.insertNotebookCell('code');
|
||||
await app.workbench.notebook.waitForActiveCellEditorContents(' ');
|
||||
await app.workbench.notebook.stopEditingCell();
|
||||
await app.workbench.notebook.deleteActiveCell();
|
||||
await app.workbench.notebook.waitForMarkdownContents('p', 'Markdown Cell');
|
||||
});
|
||||
|
||||
it('moves focus in and out of output', async function () {
|
||||
const app = this.app as Application;
|
||||
await app.workbench.notebook.openNotebook();
|
||||
await app.workbench.notebook.executeActiveCell();
|
||||
await app.workbench.notebook.focusInCellOutput();
|
||||
await app.workbench.notebook.focusOutCellOutput();
|
||||
await app.workbench.notebook.waitForActiveCellEditorContents('code()');
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -26,6 +26,7 @@ import { main as sqlMain, setup as sqlSetup } from './sql/main'; //{{SQL CARBON
|
||||
import { setup as setupDataLossTests } from './areas/workbench/data-loss.test';
|
||||
import { setup as setupDataPreferencesTests } from './areas/preferences/preferences.test';
|
||||
import { setup as setupDataSearchTests } from './areas/search/search.test';
|
||||
import { setup as setupDataNotebookTests } from './areas/notebook/notebook.test';
|
||||
import { setup as setupDataLanguagesTests } from './areas/languages/languages.test';
|
||||
import { setup as setupDataEditorTests } from './areas/editor/editor.test';
|
||||
import { setup as setupDataStatusbarTests } from './areas/statusbar/statusbar.test';
|
||||
@@ -155,6 +156,8 @@ if (!opts.web) {
|
||||
} else {
|
||||
quality = Quality.Stable;
|
||||
}
|
||||
|
||||
console.log(`Running desktop smoke tests against ${electronPath}`);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -163,14 +166,20 @@ if (!opts.web) {
|
||||
else {
|
||||
const testCodeServerPath = opts.build || process.env.VSCODE_REMOTE_SERVER_PATH;
|
||||
|
||||
if (typeof testCodeServerPath === 'string' && !fs.existsSync(testCodeServerPath)) {
|
||||
fail(`Can't find Code server at ${testCodeServerPath}.`);
|
||||
if (typeof testCodeServerPath === 'string') {
|
||||
if (!fs.existsSync(testCodeServerPath)) {
|
||||
fail(`Can't find Code server at ${testCodeServerPath}.`);
|
||||
} else {
|
||||
console.log(`Running web smoke tests against ${testCodeServerPath}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (!testCodeServerPath) {
|
||||
process.env.VSCODE_REPOSITORY = repoPath;
|
||||
process.env.VSCODE_DEV = '1';
|
||||
process.env.VSCODE_CLI = '1';
|
||||
|
||||
console.log(`Running web smoke out of sources`);
|
||||
}
|
||||
|
||||
if (process.env.VSCODE_DEV === '1') {
|
||||
@@ -310,6 +319,7 @@ describe(`VSCode Smoke Tests (${opts.web ? 'Web' : 'Electron'})`, () => {
|
||||
/*if (!opts.web) { setupDataLossTests(); }
|
||||
if (!opts.web) { setupDataPreferencesTests(); }
|
||||
setupDataSearchTests();
|
||||
if (!opts.web) { setupDataNotebookTests(); }
|
||||
setupDataLanguagesTests();
|
||||
setupDataEditorTests();
|
||||
setupDataStatusbarTests(!!opts.web);
|
||||
|
||||
Reference in New Issue
Block a user