mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
rework some of some, add query to smoke (#10591)
This commit is contained in:
@@ -307,11 +307,13 @@ export class QueryManagementService implements IQueryManagementService {
|
|||||||
|
|
||||||
public onMessage(messagesMap: Map<string, azdata.QueryExecuteMessageParams[]>): void {
|
public onMessage(messagesMap: Map<string, azdata.QueryExecuteMessageParams[]>): void {
|
||||||
for (const [uri, messages] of messagesMap) {
|
for (const [uri, messages] of messagesMap) {
|
||||||
|
if (messages) {
|
||||||
this._notify(uri, (runner: QueryRunner) => {
|
this._notify(uri, (runner: QueryRunner) => {
|
||||||
runner.handleMessage(messages.map(m => m.message));
|
runner.handleMessage(messages.map(m => m.message));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Edit Data Functions
|
// Edit Data Functions
|
||||||
public initializeEdit(ownerUri: string, schemaName: string, objectName: string, objectType: string, rowLimit: number, queryString: string): Promise<void> {
|
public initializeEdit(ownerUri: string, schemaName: string, objectName: string, objectType: string, rowLimit: number, queryString: string): Promise<void> {
|
||||||
|
|||||||
@@ -4,19 +4,9 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import { Code } from '../code';
|
import { Code } from '../code';
|
||||||
import { waitForNewDialog, clickDialogButton } from './sqlutils';
|
import { waitForNewDialog } from './sqlutils';
|
||||||
import { TestServerProfile, AuthenticationType } from './testConfig';
|
|
||||||
|
|
||||||
const CONNECTION_DIALOG_TITLE = 'Connection';
|
const CONNECTION_DIALOG_TITLE = 'Connection';
|
||||||
const CONNECTION_DIALOG_SELECTOR: string = '.modal-dialog .modal-content .modal-body .connection-dialog';
|
|
||||||
const CONNECTION_DETAIL_CONTROL_SELECTOR: string = '.connection-provider-info .connection-table .connection-input';
|
|
||||||
|
|
||||||
const SERVER_INPUT_ARIA_LABEL = 'Server';
|
|
||||||
const USERNAME_INPUT_ARIA_LABEL = 'User name';
|
|
||||||
const PASSWORD_INPUT_ARIA_LABEL = 'Password';
|
|
||||||
const AUTH_TYPE_ARIA_LABEL = 'Authentication type';
|
|
||||||
|
|
||||||
const CONNECT_BUTTON_ARIA_LABEL = 'Connect';
|
|
||||||
|
|
||||||
export class ConnectionDialog {
|
export class ConnectionDialog {
|
||||||
|
|
||||||
@@ -26,26 +16,21 @@ export class ConnectionDialog {
|
|||||||
await waitForNewDialog(this.code, CONNECTION_DIALOG_TITLE);
|
await waitForNewDialog(this.code, CONNECTION_DIALOG_TITLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
async connect(profile: TestServerProfile): Promise<void> {
|
private static readonly PROVIDER_SELECTOR = '.modal .modal-body select[aria-label="Connection type"]';
|
||||||
await this.code.waitForSetValue(this.getInputCssSelector(SERVER_INPUT_ARIA_LABEL), profile.serverName);
|
async setProvider(provider: string): Promise<void> {
|
||||||
if (profile.authenticationType === AuthenticationType.SqlLogin) {
|
await this.code.waitForSetValue(ConnectionDialog.PROVIDER_SELECTOR, provider);
|
||||||
await this.code.waitAndClick(this.getSelectCssSelector(AUTH_TYPE_ARIA_LABEL));
|
|
||||||
await this.selectAuthType(profile.authenticationTypeDisplayName);
|
|
||||||
await this.code.waitForSetValue(this.getInputCssSelector(USERNAME_INPUT_ARIA_LABEL), profile.userName);
|
|
||||||
await this.code.waitForSetValue(this.getInputCssSelector(PASSWORD_INPUT_ARIA_LABEL), profile.password);
|
|
||||||
}
|
|
||||||
await clickDialogButton(this.code, CONNECT_BUTTON_ARIA_LABEL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private getInputCssSelector(ariaLabel: string): string {
|
private static readonly TARGET_SELECTOR = '.modal .modal-body input[aria-label="${TARGET}"]';
|
||||||
return `${CONNECTION_DIALOG_SELECTOR} ${CONNECTION_DETAIL_CONTROL_SELECTOR} .monaco-inputbox input[aria-label="${ariaLabel}"]`;
|
async setTarget(target: string, value: string): Promise<void> {
|
||||||
|
await this.code.waitForSetValue(ConnectionDialog.TARGET_SELECTOR.replace('${TARGET}', '' + target), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private getSelectCssSelector(ariaLabel: string): string {
|
private static readonly CONNECT_BUTTON_SELECTOR = '.modal .modal-footer a[aria-label="Connect"]';
|
||||||
return `${CONNECTION_DIALOG_SELECTOR} ${CONNECTION_DETAIL_CONTROL_SELECTOR} select[aria-label="${ariaLabel}"]`;
|
async connect(): Promise<void> {
|
||||||
}
|
await this.code.waitAndClick(ConnectionDialog.CONNECT_BUTTON_SELECTOR);
|
||||||
|
|
||||||
private async selectAuthType(authType: string) {
|
const selector = `.editor-instance .monaco-editor textarea`;
|
||||||
await this.code.waitAndClick(`.context-view.bottom.left .monaco-select-box-dropdown-container .select-box-dropdown-list-container .monaco-list .monaco-scrollable-element .monaco-list-rows .monaco-list-row div[aria-label="${authType}"][class*="option-text"]`);
|
return this.code.waitForActiveElement(selector);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
import { Application, getStandaloneServer } from '../../../../../automation';
|
|
||||||
|
|
||||||
export function setup() {
|
|
||||||
describe('profiler test suite', () => {
|
|
||||||
it('Launch profiler test', async function () {
|
|
||||||
const app = this.app as Application;
|
|
||||||
await app.workbench.profiler.launchProfiler();
|
|
||||||
await app.workbench.connectionDialog.waitForConnectionDialog();
|
|
||||||
await app.workbench.connectionDialog.connect(await getStandaloneServer());
|
|
||||||
await app.workbench.profiler.waitForNewSessionDialogAndStart();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -8,15 +8,16 @@ import { Application } from '../../../../../automation';
|
|||||||
export function setup() {
|
export function setup() {
|
||||||
describe('Query Editor', () => {
|
describe('Query Editor', () => {
|
||||||
|
|
||||||
it('can open and connect file', async function () {
|
it('can open, connect and execute file', async function () {
|
||||||
const app = this.app as Application;
|
const app = this.app as Application;
|
||||||
await app.workbench.quickaccess.openFile('test.sql');
|
await app.workbench.quickaccess.openFile('test.sql');
|
||||||
await app.workbench.queryEditor.commandBar.clickButton(3);
|
await app.workbench.queryEditor.commandBar.clickButton(3);
|
||||||
await app.workbench.connectionDialog.waitForConnectionDialog();
|
await app.workbench.connectionDialog.waitForConnectionDialog();
|
||||||
await app.code.waitForSetValue('.modal .modal-body select[aria-label="Connection type"]', 'Sqlite');
|
await app.workbench.connectionDialog.setProvider('Sqlite');
|
||||||
await app.code.waitForSetValue('.modal .modal-body input[aria-label="File"]', 'chinook.db');
|
await app.workbench.connectionDialog.setTarget('File', 'chinook.db');
|
||||||
await app.code.waitAndClick('.modal .modal-footer a[aria-label="Connect"]');
|
await app.workbench.connectionDialog.connect();
|
||||||
await app.workbench.queryEditor.commandBar.waitForButton(3, 'Disconnect');
|
await app.workbench.queryEditor.commandBar.clickButton(1);
|
||||||
|
await app.code.waitForElement('.query-editor-view .monaco-table');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user