Skip to content

Commit 04d4021

Browse files
committedMar 6, 2025
Simplifying codelens waiting (DH-18428-2)
1 parent d2fdb72 commit 04d4021

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed
 

‎e2e-testing/src/testUtils.ts

+3-12
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,13 @@ export async function getCodeLens(
8585
editor: TextEditor,
8686
indexOrTitle: number | string
8787
): Promise<CodeLens | undefined> {
88-
const ariaLabel = await editor.getAttribute('aria-label');
89-
9088
// The `TextEditor.getCodeLens` method provided by `vscode-extension-tester`
9189
// does not seem to explicitly wait for the anchor element to be available,
9290
// which sometimes works, and sometimes does not. To be safe, we need wait for
93-
// it ourselves. Including the `aria-label` to narrow down which editor we are
94-
// looking at.
95-
await VSBrowser.instance.driver.wait(
96-
until.elementLocated(
97-
By.css(
98-
`[aria-label="${ariaLabel}"] .contentWidgets span.codelens-decoration a`
99-
)
100-
)
91+
// it ourselves.
92+
return VSBrowser.instance.driver.wait(async () =>
93+
editor.getCodeLens(indexOrTitle)
10194
);
102-
103-
return editor.getCodeLens(indexOrTitle);
10495
}
10596

10697
/**

0 commit comments

Comments
 (0)