mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-09 17:52:34 -05:00
Add smoke test for manage packages wizard (#19018)
* start manage packages smoke test * fix addpackage * remove wait for loading spinner * check cell output gone * check wizard tab is done initializing
This commit is contained in:
53
test/automation/src/sql/managePackagesDialog.ts
Normal file
53
test/automation/src/sql/managePackagesDialog.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 MANAGE_PACKAGES_DIALOG_TITLE = 'Manage Packages';
|
||||
|
||||
export class ManagePackagesDialog extends Dialog {
|
||||
private static readonly dialogPage = '.modal .modal-body .dialogModal-pane';
|
||||
|
||||
constructor(code: Code) {
|
||||
super(MANAGE_PACKAGES_DIALOG_TITLE, code);
|
||||
}
|
||||
|
||||
async waitForManagePackagesDialog(): Promise<void> {
|
||||
await this.waitForNewDialog();
|
||||
}
|
||||
|
||||
async addNewPackage(packageName: string): Promise<void> {
|
||||
const addNewTab = `${ManagePackagesDialog.dialogPage} div[class="tab-header"][aria-controls="dialogPane.Manage Packages.1"]`;
|
||||
await this.code.waitAndClick(addNewTab);
|
||||
|
||||
const loadingSpinner = `${ManagePackagesDialog.dialogPage} div.modelview-loadingComponent-spinner`;
|
||||
|
||||
// Wait for "Search Pip packages" placeholder in the input box to know that the tab has finished initializing
|
||||
const searchPipPackagesInput = `${ManagePackagesDialog.dialogPage} input[placeholder="Search Pip packages"]`;
|
||||
await this.code.waitForElement(searchPipPackagesInput);
|
||||
const searchInputBox = `${ManagePackagesDialog.dialogPage} .monaco-inputbox`;
|
||||
await this.code.waitAndClick(searchInputBox);
|
||||
|
||||
const searchInputBoxEditor = `${searchInputBox} input.input`;
|
||||
await this.code.waitForTypeInEditor(searchInputBoxEditor, packageName);
|
||||
|
||||
const searchButton = `${ManagePackagesDialog.dialogPage} a[class="monaco-button monaco-text-button"][aria-label="Search"][aria-disabled="false"]`;
|
||||
await this.code.waitAndClick(searchButton);
|
||||
|
||||
const installButton = `${ManagePackagesDialog.dialogPage} a[class="monaco-button monaco-text-button"][aria-label="Install"][aria-disabled="false"]`;
|
||||
await this.code.waitAndClick(installButton);
|
||||
|
||||
const installedTab = `${ManagePackagesDialog.dialogPage} div[class="tab-header"][aria-controls="dialogPane.Manage Packages.0"]`;
|
||||
await this.code.waitAndClick(installedTab);
|
||||
|
||||
// The installed packages tab will reload once the package has been installed
|
||||
await this.code.waitForElement(loadingSpinner);
|
||||
await this.code.waitForElementGone(loadingSpinner);
|
||||
|
||||
const closeButton = '.modal .modal-footer a[class="monaco-button monaco-text-button"][aria-label="Close"][aria-disabled="false"]';
|
||||
await this.code.waitAndClick(closeButton);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user