mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-29 21:11:38 +01:00
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:
committed by
GitHub
parent
85460c37d4
commit
fa548237be
@@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user