-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
browser-commands.ts
38 lines (33 loc) · 1.2 KB
/
browser-commands.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import Control from "sap/ui/core/Control"
import { wdi5Config, wdi5Selector } from "./wdi5.types"
import { WDI5Control } from "../lib/wdi5-control"
/**
* wdi5 control cache aka
* wdi5 keeping score of already retrieved UI5 controls
*/
type cachedControl = {
[key: string]: Control
}
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace WebdriverIO {
export interface Browser {
config: wdi5Config
asControl: <T extends Control = Control>(arg: wdi5Selector) => Promise<WDI5Control & T>
allControls: <T extends Control = Control>(arg: wdi5Selector) => Promise<(WDI5Control & T)[]>
screenshot: (arg: string) => Promise<void>
goTo: (arg: string | object) => Promise<void>
/**
* adding the wdi5 control cache to the global browser object
*/
_controls: cachedControl[]
getUI5Version: () => Promise<string>
}
// interface MultiRemoteBrowser {
// browserCustomCommand: (arg: any) => Promise<void>
// }
// interface Element {
// elementCustomCommand: (arg: any) => Promise<number>
// }
}
}