Pin and unpin notebook smoke test (#15936)

* add pin/unpin smoketest

* fix simple search query assert
This commit is contained in:
Barbara Valdez
2021-06-30 22:14:18 -07:00
committed by GitHub
parent 7cf7ca5d15
commit a6644333c0
2 changed files with 64 additions and 8 deletions

View File

@@ -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));
});