mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-11 02:32:35 -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:
27
test/automation/src/sql/notificationToast.ts
Normal file
27
test/automation/src/sql/notificationToast.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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';
|
||||
|
||||
export class NotificationToast {
|
||||
|
||||
constructor(private readonly code: Code) { }
|
||||
|
||||
async closeNotificationToasts() {
|
||||
const notificationToastSelector = 'div[class="notifications-toasts visible"]';
|
||||
const notificationToastCloseButton = `a[class="action-label codicon codicon-notifications-clear"][role="button"]`;
|
||||
let numberOfToasts = 0;
|
||||
|
||||
await this.code.waitForElements(notificationToastSelector, false, result => {
|
||||
numberOfToasts = result.length;
|
||||
return true;
|
||||
});
|
||||
|
||||
for (let i = 0; i < numberOfToasts; i++) {
|
||||
await this.code.waitAndClick(notificationToastSelector);
|
||||
await this.code.waitAndClick(notificationToastCloseButton);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user