mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 01:25:37 -05:00
Notebooks: add behavior checks to untrusted notebook smoke test (#13885)
* check untrusted notebook behavior * remove skips * check for elements after trusted nb is reopened * move trusted element checks to notebook method * make selector more specific
This commit is contained in:
@@ -133,6 +133,22 @@ export class Notebook {
|
||||
});
|
||||
await this.waitForResultsGone(cellIds);
|
||||
}
|
||||
|
||||
async waitForTrustedElements(): Promise<void> {
|
||||
const cellSelector = '.notebookEditor .notebook-cell';
|
||||
await this.code.waitForElement(`${cellSelector} iframe`);
|
||||
await this.code.waitForElement(`${cellSelector} dialog`);
|
||||
await this.code.waitForElement(`${cellSelector} embed`);
|
||||
await this.code.waitForElement(`${cellSelector} svg`);
|
||||
}
|
||||
|
||||
async waitForTrustedElementsGone(): Promise<void> {
|
||||
const cellSelector = '.notebookEditor .notebook-cell';
|
||||
await this.code.waitForElementGone(`${cellSelector} iframe`);
|
||||
await this.code.waitForElementGone(`${cellSelector} dialog`);
|
||||
await this.code.waitForElementGone(`${cellSelector} embed`);
|
||||
await this.code.waitForElementGone(`${cellSelector} svg`);
|
||||
}
|
||||
}
|
||||
|
||||
export class NotebookToolbar {
|
||||
|
||||
@@ -46,13 +46,19 @@ export function setup() {
|
||||
await app.workbench.sqlNotebook.openFile('untrusted.ipynb');
|
||||
await app.workbench.sqlNotebook.waitForKernel('SQL');
|
||||
await app.workbench.sqlNotebook.waitForNotTrustedIcon();
|
||||
await app.workbench.sqlNotebook.waitForTrustedElementsGone();
|
||||
|
||||
await app.workbench.sqlNotebook.trustNotebook();
|
||||
await app.workbench.sqlNotebook.waitForTrustedIcon();
|
||||
await app.workbench.sqlNotebook.waitForTrustedElements();
|
||||
|
||||
await app.workbench.quickaccess.runCommand('workbench.action.files.save');
|
||||
await app.workbench.quickaccess.runCommand('workbench.action.closeActiveEditor');
|
||||
|
||||
await app.workbench.sqlNotebook.openFile('untrusted.ipynb');
|
||||
await app.workbench.sqlNotebook.waitForTrustedIcon();
|
||||
await app.workbench.sqlNotebook.waitForTrustedElements();
|
||||
|
||||
await app.workbench.quickaccess.runCommand('workbench.action.closeActiveEditor');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user