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:
Lucy Zhang
2021-04-27 16:53:17 -04:00
committed by GitHub
parent c66a8ca171
commit 7e1c0076ba
6 changed files with 61 additions and 9 deletions

View 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);
}
}
}