Add simple notebook smoke test (#12898)

* add simple notebook smoke test

* add id for notebook dropdown elements
This commit is contained in:
Lucy Zhang
2020-10-14 05:58:32 -07:00
committed by GitHub
parent a0c03784f2
commit 7bc26cc493
6 changed files with 131 additions and 7 deletions

View File

@@ -0,0 +1,39 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Code } from '../code';
import { Dialog } from './dialog';
const CONFIGURE_PYTHON_DIALOG_TITLE = 'Configure Python to run Python 3 kernel';
export class ConfigurePythonDialog extends Dialog {
constructor(code: Code) {
super(CONFIGURE_PYTHON_DIALOG_TITLE, code);
}
async waitForConfigurePythonDialog(): Promise<void> {
await this.waitForNewDialog();
}
async installPython(): Promise<void> {
const dialog = '.modal .modal-dialog';
await this.code.waitAndClick(dialog);
const newPythonInstallation = '.modal .modal-body input[aria-label="New Python installation"]';
await this.code.waitAndClick(newPythonInstallation);
const nextButton = '.modal-dialog .modal-content .modal-footer .right-footer .footer-button a[aria-label="Next"][aria-disabled="false"]';
await this.code.waitForElement(nextButton);
await this.code.dispatchKeybinding('enter');
const installButton = '.modal-dialog .modal-content .modal-footer .right-footer .footer-button a[aria-label="Install"][aria-disabled="false"]';
await this.code.waitForElement(installButton);
await this.code.dispatchKeybinding('enter');
return this.waitForDialogGone();
}
}