wait for kernel change before running cell (#12949)

This commit is contained in:
Lucy Zhang
2020-10-16 09:59:03 -07:00
committed by GitHub
parent f6949d834b
commit 767465edbf
3 changed files with 17 additions and 1 deletions

View File

@@ -33,7 +33,13 @@ export class ConfigurePythonDialog extends Dialog {
await this.code.waitForElement(installButton);
await this.code.dispatchKeybinding('enter');
return this.waitForDialogGone();
await this.waitForDialogGone();
return this._waitForInstallationComplete();
}
private async _waitForInstallationComplete(): Promise<void> {
const installationCompleteNotification = '.notifications-toasts div[aria-label="Notebook dependencies installation is complete, source: Notebook Core Extensions (Extension), notification"]';
await this.code.waitForElement(installationCompleteNotification);
}
}

View File

@@ -46,6 +46,10 @@ export class Notebook {
await this.toolbar.changeKernel(kernel);
}
async waitForKernel(kernel: string): Promise<void> {
await this.toolbar.waitForKernel(kernel);
}
async runActiveCell(): Promise<void> {
await this.code.dispatchKeybinding('F5');
}
@@ -86,4 +90,9 @@ export class NotebookToolbar {
await this.code.waitForSetValue(kernelDropdown, kernel);
await this.code.dispatchKeybinding('enter');
}
async waitForKernel(kernel: string): Promise<void> {
const kernelDropdownValue = `${NotebookToolbar.toolbarSelector} select[id="kernel-dropdown"][title="${kernel}"]`;
await this.code.waitForElement(kernelDropdownValue);
}
}