system-testing 1.0.73 → 1.0.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,173 @@
1
+ /**
2
+ * Base driver using selenium-webdriver sessions.
3
+ */
4
+ export default class WebDriverDriver {
5
+ /**
6
+ * @param {object} args
7
+ * @param {import("../system-test.js").default} args.systemTest
8
+ * @param {Record<string, any>} [args.options]
9
+ */
10
+ constructor({ systemTest, options }: {
11
+ systemTest: import("../system-test.js").default;
12
+ options?: Record<string, any>;
13
+ });
14
+ systemTest: import("../system-test.js").default;
15
+ options: Record<string, any>;
16
+ baseUrl: string;
17
+ webDriver: import("selenium-webdriver").WebDriver;
18
+ _driverTimeouts: number;
19
+ _timeouts: number;
20
+ /**
21
+ * @param {string} baseUrl
22
+ * @returns {void}
23
+ */
24
+ setBaseUrl(baseUrl: string): void;
25
+ /** @returns {string} */
26
+ getBaseUrl(): string;
27
+ /** @returns {number} */
28
+ getTimeouts(): number;
29
+ /**
30
+ * @returns {import("selenium-webdriver").WebDriver}
31
+ */
32
+ getWebDriver(): import("selenium-webdriver").WebDriver;
33
+ /**
34
+ * @param {import("selenium-webdriver").WebDriver} webDriver
35
+ * @returns {void}
36
+ */
37
+ setWebDriver(webDriver: import("selenium-webdriver").WebDriver): void;
38
+ /**
39
+ * @returns {Promise<void>}
40
+ */
41
+ start(): Promise<void>;
42
+ /**
43
+ * @returns {Promise<void>}
44
+ */
45
+ stop(): Promise<void>;
46
+ /**
47
+ * @param {number} newTimeout
48
+ * @returns {Promise<void>}
49
+ */
50
+ driverSetTimeouts(newTimeout: number): Promise<void>;
51
+ /**
52
+ * @returns {Promise<void>}
53
+ */
54
+ restoreTimeouts(): Promise<void>;
55
+ /**
56
+ * @param {number} newTimeout
57
+ * @returns {Promise<void>}
58
+ */
59
+ setTimeouts(newTimeout: number): Promise<void>;
60
+ /**
61
+ * @param {string} selector
62
+ * @returns {string}
63
+ */
64
+ getSelector(selector: string): string;
65
+ /**
66
+ * @param {string} path
67
+ * @returns {Promise<void>}
68
+ */
69
+ driverVisit(path: string): Promise<void>;
70
+ /** @returns {Promise<string>} */
71
+ getCurrentUrl(): Promise<string>;
72
+ /** @returns {Promise<string>} */
73
+ getHTML(): Promise<string>;
74
+ /** @returns {Promise<string>} */
75
+ takeScreenshot(): Promise<string>;
76
+ /**
77
+ * Gets browser logs
78
+ * @returns {Promise<string[]>}
79
+ */
80
+ getBrowserLogs(): Promise<string[]>;
81
+ /**
82
+ * Finds all elements by CSS selector
83
+ * @param {string} selector
84
+ * @param {FindArgs} [args]
85
+ * @returns {Promise<import("selenium-webdriver").WebElement[]>}
86
+ */
87
+ all(selector: string, args?: FindArgs): Promise<import("selenium-webdriver").WebElement[]>;
88
+ /**
89
+ * Finds a single element by CSS selector
90
+ * @param {string} selector
91
+ * @param {FindArgs} [args]
92
+ * @returns {Promise<import("selenium-webdriver").WebElement>}
93
+ */
94
+ find(selector: string, args?: FindArgs): Promise<import("selenium-webdriver").WebElement>;
95
+ /**
96
+ * Finds a single element by test ID
97
+ * @param {string} testId
98
+ * @param {FindArgs} [args]
99
+ * @returns {Promise<import("selenium-webdriver").WebElement>}
100
+ */
101
+ findByTestId(testId: string, args?: FindArgs): Promise<import("selenium-webdriver").WebElement>;
102
+ /**
103
+ * Finds a single element by test ID
104
+ * @param {string} testID
105
+ * @param {FindArgs} [args]
106
+ * @returns {Promise<import("selenium-webdriver").WebElement>}
107
+ */
108
+ findByTestID(testID: string, args?: FindArgs): Promise<import("selenium-webdriver").WebElement>;
109
+ /**
110
+ * @param {string|import("selenium-webdriver").WebElement|{selector: string} & FindArgs} elementOrIdentifier
111
+ * @param {FindArgs} [args]
112
+ * @returns {Promise<import("selenium-webdriver").WebElement>}
113
+ */
114
+ _findElement(elementOrIdentifier: string | import("selenium-webdriver").WebElement | ({
115
+ selector: string;
116
+ } & FindArgs), args?: FindArgs): Promise<import("selenium-webdriver").WebElement>;
117
+ /**
118
+ * Finds a single element by CSS selector without waiting
119
+ * @param {string} selector
120
+ * @param {FindArgs} [args]
121
+ * @returns {Promise<import("selenium-webdriver").WebElement>}
122
+ */
123
+ findNoWait(selector: string, args?: FindArgs): Promise<import("selenium-webdriver").WebElement>;
124
+ /**
125
+ * Clicks an element, allowing selector args when using a CSS selector.
126
+ * @param {string|import("selenium-webdriver").WebElement} elementOrIdentifier
127
+ * @param {FindArgs} [args]
128
+ * @returns {Promise<void>}
129
+ */
130
+ click(elementOrIdentifier: string | import("selenium-webdriver").WebElement, args?: FindArgs): Promise<void>;
131
+ /**
132
+ * Interacts with an element by calling a method on it with the given arguments.
133
+ * Retrying on ElementNotInteractableError, ElementClickInterceptedError, or StaleElementReferenceError.
134
+ * @param {import("selenium-webdriver").WebElement|string|{selector: string} & FindArgs} elementOrIdentifier The element or a CSS selector to find the element.
135
+ * @param {string} methodName The method name to call on the element.
136
+ * @param {...any} args Arguments to pass to the method.
137
+ * @returns {Promise<any>}
138
+ */
139
+ interact(elementOrIdentifier: import("selenium-webdriver").WebElement | string | ({
140
+ selector: string;
141
+ } & FindArgs), methodName: string, ...args: any[]): Promise<any>;
142
+ /**
143
+ * @param {string} selector
144
+ * @param {WaitForNoSelectorArgs} [args]
145
+ * @returns {Promise<void>}
146
+ */
147
+ waitForNoSelector(selector: string, args?: WaitForNoSelectorArgs): Promise<void>;
148
+ /**
149
+ * @param {() => Promise<any>} callback
150
+ * @returns {Promise<any>}
151
+ */
152
+ _withRethrownErrors(callback: () => Promise<any>): Promise<any>;
153
+ }
154
+ export type FindArgs = {
155
+ /**
156
+ * Override timeout for lookup.
157
+ */
158
+ timeout?: number;
159
+ /**
160
+ * Whether to require elements to be visible.
161
+ */
162
+ visible?: boolean;
163
+ /**
164
+ * Whether to scope by the base selector.
165
+ */
166
+ useBaseSelector?: boolean;
167
+ };
168
+ export type WaitForNoSelectorArgs = {
169
+ /**
170
+ * Whether to scope by the base selector.
171
+ */
172
+ useBaseSelector?: boolean;
173
+ };