Adding acceptance condition to dispatchKeybinding in smoketests (#242570)

* adding code for smoke tests

* adding awaits

* changing wait code

* renaming dispatch to send

* moving comment

* update to send
This commit is contained in:
Aiday Marlen Kyzy
2025-03-05 11:38:48 +01:00
committed by GitHub
parent 85460c37d4
commit fa548237be
18 changed files with 116 additions and 95 deletions

View File

@@ -34,8 +34,7 @@ export class QuickInput {
}
async closeQuickInput(): Promise<void> {
await this.code.dispatchKeybinding('escape');
await this.waitForQuickInputClosed();
await this.code.sendKeybinding('escape', () => this.waitForQuickInputClosed());
}
async waitForQuickInputElements(accept: (names: string[]) => boolean): Promise<void> {
@@ -49,11 +48,12 @@ export class QuickInput {
async selectQuickInputElement(index: number, keepOpen?: boolean): Promise<void> {
await this.waitForQuickInputOpened();
for (let from = 0; from < index; from++) {
await this.code.dispatchKeybinding('down');
}
await this.code.dispatchKeybinding('enter');
if (!keepOpen) {
await this.waitForQuickInputClosed();
await this.code.sendKeybinding('down');
}
await this.code.sendKeybinding('enter', async () => {
if (!keepOpen) {
await this.waitForQuickInputClosed();
}
});
}
}