mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-25 09:35:37 -05:00
Pin and unpin notebook smoke test (#15936)
* add pin/unpin smoketest * fix simple search query assert
This commit is contained in:
@@ -8,19 +8,31 @@ import { Application } from '../../../../../automation';
|
||||
|
||||
export function setup() {
|
||||
describe('NotebookView', () => {
|
||||
it('Pin a 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();
|
||||
});
|
||||
|
||||
it('Unpin Notebook', async function () {
|
||||
const app = this.app as Application;
|
||||
await app.workbench.sqlNotebook.view.focusPinnedNotebooksView();
|
||||
await app.workbench.sqlNotebook.view.unpinNotebook();
|
||||
});
|
||||
|
||||
it('No search results if search query is empty', async function () {
|
||||
const app = this.app as Application;
|
||||
await app.workbench.sqlNotebook.view.focus();
|
||||
await app.workbench.sqlNotebook.view.focusSearchResultsView();
|
||||
const results = await app.workbench.sqlNotebook.view.searchInNotebook('');
|
||||
assert(results.children !== undefined && results.children.length === 0);
|
||||
});
|
||||
|
||||
it('Simple query search works correctly', async function () {
|
||||
const app = this.app as Application;
|
||||
await app.workbench.sqlNotebook.view.focus();
|
||||
await app.workbench.sqlNotebook.view.focusSearchResultsView();
|
||||
// Adding a regex expression to not depend on specific results of files
|
||||
const regexExpr = /[0-9]+( results in )[0-9]+( files)/;
|
||||
const regexExpr = /[0-9]+( results? in )[0-9]+( files?)/;
|
||||
const results = await app.workbench.sqlNotebook.view.searchInNotebook('hello');
|
||||
assert(results.textContent !== '' && results.textContent.match(regexExpr));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user