@seleniumhq/side-runtime 4.0.0-alpha.3 → 4.0.0-alpha.30
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.
- package/dist/callstack.d.ts +1 -1
- package/dist/callstack.d.ts.map +1 -1
- package/dist/playback-tree/command-leveler.d.ts +2 -2
- package/dist/playback-tree/command-leveler.d.ts.map +1 -1
- package/dist/playback-tree/command-leveler.js +1 -0
- package/dist/playback-tree/command-leveler.js.map +1 -1
- package/dist/playback-tree/command-node.d.ts +9 -6
- package/dist/playback-tree/command-node.d.ts.map +1 -1
- package/dist/playback-tree/command-node.js +70 -32
- package/dist/playback-tree/command-node.js.map +1 -1
- package/dist/playback-tree/commands.d.ts +3 -0
- package/dist/playback-tree/commands.d.ts.map +1 -1
- package/dist/playback-tree/commands.js +22 -14
- package/dist/playback-tree/commands.js.map +1 -1
- package/dist/playback-tree/index.d.ts +3 -3
- package/dist/playback-tree/index.d.ts.map +1 -1
- package/dist/playback-tree/index.js +7 -6
- package/dist/playback-tree/index.js.map +1 -1
- package/dist/playback-tree/syntax-validation.d.ts.map +1 -1
- package/dist/playback-tree/syntax-validation.js +1 -0
- package/dist/playback-tree/syntax-validation.js.map +1 -1
- package/dist/playback.d.ts +10 -8
- package/dist/playback.d.ts.map +1 -1
- package/dist/playback.js +26 -8
- package/dist/playback.js.map +1 -1
- package/dist/plugins.d.ts +4 -5
- package/dist/plugins.d.ts.map +1 -1
- package/dist/plugins.js +54 -8
- package/dist/plugins.js.map +1 -1
- package/dist/preprocessors.d.ts +1 -1
- package/dist/preprocessors.d.ts.map +1 -1
- package/dist/types.d.ts +25 -27
- package/dist/types.d.ts.map +1 -1
- package/dist/variables.d.ts.map +1 -1
- package/dist/variables.js +6 -0
- package/dist/variables.js.map +1 -1
- package/dist/webdriver.d.ts +31 -23
- package/dist/webdriver.d.ts.map +1 -1
- package/dist/webdriver.js +101 -148
- package/dist/webdriver.js.map +1 -1
- package/package.json +11 -11
package/dist/webdriver.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import webdriver, { Capabilities,
|
|
1
|
+
import webdriver, { Capabilities, WebDriver, WebElement as WebElementShape } from 'selenium-webdriver';
|
|
2
2
|
import Variables from './variables';
|
|
3
3
|
import { Fn } from '@seleniumhq/side-commons';
|
|
4
4
|
import { CommandShape } from '@seleniumhq/side-model';
|
|
5
|
-
import {
|
|
6
|
-
export
|
|
5
|
+
import { PluginRuntimeShape } from './types';
|
|
6
|
+
export type ExpandedCapabilities = Partial<Capabilities> & {
|
|
7
7
|
browserName: string;
|
|
8
8
|
'goog:chromeOptions'?: Record<string, boolean | number | string | string[]>;
|
|
9
9
|
};
|
|
@@ -17,7 +17,7 @@ export interface WindowAPI {
|
|
|
17
17
|
}
|
|
18
18
|
export interface WebDriverExecutorConstructorArgs {
|
|
19
19
|
capabilities?: ExpandedCapabilities;
|
|
20
|
-
customCommands?:
|
|
20
|
+
customCommands?: PluginRuntimeShape['commands'];
|
|
21
21
|
disableCodeExportCompat?: boolean;
|
|
22
22
|
driver?: WebDriver;
|
|
23
23
|
hooks?: WebDriverExecutorHooks;
|
|
@@ -33,6 +33,9 @@ export interface WebDriverExecutorInitOptions {
|
|
|
33
33
|
export interface WebDriverExecutorCondEvalResult {
|
|
34
34
|
value: boolean;
|
|
35
35
|
}
|
|
36
|
+
export interface BeforePlayHookInput {
|
|
37
|
+
driver: WebDriverExecutor;
|
|
38
|
+
}
|
|
36
39
|
export interface CommandHookInput {
|
|
37
40
|
command: CommandShape;
|
|
38
41
|
}
|
|
@@ -43,20 +46,24 @@ export interface StoreWindowHandleHookInput {
|
|
|
43
46
|
export interface WindowAppearedHookInput {
|
|
44
47
|
command: CommandShape;
|
|
45
48
|
windowHandleName: CommandShape['windowHandleName'];
|
|
46
|
-
windowHandle
|
|
49
|
+
windowHandle?: string | Error;
|
|
47
50
|
}
|
|
48
51
|
export interface WindowSwitchedHookInput {
|
|
49
|
-
windowHandle
|
|
52
|
+
windowHandle?: string | Error;
|
|
50
53
|
}
|
|
54
|
+
export type GeneralHook<T> = (input: T) => Promise<void> | void;
|
|
51
55
|
export interface WebDriverExecutorHooks {
|
|
52
|
-
onBeforePlay?:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
onBeforePlay?: GeneralHook<BeforePlayHookInput>;
|
|
57
|
+
onAfterCommand?: GeneralHook<CommandHookInput>;
|
|
58
|
+
onBeforeCommand?: GeneralHook<CommandHookInput>;
|
|
59
|
+
onStoreWindowHandle?: GeneralHook<StoreWindowHandleHookInput>;
|
|
60
|
+
onWindowAppeared?: GeneralHook<WindowAppearedHookInput>;
|
|
61
|
+
onWindowSwitched?: GeneralHook<WindowSwitchedHookInput>;
|
|
62
|
+
}
|
|
63
|
+
export type HookKeys = keyof WebDriverExecutorHooks;
|
|
64
|
+
export interface ElementEditableScriptResult {
|
|
65
|
+
enabled: boolean;
|
|
66
|
+
readonly: boolean;
|
|
60
67
|
}
|
|
61
68
|
export interface ScriptShape {
|
|
62
69
|
script: string;
|
|
@@ -70,7 +77,7 @@ export default class WebDriverExecutor {
|
|
|
70
77
|
cancel: () => void;
|
|
71
78
|
};
|
|
72
79
|
capabilities?: ExpandedCapabilities;
|
|
73
|
-
customCommands: Required<
|
|
80
|
+
customCommands: Required<PluginRuntimeShape>['commands'];
|
|
74
81
|
disableCodeExportCompat: boolean;
|
|
75
82
|
driver: WebDriver;
|
|
76
83
|
server?: string;
|
|
@@ -86,10 +93,10 @@ export default class WebDriverExecutor {
|
|
|
86
93
|
cleanup(): Promise<void>;
|
|
87
94
|
isAlive(): boolean;
|
|
88
95
|
name(command: string): string;
|
|
89
|
-
executeHook(hook:
|
|
96
|
+
executeHook<T extends HookKeys>(hook: T, ...args: Parameters<NonNullable<WebDriverExecutorHooks[T]>>): Promise<void>;
|
|
90
97
|
beforeCommand(commandObject: CommandShape): Promise<void>;
|
|
91
98
|
afterCommand(commandObject: CommandShape): Promise<void>;
|
|
92
|
-
waitForNewWindow(): Promise<string | undefined>;
|
|
99
|
+
waitForNewWindow(timeout?: number): Promise<string | undefined>;
|
|
93
100
|
registerCommand(commandName: string, fn: Fn): void;
|
|
94
101
|
skip(): Promise<void>;
|
|
95
102
|
doOpen(url: string): Promise<void>;
|
|
@@ -120,10 +127,11 @@ export default class WebDriverExecutor {
|
|
|
120
127
|
doSendKeys(locator: string, value: string, commandObject?: Partial<CommandShape>): Promise<void>;
|
|
121
128
|
doWaitForElementEditable(locator: string, timeout: string): Promise<void>;
|
|
122
129
|
doWaitForElementNotEditable(locator: string, timeout: string): Promise<void>;
|
|
123
|
-
doWaitForElementPresent(locator: string, timeout: string): Promise<void>;
|
|
130
|
+
doWaitForElementPresent(locator: string, timeout: string, commandObj?: Partial<CommandShape>): Promise<void>;
|
|
124
131
|
doWaitForElementNotPresent(locator: string, timeout: string): Promise<void>;
|
|
125
|
-
doWaitForElementVisible(locator: string, timeout: string): Promise<void>;
|
|
132
|
+
doWaitForElementVisible(locator: string, timeout: string, commandObj?: Partial<CommandShape>): Promise<void>;
|
|
126
133
|
doWaitForElementNotVisible(locator: string, timeout: string): Promise<void>;
|
|
134
|
+
doWaitForText(locator: string, text: string, commandObj?: Partial<CommandShape>): Promise<void>;
|
|
127
135
|
doRunScript(script: ScriptShape): Promise<void>;
|
|
128
136
|
doExecuteScript(script: ScriptShape, optionalVariable?: string): Promise<void>;
|
|
129
137
|
doExecuteAsyncScript(script: ScriptShape, optionalVariable?: string): Promise<void>;
|
|
@@ -165,11 +173,11 @@ export default class WebDriverExecutor {
|
|
|
165
173
|
doRun(): Promise<void>;
|
|
166
174
|
doSetSpeed(): Promise<void>;
|
|
167
175
|
evaluateConditional(script: ScriptShape): Promise<WebDriverExecutorCondEvalResult>;
|
|
176
|
+
elementIsLocated(locator: string, fallback?: [string, string][]): Promise<WebElementShape | null>;
|
|
168
177
|
waitForElement(locator: string, fallback?: [string, string][]): Promise<WebElementShape>;
|
|
169
|
-
isElementEditable(element: WebElementShape): Promise<
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
wait<T extends any>(condition: Promise<T> | ConditionShape<T> | WebElementConditionShape, timeout?: number, message?: string, pollTimeout?: number): Promise<T | Error>;
|
|
178
|
+
isElementEditable(element: WebElementShape): Promise<boolean>;
|
|
179
|
+
waitForElementVisible(locator: string, timeout: number, fallback?: [string, string][]): Promise<webdriver.WebElement>;
|
|
180
|
+
waitForText(locator: string, text: string, fallback?: [string, string][]): Promise<void>;
|
|
173
181
|
}
|
|
174
182
|
export {};
|
|
175
183
|
//# sourceMappingURL=webdriver.d.ts.map
|
package/dist/webdriver.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webdriver.d.ts","sourceRoot":"","sources":["../src/webdriver.ts"],"names":[],"mappings":"AAiBA,OAAO,SAAS,EAAE,EAChB,YAAY,EACZ,SAAS,
|
|
1
|
+
{"version":3,"file":"webdriver.d.ts","sourceRoot":"","sources":["../src/webdriver.ts"],"names":[],"mappings":"AAiBA,OAAO,SAAS,EAAE,EAChB,YAAY,EACZ,SAAS,EACT,UAAU,IAAI,eAAe,EAC9B,MAAM,oBAAoB,CAAA;AAS3B,OAAO,SAAS,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAI5C,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC,GAAG;IACzD,WAAW,EAAE,MAAM,CAAA;IACnB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC,CAAA;CAC5E,CAAA;AAKD,QAAA,MAAM,KAAK,eAAkB,CAAA;AAE7B;;;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O,EAAE,MAAM,EACf,QAAQ,GAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAO,GAChC,OAAO,CAAC,eAAe,CAAC;IAcrB,iBAAiB,CAAC,OAAO,EAAE,eAAe;IAS1C,qBAAqB,CACzB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAO;IAc7B,WAAW,CACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAO;CAcpC"}
|
package/dist/webdriver.js
CHANGED
|
@@ -23,9 +23,7 @@ const selenium_webdriver_1 = __importDefault(require("selenium-webdriver"));
|
|
|
23
23
|
const utils_1 = require("./utils");
|
|
24
24
|
const preprocessors_1 = require("./preprocessors");
|
|
25
25
|
const errors_1 = require("./errors");
|
|
26
|
-
const { By, Condition, until, Key,
|
|
27
|
-
const { TimeoutError } = selenium_webdriver_1.default.error;
|
|
28
|
-
const POLL_TIMEOUT = 50;
|
|
26
|
+
const { By, Condition, until, Key, WebElementCondition } = selenium_webdriver_1.default;
|
|
29
27
|
const DEFAULT_CAPABILITIES = {
|
|
30
28
|
browserName: 'chrome',
|
|
31
29
|
};
|
|
@@ -94,8 +92,11 @@ class WebDriverExecutor {
|
|
|
94
92
|
}
|
|
95
93
|
const upperCase = command.charAt(0).toUpperCase() + command.slice(1);
|
|
96
94
|
const func = 'do' + upperCase;
|
|
97
|
-
// @ts-expect-error
|
|
95
|
+
// @ts-expect-error The functions can be overridden by custom commands and stuff
|
|
98
96
|
if (!this[func]) {
|
|
97
|
+
if (this.customCommands[command]) {
|
|
98
|
+
return command;
|
|
99
|
+
}
|
|
99
100
|
throw new Error(`Unknown command ${command}`);
|
|
100
101
|
}
|
|
101
102
|
return func;
|
|
@@ -104,7 +105,7 @@ class WebDriverExecutor {
|
|
|
104
105
|
const fn = this.hooks[hook];
|
|
105
106
|
if (!fn)
|
|
106
107
|
return;
|
|
107
|
-
// @ts-expect-error
|
|
108
|
+
// @ts-expect-error it's okay, this shape is fine
|
|
108
109
|
await fn.apply(this, args);
|
|
109
110
|
}
|
|
110
111
|
async beforeCommand(commandObject) {
|
|
@@ -116,7 +117,7 @@ class WebDriverExecutor {
|
|
|
116
117
|
async afterCommand(commandObject) {
|
|
117
118
|
this.cancellable = undefined;
|
|
118
119
|
if (commandObject.opensWindow) {
|
|
119
|
-
const handle = await this.
|
|
120
|
+
const handle = await this.waitForNewWindow(commandObject.windowTimeout);
|
|
120
121
|
this.variables.set(commandObject.windowHandleName, handle);
|
|
121
122
|
await this.executeHook('onWindowAppeared', {
|
|
122
123
|
command: commandObject,
|
|
@@ -126,9 +127,26 @@ class WebDriverExecutor {
|
|
|
126
127
|
}
|
|
127
128
|
await this.executeHook('onAfterCommand', { command: commandObject });
|
|
128
129
|
}
|
|
129
|
-
async waitForNewWindow() {
|
|
130
|
-
const
|
|
131
|
-
|
|
130
|
+
async waitForNewWindow(timeout = 2000) {
|
|
131
|
+
const finder = new Promise((resolve) => {
|
|
132
|
+
const start = Date.now();
|
|
133
|
+
const findHandle = async () => {
|
|
134
|
+
if (Date.now() - start > timeout) {
|
|
135
|
+
resolve(undefined);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const currentHandles = await this.driver.getAllWindowHandles();
|
|
139
|
+
const newHandle = currentHandles.find((handle) => !this[state].openedWindows.includes(handle));
|
|
140
|
+
if (newHandle) {
|
|
141
|
+
resolve(newHandle);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
// cant find, wait next time.
|
|
145
|
+
setTimeout(findHandle, 200);
|
|
146
|
+
};
|
|
147
|
+
findHandle();
|
|
148
|
+
});
|
|
149
|
+
return this.driver.wait(finder, timeout);
|
|
132
150
|
}
|
|
133
151
|
registerCommand(commandName, fn) {
|
|
134
152
|
// @ts-expect-error
|
|
@@ -384,32 +402,39 @@ class WebDriverExecutor {
|
|
|
384
402
|
// wait commands
|
|
385
403
|
async doWaitForElementEditable(locator, timeout) {
|
|
386
404
|
const element = await this.driver.findElement(parseLocator(locator));
|
|
387
|
-
await this.wait(this.isElementEditable(element), parseInt(timeout), 'Timed out waiting for element to be editable');
|
|
405
|
+
await this.driver.wait(this.isElementEditable(element), parseInt(timeout), 'Timed out waiting for element to be editable');
|
|
388
406
|
}
|
|
389
407
|
async doWaitForElementNotEditable(locator, timeout) {
|
|
390
408
|
const element = await this.driver.findElement(parseLocator(locator));
|
|
391
|
-
await this.wait(this.isElementEditable(element), parseInt(timeout), 'Timed out waiting for element to not be editable');
|
|
409
|
+
await this.driver.wait(this.isElementEditable(element), parseInt(timeout), 'Timed out waiting for element to not be editable');
|
|
392
410
|
}
|
|
393
|
-
async doWaitForElementPresent(locator, timeout) {
|
|
394
|
-
await this.wait(
|
|
411
|
+
async doWaitForElementPresent(locator, timeout, commandObj = {}) {
|
|
412
|
+
await this.driver.wait(this.elementIsLocated(locator, commandObj.targetFallback), parseInt(timeout));
|
|
395
413
|
}
|
|
396
414
|
async doWaitForElementNotPresent(locator, timeout) {
|
|
397
415
|
const parsedLocator = parseLocator(locator);
|
|
398
416
|
const elements = await this.driver.findElements(parsedLocator);
|
|
399
417
|
if (elements.length !== 0) {
|
|
400
|
-
|
|
418
|
+
const noElementPresentCondition = new Condition('for element to not be present', async () => {
|
|
419
|
+
const elements = await this.driver.findElements(parsedLocator);
|
|
420
|
+
return elements.length === 0;
|
|
421
|
+
});
|
|
422
|
+
await this.driver.wait(noElementPresentCondition, Number(timeout));
|
|
401
423
|
}
|
|
402
424
|
}
|
|
403
|
-
async doWaitForElementVisible(locator, timeout) {
|
|
404
|
-
await this.waitForElementVisible(locator, parseInt(timeout));
|
|
425
|
+
async doWaitForElementVisible(locator, timeout, commandObj = {}) {
|
|
426
|
+
await this.waitForElementVisible(locator, parseInt(timeout), commandObj.targetFallback);
|
|
405
427
|
}
|
|
406
428
|
async doWaitForElementNotVisible(locator, timeout) {
|
|
407
429
|
const parsedLocator = parseLocator(locator);
|
|
408
430
|
const elements = await this.driver.findElements(parsedLocator);
|
|
409
431
|
if (elements.length > 0) {
|
|
410
|
-
await this.wait(until.elementIsNotVisible(elements[0]), parseInt(timeout));
|
|
432
|
+
await this.driver.wait(until.elementIsNotVisible(elements[0]), parseInt(timeout));
|
|
411
433
|
}
|
|
412
434
|
}
|
|
435
|
+
async doWaitForText(locator, text, commandObj = {}) {
|
|
436
|
+
await this.waitForText(locator, text, commandObj.targetFallback);
|
|
437
|
+
}
|
|
413
438
|
// script commands
|
|
414
439
|
async doRunScript(script) {
|
|
415
440
|
await this.driver.executeScript(script.script, ...script.argv);
|
|
@@ -639,7 +664,7 @@ class WebDriverExecutor {
|
|
|
639
664
|
}
|
|
640
665
|
async doEcho(string) {
|
|
641
666
|
if (this.logger) {
|
|
642
|
-
this.logger.
|
|
667
|
+
this.logger.info(`echo: ${string}`);
|
|
643
668
|
}
|
|
644
669
|
}
|
|
645
670
|
async doPause(time) {
|
|
@@ -652,154 +677,64 @@ class WebDriverExecutor {
|
|
|
652
677
|
throw new Error('`set speed` is not supported in this run mode');
|
|
653
678
|
}
|
|
654
679
|
async evaluateConditional(script) {
|
|
655
|
-
const result = await this.driver.executeScript(`return (${script.script})`, ...script.argv);
|
|
680
|
+
const result = await this.driver.executeScript((0, preprocessors_1.interpolateScript)(`return (${script.script})`, this.variables).script, ...script.argv);
|
|
656
681
|
return {
|
|
657
682
|
value: !!result,
|
|
658
683
|
};
|
|
659
684
|
}
|
|
660
|
-
async
|
|
685
|
+
async elementIsLocated(locator, fallback = []) {
|
|
661
686
|
const elementLocator = parseLocator(locator);
|
|
662
687
|
try {
|
|
663
|
-
return
|
|
664
|
-
}
|
|
665
|
-
catch (
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
// try the next one
|
|
674
|
-
}
|
|
688
|
+
return await this.driver.findElement(elementLocator);
|
|
689
|
+
}
|
|
690
|
+
catch (e) {
|
|
691
|
+
for (let i = 0; i < fallback.length; i++) {
|
|
692
|
+
try {
|
|
693
|
+
let loc = parseLocator(fallback[i][0]);
|
|
694
|
+
return await this.driver.findElement(loc);
|
|
695
|
+
}
|
|
696
|
+
catch (e) {
|
|
697
|
+
// try the next one
|
|
675
698
|
}
|
|
676
699
|
}
|
|
677
|
-
throw err;
|
|
678
700
|
}
|
|
701
|
+
return null;
|
|
702
|
+
}
|
|
703
|
+
async waitForElement(locator, fallback = []) {
|
|
704
|
+
const locatorCondition = new WebElementCondition('for element to be located', async () => {
|
|
705
|
+
const el = await this.elementIsLocated(locator, fallback);
|
|
706
|
+
return el;
|
|
707
|
+
});
|
|
708
|
+
return await this.driver.wait(locatorCondition, this.implicitWait);
|
|
679
709
|
}
|
|
680
710
|
async isElementEditable(element) {
|
|
681
711
|
const { enabled, readonly } = await this.driver.executeScript('return { enabled: !arguments[0].disabled, readonly: arguments[0].readOnly };', element);
|
|
682
712
|
return enabled && !readonly;
|
|
683
713
|
}
|
|
684
|
-
async
|
|
685
|
-
const
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
const startTime = Date.now();
|
|
693
|
-
const element = (await this.wait(until.elementLocated(parseLocator(locator)), timeout));
|
|
694
|
-
const elapsed = Date.now() - startTime;
|
|
695
|
-
await this.wait(until.elementIsVisible(element), timeout - elapsed);
|
|
696
|
-
return element;
|
|
697
|
-
}
|
|
698
|
-
async wait(condition, timeout = 0, message = '', pollTimeout = POLL_TIMEOUT) {
|
|
699
|
-
if (typeof timeout !== 'number' || timeout < 0) {
|
|
700
|
-
throw TypeError('timeout must be a number >= 0: ' + timeout);
|
|
701
|
-
}
|
|
702
|
-
if (typeof pollTimeout !== 'number' || pollTimeout < 0) {
|
|
703
|
-
throw TypeError('pollTimeout must be a number >= 0: ' + pollTimeout);
|
|
704
|
-
}
|
|
705
|
-
if (isConditionPromiseLike(condition)) {
|
|
706
|
-
return new Promise((resolve, reject) => {
|
|
707
|
-
if (!timeout) {
|
|
708
|
-
resolve(condition);
|
|
709
|
-
return;
|
|
710
|
-
}
|
|
711
|
-
let start = Date.now();
|
|
712
|
-
let timer = setTimeout(function () {
|
|
713
|
-
timer = null;
|
|
714
|
-
reject(new TimeoutError((message ? `${message}\n` : '') +
|
|
715
|
-
'Timed out waiting for promise to resolve after ' +
|
|
716
|
-
(Date.now() - start) +
|
|
717
|
-
'ms'));
|
|
718
|
-
}, timeout);
|
|
719
|
-
const clearTimer = () => timer && clearTimeout(timer);
|
|
720
|
-
condition.then(function (value) {
|
|
721
|
-
clearTimer();
|
|
722
|
-
resolve(value);
|
|
723
|
-
}, function (error) {
|
|
724
|
-
clearTimer();
|
|
725
|
-
reject(error);
|
|
726
|
-
});
|
|
727
|
-
});
|
|
728
|
-
}
|
|
729
|
-
// @ts-expect-error
|
|
730
|
-
let fn = condition;
|
|
731
|
-
if (condition instanceof Condition) {
|
|
732
|
-
message = message || condition.description();
|
|
733
|
-
fn = condition.fn;
|
|
734
|
-
}
|
|
735
|
-
if (typeof fn !== 'function') {
|
|
736
|
-
throw TypeError('Wait condition must be a promise-like object, function, or a ' +
|
|
737
|
-
'Condition object');
|
|
738
|
-
}
|
|
739
|
-
const { driver } = this;
|
|
740
|
-
function evaluateCondition() {
|
|
741
|
-
return new Promise((resolve, reject) => {
|
|
742
|
-
try {
|
|
743
|
-
resolve(fn(driver));
|
|
744
|
-
}
|
|
745
|
-
catch (ex) {
|
|
746
|
-
reject(ex);
|
|
747
|
-
}
|
|
748
|
-
});
|
|
749
|
-
}
|
|
750
|
-
let result = new Promise((resolve, reject) => {
|
|
751
|
-
const startTime = Date.now();
|
|
752
|
-
let cancelled = false;
|
|
753
|
-
let resolveCancel;
|
|
754
|
-
const cancelPromise = new Promise((res) => {
|
|
755
|
-
resolveCancel = res;
|
|
756
|
-
});
|
|
757
|
-
this.cancellable = {
|
|
758
|
-
cancel: () => {
|
|
759
|
-
cancelled = true;
|
|
760
|
-
return cancelPromise;
|
|
761
|
-
},
|
|
762
|
-
};
|
|
763
|
-
const pollCondition = async () => {
|
|
764
|
-
evaluateCondition().then((value) => {
|
|
765
|
-
const elapsed = Date.now() - startTime;
|
|
766
|
-
if (cancelled) {
|
|
767
|
-
resolveCancel();
|
|
768
|
-
reject(new Error('Aborted by user'));
|
|
769
|
-
this.cancellable = undefined;
|
|
770
|
-
}
|
|
771
|
-
else if (value) {
|
|
772
|
-
resolve(value);
|
|
773
|
-
this.cancellable = undefined;
|
|
774
|
-
}
|
|
775
|
-
else if (timeout && elapsed >= timeout) {
|
|
776
|
-
reject(new TimeoutError((message ? `${message}\n` : '') +
|
|
777
|
-
`Wait timed out after ${elapsed}ms`));
|
|
778
|
-
this.cancellable = undefined;
|
|
779
|
-
}
|
|
780
|
-
else {
|
|
781
|
-
setTimeout(pollCondition, pollTimeout);
|
|
782
|
-
}
|
|
783
|
-
}, reject);
|
|
784
|
-
};
|
|
785
|
-
pollCondition();
|
|
714
|
+
async waitForElementVisible(locator, timeout, fallback = []) {
|
|
715
|
+
const visibleCondition = new WebElementCondition('for element to be visible', async () => {
|
|
716
|
+
const el = await this.elementIsLocated(locator, fallback);
|
|
717
|
+
if (!el)
|
|
718
|
+
return null;
|
|
719
|
+
if (!(await el.isDisplayed()))
|
|
720
|
+
return null;
|
|
721
|
+
return el;
|
|
786
722
|
});
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
723
|
+
return await this.driver.wait(visibleCondition, timeout);
|
|
724
|
+
}
|
|
725
|
+
async waitForText(locator, text, fallback = []) {
|
|
726
|
+
const timeout = this.implicitWait;
|
|
727
|
+
const textCondition = new Condition('for text to be present in element', async () => {
|
|
728
|
+
const el = await this.elementIsLocated(locator, fallback);
|
|
729
|
+
if (!el)
|
|
730
|
+
return null;
|
|
731
|
+
const elText = await el.getText();
|
|
732
|
+
return elText === text;
|
|
733
|
+
});
|
|
734
|
+
await this.driver.wait(textCondition, timeout);
|
|
797
735
|
}
|
|
798
736
|
}
|
|
799
737
|
exports.default = WebDriverExecutor;
|
|
800
|
-
function isConditionPromiseLike(condition) {
|
|
801
|
-
return condition && typeof condition.then === 'function';
|
|
802
|
-
}
|
|
803
738
|
WebDriverExecutor.prototype.doOpen = (0, preprocessors_1.composePreprocessors)(preprocessors_1.interpolateString, WebDriverExecutor.prototype.doOpen);
|
|
804
739
|
WebDriverExecutor.prototype.doSetWindowSize = (0, preprocessors_1.composePreprocessors)(preprocessors_1.interpolateString, WebDriverExecutor.prototype.doSetWindowSize);
|
|
805
740
|
WebDriverExecutor.prototype.doSelectWindow = (0, preprocessors_1.composePreprocessors)(preprocessors_1.interpolateString, WebDriverExecutor.prototype.doSelectWindow);
|
|
@@ -866,10 +801,28 @@ WebDriverExecutor.prototype.doAssert = (0, preprocessors_1.composePreprocessors)
|
|
|
866
801
|
WebDriverExecutor.prototype.doAssertAlert = (0, preprocessors_1.composePreprocessors)(preprocessors_1.interpolateString, null, WebDriverExecutor.prototype.doAssertAlert);
|
|
867
802
|
WebDriverExecutor.prototype.doAssertConfirmation = (0, preprocessors_1.composePreprocessors)(preprocessors_1.interpolateString, null, WebDriverExecutor.prototype.doAssertConfirmation);
|
|
868
803
|
WebDriverExecutor.prototype.doAssertEditable = (0, preprocessors_1.composePreprocessors)(preprocessors_1.interpolateString, null, { targetFallback: (0, preprocessors_1.preprocessArray)(preprocessors_1.interpolateString) }, WebDriverExecutor.prototype.doAssertEditable);
|
|
804
|
+
WebDriverExecutor.prototype.doAssertElementPresent = (0, preprocessors_1.composePreprocessors)(preprocessors_1.interpolateString, null, WebDriverExecutor.prototype.doAssertElementPresent);
|
|
805
|
+
WebDriverExecutor.prototype.doAssertElementNotPresent = (0, preprocessors_1.composePreprocessors)(preprocessors_1.interpolateString, null, WebDriverExecutor.prototype.doAssertElementNotPresent);
|
|
869
806
|
WebDriverExecutor.prototype.doAssertNotEditable = (0, preprocessors_1.composePreprocessors)(preprocessors_1.interpolateString, null, { targetFallback: (0, preprocessors_1.preprocessArray)(preprocessors_1.interpolateString) }, WebDriverExecutor.prototype.doAssertNotEditable);
|
|
870
807
|
WebDriverExecutor.prototype.doAssertPrompt = (0, preprocessors_1.composePreprocessors)(preprocessors_1.interpolateString, null, WebDriverExecutor.prototype.doAssertPrompt);
|
|
808
|
+
WebDriverExecutor.prototype.doAssertSelectedLabel = (0, preprocessors_1.composePreprocessors)(preprocessors_1.interpolateString, preprocessors_1.interpolateString, { targetFallback: (0, preprocessors_1.preprocessArray)(preprocessors_1.interpolateString) }, WebDriverExecutor.prototype.doAssertSelectedLabel);
|
|
871
809
|
WebDriverExecutor.prototype.doAssertText = (0, preprocessors_1.composePreprocessors)(preprocessors_1.interpolateString, preprocessors_1.interpolateString, WebDriverExecutor.prototype.doAssertText);
|
|
810
|
+
WebDriverExecutor.prototype.doAssertTitle = (0, preprocessors_1.composePreprocessors)(preprocessors_1.interpolateString, null, WebDriverExecutor.prototype.doAssertTitle);
|
|
811
|
+
WebDriverExecutor.prototype.doAssertValue = (0, preprocessors_1.composePreprocessors)(preprocessors_1.interpolateString, preprocessors_1.interpolateString, { targetFallback: (0, preprocessors_1.preprocessArray)(preprocessors_1.interpolateString) }, WebDriverExecutor.prototype.doAssertValue);
|
|
872
812
|
WebDriverExecutor.prototype.doEcho = (0, preprocessors_1.composePreprocessors)(preprocessors_1.interpolateString, WebDriverExecutor.prototype.doEcho);
|
|
813
|
+
const waitCommands = [
|
|
814
|
+
'doWaitForElementEditable',
|
|
815
|
+
'doWaitForElementNotEditable',
|
|
816
|
+
'doWaitForElementPresent',
|
|
817
|
+
'doWaitForElementNotPresent',
|
|
818
|
+
'doWaitForElementVisible',
|
|
819
|
+
'doWaitForElementNotVisible',
|
|
820
|
+
'doWaitForText',
|
|
821
|
+
];
|
|
822
|
+
waitCommands.forEach((cmd) => {
|
|
823
|
+
// @ts-expect-error - Whatever who cares
|
|
824
|
+
WebDriverExecutor.prototype[cmd] = (0, preprocessors_1.composePreprocessors)(preprocessors_1.interpolateString, preprocessors_1.interpolateString, WebDriverExecutor.prototype[cmd]);
|
|
825
|
+
});
|
|
873
826
|
function createVerifyCommands(Executor) {
|
|
874
827
|
// @ts-expect-error
|
|
875
828
|
Object.getOwnPropertyNames(Executor.prototype)
|