Commit b69fa35 1 parent e7b1e90 commit b69fa35 Copy full SHA for b69fa35
File tree 1 file changed +6
-17
lines changed
1 file changed +6
-17
lines changed Original file line number Diff line number Diff line change @@ -52,28 +52,17 @@ export async function disconnectFromServer(title: string): Promise<void> {
52
52
await disconnectAction ?. click ( ) ;
53
53
}
54
54
55
+ /**
56
+ * Check if an element exists in the current context. This is needed since the
57
+ * default Selenium driver `findElement` methods throw if element not found.
58
+ * @param locator Locator of element to check
59
+ * @returns True if element exists, false otherwise
60
+ */
55
61
export async function elementExists ( locator : Locator ) : Promise < boolean > {
56
62
const { driver } = VSBrowser . instance ;
57
63
return ( await driver . findElements ( locator ) ) . length > 0 ;
58
64
}
59
65
60
- export async function elementExistsEventually (
61
- locator : Locator
62
- ) : Promise < boolean > {
63
- const { driver } = VSBrowser . instance ;
64
- await driver . wait ( until . elementLocated ( locator ) ) ;
65
- return true ;
66
- }
67
-
68
- export async function elementIsLazyLoaded ( locator : Locator ) : Promise < boolean > {
69
- const existsInitially = await elementExists ( locator ) ;
70
- if ( existsInitially ) {
71
- throw new Error ( 'Element is already present before lazy loading' ) ;
72
- }
73
-
74
- return elementExistsEventually ( locator ) ;
75
- }
76
-
77
66
/**
78
67
* We don't have access to some of the underlying error classes from
79
68
* vscode-extension-tester, but we can approximate the type of error by grabbing
You can’t perform that action at this time.
0 commit comments