mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Fix manage python packages smoke test (#19232)
* make sure cell is ran * make sure dialog is gone before runing cell again * ensure package is done installing * show task panel * remove comment * pr comments * pr comments * add 7.0.0 package version
This commit is contained in:
@@ -19,7 +19,7 @@ export class ManagePackagesDialog extends Dialog {
|
||||
await this.waitForNewDialog();
|
||||
}
|
||||
|
||||
async addNewPackage(packageName: string): Promise<void> {
|
||||
async addNewPackage(packageName: string, packageVersion: string = ''): Promise<void> {
|
||||
const addNewTab = `${ManagePackagesDialog.dialogPage} div[class="tab-header"][aria-controls="dialogPane.Manage Packages.1"]`;
|
||||
await this.code.waitAndClick(addNewTab);
|
||||
|
||||
@@ -37,6 +37,13 @@ export class ManagePackagesDialog extends Dialog {
|
||||
const searchButton = `${ManagePackagesDialog.dialogPage} a[class="monaco-button monaco-text-button"][aria-label="Search"][aria-disabled="false"]`;
|
||||
await this.code.waitAndClick(searchButton);
|
||||
|
||||
if (packageVersion) {
|
||||
const versionSelectBox = `${ManagePackagesDialog.dialogPage} select[class="monaco-select-box monaco-select-box-dropdown-padding"][aria-label="Package Version"]`;
|
||||
const versionOption = `${versionSelectBox} option[value="${packageVersion}]`;
|
||||
this.code.waitForElement(versionOption);
|
||||
this.code.waitForSetValue(versionSelectBox, packageVersion);
|
||||
}
|
||||
|
||||
const installButton = `${ManagePackagesDialog.dialogPage} a[class="monaco-button monaco-text-button"][aria-label="Install"][aria-disabled="false"]`;
|
||||
await this.code.waitAndClick(installButton);
|
||||
|
||||
@@ -49,5 +56,6 @@ export class ManagePackagesDialog extends Dialog {
|
||||
|
||||
const closeButton = '.modal .modal-footer a[class="monaco-button monaco-text-button"][aria-label="Close"][aria-disabled="false"]';
|
||||
await this.code.waitAndClick(closeButton);
|
||||
await this.waitForDialogGone();
|
||||
}
|
||||
}
|
||||
|
||||
29
test/automation/src/sql/taskPanel.ts
Normal file
29
test/automation/src/sql/taskPanel.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { QuickAccess } from '../quickaccess';
|
||||
|
||||
export class TaskPanel {
|
||||
|
||||
private static readonly taskPanelSelector = 'div.pane-body.task-history';
|
||||
|
||||
constructor(private code: Code, private quickAccess: QuickAccess) {
|
||||
}
|
||||
|
||||
async showTaskPanel(): Promise<void> {
|
||||
await this.quickAccess.runCommand('workbench.panel.tasks.view.focus');
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait for the given task message in the task panel.
|
||||
* @param task The task completed message.
|
||||
* @param waitTime The amount of time to wait for the task to complete. By default, this is 1 minute.
|
||||
*/
|
||||
async waitForTaskComplete(task: string, waitTime: number = 600): Promise<void> {
|
||||
await this.code.waitForElement(`${TaskPanel.taskPanelSelector} div.label[title="${task}"]`, undefined, waitTime);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -33,6 +33,7 @@ import { ManagePackagesDialog } from './sql/managePackagesDialog';
|
||||
import { CreateBookDialog } from './sql/createBookDialog';
|
||||
import { NotificationToast } from './sql/notificationToast';
|
||||
import { AddRemoteBookDialog } from './sql/addRemoteBookDialog';
|
||||
import { TaskPanel } from './sql/taskPanel';
|
||||
// {{END}}
|
||||
|
||||
export interface Commands {
|
||||
@@ -70,6 +71,7 @@ export class Workbench {
|
||||
readonly managePackagesDialog: ManagePackagesDialog;
|
||||
readonly notificationToast: NotificationToast;
|
||||
readonly addRemoteBookDialog: AddRemoteBookDialog;
|
||||
readonly taskPanel: TaskPanel;
|
||||
// {{END}}
|
||||
|
||||
constructor(code: Code, userDataPath: string) {
|
||||
@@ -99,6 +101,7 @@ export class Workbench {
|
||||
this.configurePythonDialog = new ConfigurePythonDialog(code);
|
||||
this.managePackagesDialog = new ManagePackagesDialog(code);
|
||||
this.addRemoteBookDialog = new AddRemoteBookDialog(code);
|
||||
this.taskPanel = new TaskPanel(code, this.quickaccess);
|
||||
// {{END}}
|
||||
this.notebook = new Notebook(this.quickaccess, code);
|
||||
this.localization = new Localization(code);
|
||||
|
||||
Reference in New Issue
Block a user