mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
fix python dialog selectors (#15866)
This commit is contained in:
@@ -19,28 +19,27 @@ export class ConfigurePythonDialog extends Dialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async installPython(): Promise<void> {
|
async installPython(): Promise<void> {
|
||||||
const dialog = '.modal .modal-dialog';
|
const dialogPageInView = '.modal .modal-body .dialogModal-pane:not(.dialogModal-hidden)';
|
||||||
await this.code.waitAndClick(dialog);
|
const dialogButtonInView = '.modal .modal-footer .footer-button:not(.dialogModal-hidden)';
|
||||||
|
|
||||||
const newPythonInstallation = `${dialog} .modal-body input[aria-label="New Python installation"]`;
|
const newPythonInstallation = `${dialogPageInView} input[aria-label="New Python installation"]`;
|
||||||
await this.code.waitAndClick(newPythonInstallation);
|
await this.code.waitAndClick(newPythonInstallation);
|
||||||
|
|
||||||
// Wait for the python install location to be loaded before clicking the next button.
|
// Wait 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
|
// 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.
|
// the contents are loaded, causing the test to fail.
|
||||||
const pythonInstallLocationDropdownValue = `${dialog} select[aria-label="Python Install Location"] option`;
|
const pythonInstallLocationDropdownValue = `${dialogPageInView} option[value*="/azuredatastudio-python (Default)"]`;
|
||||||
await this.code.waitForElement(pythonInstallLocationDropdownValue);
|
await this.code.waitForElement(pythonInstallLocationDropdownValue);
|
||||||
|
|
||||||
const nextButton = `${dialog} .modal-content .modal-footer .right-footer .footer-button a[aria-label="Next"][aria-disabled="false"]:not(.dialogModal-hidden)`;
|
const loadingSpinner = `${dialogPageInView} .modelview-loadingComponent-content-loading`;
|
||||||
await this.code.waitAndClick(dialog);
|
await this.code.waitForElementGone(loadingSpinner);
|
||||||
|
|
||||||
|
const nextButton = `${dialogButtonInView} a[aria-label="Next"][aria-disabled="false"]`;
|
||||||
await this.code.waitAndClick(nextButton);
|
await this.code.waitAndClick(nextButton);
|
||||||
|
|
||||||
// wait up to 1 minute for the required kernel dependencies to load
|
const installButton = `${dialogButtonInView} a[aria-label="Install"][aria-disabled="false"]`;
|
||||||
const requiredKernelDependencies = `${dialog} table[class="declarative-table"][aria-label="Install required kernel dependencies"]`;
|
// wait up to 1 minute for the required kernel dependencies to load before clicking install button
|
||||||
await this.code.waitForElement(requiredKernelDependencies, undefined, 600);
|
await this.code.waitForElement(installButton, undefined, 600);
|
||||||
|
|
||||||
const installButton = `${dialog} .modal-content .modal-footer .right-footer .footer-button a[aria-label="Install"][aria-disabled="false"]:not(.dialogModal-hidden)`;
|
|
||||||
await this.code.waitAndClick(dialog);
|
|
||||||
await this.code.waitAndClick(installButton);
|
await this.code.waitAndClick(installButton);
|
||||||
|
|
||||||
await this.waitForDialogGone();
|
await this.waitForDialogGone();
|
||||||
|
|||||||
Reference in New Issue
Block a user