mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
take screenshot when wizard page not loaded (#16867)
This commit is contained in:
@@ -9,6 +9,10 @@ import { Dialog } from './dialog';
|
|||||||
const CONFIGURE_PYTHON_DIALOG_TITLE = 'Configure Python to run Python 3 kernel';
|
const CONFIGURE_PYTHON_DIALOG_TITLE = 'Configure Python to run Python 3 kernel';
|
||||||
|
|
||||||
export class ConfigurePythonDialog extends Dialog {
|
export class ConfigurePythonDialog extends Dialog {
|
||||||
|
private static readonly dialogPageInView = '.modal .modal-body .dialogModal-pane:not(.dialogModal-hidden)';
|
||||||
|
private static readonly dialogButtonInView = '.modal .modal-footer .footer-button:not(.dialogModal-hidden)';
|
||||||
|
private static readonly nextButton = `${ConfigurePythonDialog.dialogButtonInView} a[aria-label="Next"][aria-disabled="false"]`;
|
||||||
|
private static readonly installButton = `${ConfigurePythonDialog.dialogButtonInView} a[aria-label="Install"][aria-disabled="false"]`;
|
||||||
|
|
||||||
constructor(code: Code) {
|
constructor(code: Code) {
|
||||||
super(CONFIGURE_PYTHON_DIALOG_TITLE, code);
|
super(CONFIGURE_PYTHON_DIALOG_TITLE, code);
|
||||||
@@ -18,26 +22,28 @@ export class ConfigurePythonDialog extends Dialog {
|
|||||||
await this.waitForNewDialog();
|
await this.waitForNewDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
async installPython(): Promise<void> {
|
async waitForPageOneLoaded(): Promise<void> {
|
||||||
const dialogPageInView = '.modal .modal-body .dialogModal-pane:not(.dialogModal-hidden)';
|
// Wait up to 1 minute for the python install location to be loaded.
|
||||||
const dialogButtonInView = '.modal .modal-footer .footer-button:not(.dialogModal-hidden)';
|
const pythonInstallLocationDropdownValue = `${ConfigurePythonDialog.dialogPageInView} option[value*="/azuredatastudio-python (Default)"]`;
|
||||||
|
|
||||||
// Wait up to 1 minute for the python install location to be loaded before clicking the next button.
|
|
||||||
// There may be a timing issue where the smoke test attempts to go to the next page before
|
|
||||||
// the contents are loaded, causing the test to fail.
|
|
||||||
const pythonInstallLocationDropdownValue = `${dialogPageInView} option[value*="/azuredatastudio-python (Default)"]`;
|
|
||||||
await this.code.waitForElement(pythonInstallLocationDropdownValue, undefined, 600);
|
await this.code.waitForElement(pythonInstallLocationDropdownValue, undefined, 600);
|
||||||
|
|
||||||
const loadingSpinner = `${dialogPageInView} .modelview-loadingComponent-content-loading`;
|
const loadingSpinner = `${ConfigurePythonDialog.dialogPageInView} .modelview-loadingComponent-content-loading`;
|
||||||
await this.code.waitForElementGone(loadingSpinner);
|
await this.code.waitForElementGone(loadingSpinner);
|
||||||
|
|
||||||
const nextButton = `${dialogButtonInView} a[aria-label="Next"][aria-disabled="false"]`;
|
await this.code.waitForElement(ConfigurePythonDialog.nextButton);
|
||||||
await this.code.waitAndClick(nextButton);
|
}
|
||||||
|
|
||||||
const installButton = `${dialogButtonInView} a[aria-label="Install"][aria-disabled="false"]`;
|
async waitForPageTwoLoaded(): Promise<void> {
|
||||||
// wait up to 1 minute for the required kernel dependencies to load before clicking install button
|
// Wait up to 1 minute for the required kernel dependencies to load before clicking install button
|
||||||
await this.code.waitForElement(installButton, undefined, 600);
|
await this.code.waitForElement(ConfigurePythonDialog.installButton, undefined, 600);
|
||||||
await this.code.waitAndClick(installButton);
|
}
|
||||||
|
|
||||||
|
async next(): Promise<void> {
|
||||||
|
await this.code.waitAndClick(ConfigurePythonDialog.nextButton);
|
||||||
|
}
|
||||||
|
|
||||||
|
async install(): Promise<void> {
|
||||||
|
await this.code.waitAndClick(ConfigurePythonDialog.installButton);
|
||||||
|
|
||||||
await this.waitForDialogGone();
|
await this.waitForDialogGone();
|
||||||
return this._waitForInstallationComplete();
|
return this._waitForInstallationComplete();
|
||||||
|
|||||||
@@ -64,7 +64,15 @@ export function setup() {
|
|||||||
|
|
||||||
await app.workbench.sqlNotebook.notebookToolbar.changeKernel('Python 3');
|
await app.workbench.sqlNotebook.notebookToolbar.changeKernel('Python 3');
|
||||||
await app.workbench.configurePythonDialog.waitForConfigurePythonDialog();
|
await app.workbench.configurePythonDialog.waitForConfigurePythonDialog();
|
||||||
await app.workbench.configurePythonDialog.installPython();
|
try {
|
||||||
|
await app.workbench.configurePythonDialog.waitForPageOneLoaded();
|
||||||
|
} catch (e) {
|
||||||
|
await app.captureScreenshot('Configure Python Dialog page one not loaded');
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
await app.workbench.configurePythonDialog.next();
|
||||||
|
await app.workbench.configurePythonDialog.waitForPageTwoLoaded();
|
||||||
|
await app.workbench.configurePythonDialog.install();
|
||||||
await app.workbench.sqlNotebook.notebookToolbar.waitForKernel('Python 3');
|
await app.workbench.sqlNotebook.notebookToolbar.waitForKernel('Python 3');
|
||||||
|
|
||||||
await app.workbench.sqlNotebook.runActiveCell();
|
await app.workbench.sqlNotebook.runActiveCell();
|
||||||
|
|||||||
Reference in New Issue
Block a user