Add intellisense checks in code cell smoke test (#16362)

* check colorization and completion suggestions

* check for suggestions widget

* make selector more specific
This commit is contained in:
Lucy Zhang
2021-07-27 11:02:52 -07:00
committed by GitHub
parent f8da3cc32a
commit 7c14ec2b6d
2 changed files with 34 additions and 2 deletions

View File

@@ -75,6 +75,11 @@ export class Notebook {
return this.code.waitForTextContent(selector, undefined, c => accept(c.replace(/\u00a0/g, ' ')));
}
async waitForColorization(spanNumber: string, color: string): Promise<void> {
const span = `span:nth-child(${spanNumber})[class="${color}"]`;
await this.code.waitForElement(span);
}
public async selectAllTextInEditor(): Promise<void> {
const editor = '.notebook-cell.active .monaco-editor';
await this.code.waitAndClick(editor);
@@ -115,6 +120,18 @@ export class Notebook {
return (await this.code.waitForElements('div.notebook-cell', false)).map(cell => cell.attributes['id']);
}
// Code Cell Actions
async waitForSuggestionWidget(): Promise<void> {
const suggestionWidgetSelector = 'div.editor-widget.suggest-widget';
await this.code.waitForElement(suggestionWidgetSelector);
}
async waitForSuggestionResult(expectedResult: string): Promise<void> {
const expectedResultSelector = `div.editor-widget.suggest-widget div.monaco-list-row.focused[aria-label="${expectedResult}"]`;
await this.code.waitForElement(expectedResultSelector);
}
// Text Cell Actions
private static readonly textCellPreviewSelector = 'div.notebook-preview';