mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 09:35:39 -05:00
Try to make smoke tests more stable (#15212)
* make sure dialog buttons are not disabled * use 'enter' to close connect dialog * retry clikcing the Connect button * wait for dialog gone after reclicking * pr comments + add logging * use debug to log * close toasts before clicking dialog buttons * await close notification toast call * click python wizard buttons instead of enter
This commit is contained in:
@@ -153,12 +153,15 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
||||
}
|
||||
|
||||
private handleOnConnect(params: INewConnectionParams, profile?: IConnectionProfile): void {
|
||||
this._logService.debug('ConnectionDialogService: onConnect event is received');
|
||||
if (!this._connecting) {
|
||||
this._logService.debug('ConnectionDialogService: Start connecting');
|
||||
this._connecting = true;
|
||||
this.handleProviderOnConnecting();
|
||||
if (!profile) {
|
||||
let result = this.uiController.validateConnection();
|
||||
if (!result.isValid) {
|
||||
this._logService.debug('ConnectionDialogService: Connection is invalid');
|
||||
this._connecting = false;
|
||||
this._connectionDialog.resetConnection();
|
||||
return;
|
||||
@@ -259,14 +262,17 @@ export class ConnectionDialogService implements IConnectionDialogService {
|
||||
}
|
||||
} else if (connectionResult && connectionResult.errorHandled) {
|
||||
this._connectionDialog.resetConnection();
|
||||
this._logService.debug(`ConnectionDialogService: Error handled and connection reset - Error: ${connectionResult.errorMessage}`);
|
||||
} else {
|
||||
this._connectionDialog.resetConnection();
|
||||
this.showErrorDialog(Severity.Error, this._connectionErrorTitle, connectionResult.errorMessage, connectionResult.callStack);
|
||||
this._logService.debug(`ConnectionDialogService: Connection error: ${connectionResult.errorMessage}`);
|
||||
}
|
||||
} catch (err) {
|
||||
this._connecting = false;
|
||||
this._connectionDialog.resetConnection();
|
||||
this.showErrorDialog(Severity.Error, this._connectionErrorTitle, err);
|
||||
this._logService.debug(`ConnectionDialogService: Error encountered while connecting ${err}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -335,12 +335,14 @@ export class ConnectionDialogWidget extends Modal {
|
||||
}
|
||||
|
||||
private connect(element?: IConnectionProfile): void {
|
||||
this.logService.debug('ConnectionDialogWidget: Connect button is clicked');
|
||||
if (this._connectButton.enabled) {
|
||||
this._connecting = true;
|
||||
this._connectButton.enabled = false;
|
||||
this._providerTypeSelectBox.disable();
|
||||
this.spinner = true;
|
||||
this._onConnect.fire(element);
|
||||
this.logService.debug('ConnectionDialogWidget: onConnect event is fired');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user