Skip to content

Commit

Permalink
fix proper usage of input class
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Nov 14, 2022
1 parent fd68277 commit 5940e96
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
9 changes: 2 additions & 7 deletions src/pageobjects/workbench/Input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,15 +366,10 @@ export class QuickOpenBox extends Input {
return klass.indexOf('done') < 0
}

/**
* Get a set of QuickPickItems
* @param timeout amount time in ms to wait for the tree to appear (default 5000ms)
* @returns QuickPickItem[]
*/
async getQuickPicks (timeout = 5000): Promise<QuickPickItem[]> {
async getQuickPicks (): Promise<QuickPickItem[]> {
const picks: QuickPickItem[] = []
const tree = await browser.$(this.locators.quickList)
await tree.waitForExist({ timeout })
await tree.waitForExist({ timeout: 1000 })
const elements = await tree.$$(this.locators.row)
for (const element of elements) {
const index = parseInt(await element.getAttribute('aria-posinset'), 10)
Expand Down
5 changes: 4 additions & 1 deletion src/pageobjects/workbench/Workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ export class Workbench extends BasePage<typeof WorkbenchLocators> {
}
}
await browser.keys(['F1'])
if (await browser.getVSCodeChannel() === 'vscode' && await browser.getVSCodeVersion() >= '1.44.0') {
if (
(await browser.getVSCodeChannel() === 'vscode' && await browser.getVSCodeVersion() >= '1.44.0')
|| await browser.getVSCodeVersion() === 'insiders'
) {
return new InputBox(this.locatorMap).wait()
}
return new QuickOpenBox(this.locatorMap).wait()
Expand Down
3 changes: 2 additions & 1 deletion test/specs/basic.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ describe('WDIO VSCode Service', () => {
const messages = await Promise.all(notifs.map((n) => n.getMessage()))
return messages.includes(message)
}, {
timeoutMsg: 'Could not find custom notification'
timeoutMsg: 'Could not find custom notification',
timeout: 5000
})
})
})
Expand Down

0 comments on commit 5940e96

Please sign in to comment.