mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-06 09:35:41 -05:00
Search smoke tests (#13469)
* Add smoke test * add simple tests for searching in notebooks view * address pr comments * address pr comments * add search smoke tests to separate file * remove span from selector
This commit is contained in:
28
test/smoke/src/sql/areas/notebook/notebookView.test.ts
Normal file
28
test/smoke/src/sql/areas/notebook/notebookView.test.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { assert } from 'console';
|
||||
import { Application } from '../../../../../automation';
|
||||
|
||||
export function setup() {
|
||||
describe('NotebookView', () => {
|
||||
|
||||
it('No search results if search query is empty', async function () {
|
||||
const app = this.app as Application;
|
||||
await app.workbench.sqlNotebook.view.focus();
|
||||
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();
|
||||
// Adding a regex expression to not depend on specific results of 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));
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
import { setup as setupQueryEditorTests, setupWeb as setupQueryEditorWebTests } from './areas/queryEditor/queryEditor.test';
|
||||
import { setup as setupNotebookTests } from './areas/notebook/notebook.test';
|
||||
import { setup as setupNotebookViewTests } from './areas/notebook/notebookView.test';
|
||||
import { ApplicationOptions } from '../../../automation';
|
||||
import * as yazl from 'yauzl';
|
||||
import * as fs from 'fs';
|
||||
@@ -19,6 +20,7 @@ export function main(isWeb: boolean = false): void {
|
||||
setupQueryEditorTests();
|
||||
}
|
||||
setupNotebookTests();
|
||||
setupNotebookViewTests();
|
||||
}
|
||||
|
||||
/* eslint-disable no-sync */
|
||||
|
||||
Reference in New Issue
Block a user