mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
@@ -9,21 +9,36 @@ import * as minimist from 'minimist';
|
||||
import { afterSuite, beforeSuite } from '../../../utils';
|
||||
|
||||
export function setup(opts: minimist.ParsedArgs) {
|
||||
describe('NotebookView', () => {
|
||||
describe('NotebookTreeView', () => {
|
||||
beforeSuite(opts);
|
||||
afterSuite(opts);
|
||||
|
||||
it('Pin a notebook', async function () {
|
||||
// Name of the SQL notebook from azuredatastudio-smoke-test-repo
|
||||
const SQL_NOTEBOOK = 'collapsed';
|
||||
it('Pin notebook', async function () {
|
||||
const app = this.app as Application;
|
||||
await app.workbench.sqlNotebook.view.focusNotebooksView();
|
||||
await app.workbench.sqlNotebook.view.pinNotebook();
|
||||
await app.workbench.sqlNotebook.view.waitForPinnedNotebookView();
|
||||
const sqlNotebook = (await app.workbench.sqlNotebook.view.getNotebookTreeItems()).filter(n => n.textContent === SQL_NOTEBOOK);
|
||||
// Pinning SQL notebook to prevent the Configure Python Wizard from showing, since Python is no longer set up when the NotebookTreeView test suite starts
|
||||
await app.workbench.sqlNotebook.view.pinNotebook(sqlNotebook[0].attributes.id);
|
||||
await app.workbench.sqlNotebook.view.waitForPinnedNotebookTreeView();
|
||||
});
|
||||
|
||||
it('Unpin Notebook', async function () {
|
||||
const app = this.app as Application;
|
||||
await app.workbench.sqlNotebook.view.focusPinnedNotebooksView();
|
||||
await app.workbench.sqlNotebook.view.unpinNotebook();
|
||||
let pinnedNotebooks = await app.workbench.sqlNotebook.view.getPinnedNotebookTreeItems();
|
||||
const sqlNotebook = (pinnedNotebooks).filter(n => n.textContent === SQL_NOTEBOOK)[0];
|
||||
await app.workbench.sqlNotebook.view.unpinNotebook(sqlNotebook.attributes.id);
|
||||
// wait a second for unpinning to complete
|
||||
await new Promise(c => setTimeout(c, 1000));
|
||||
if (pinnedNotebooks.length > 1) {
|
||||
// if theres multiple pinned notebooks check that the SQL notebook is no longer in the Pinned Notebooks View
|
||||
pinnedNotebooks = await app.workbench.sqlNotebook.view.getPinnedNotebookTreeItems();
|
||||
assert(pinnedNotebooks.find(n => n.textContent === SQL_NOTEBOOK) === undefined);
|
||||
} else {
|
||||
// check that the Pinned Notebook View is gone
|
||||
await app.workbench.sqlNotebook.view.waitForPinnedNotebookTreeViewGone();
|
||||
}
|
||||
});
|
||||
|
||||
it('No search results if search query is empty', async function () {
|
||||
|
||||
Reference in New Issue
Block a user