@camperaid/watest 2.4.7 → 2.4.9
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/.prettierrc.js +1 -3
- package/.watestrc.js +7 -3
- package/bin/watest.js +3 -8
- package/core/base.js +83 -69
- package/core/core.js +25 -46
- package/core/format.js +96 -56
- package/core/process_args.js +1 -5
- package/core/series.js +62 -57
- package/core/settings.js +32 -32
- package/core/spawn.js +14 -21
- package/core/util.js +12 -19
- package/esling.config.js +0 -0
- package/eslint.config.js +27 -0
- package/index.js +11 -17
- package/interfaces/logger.js +1 -3
- package/interfaces/servicer.js +1 -3
- package/logging/filestream.js +3 -7
- package/logging/logging.js +5 -11
- package/logging/logpipe.js +21 -21
- package/package.json +12 -11
- package/tests/base/t_api.js +3 -6
- package/tests/base/t_contains.js +12 -12
- package/tests/base/t_core.js +11 -8
- package/tests/base/t_format.js +13 -14
- package/tests/base/t_is.js +9 -11
- package/tests/base/t_is_object.js +23 -25
- package/tests/base/t_is_primitive.js +12 -14
- package/tests/base/t_is_string.js +6 -8
- package/tests/base/t_ok.js +4 -6
- package/tests/base/t_stringify.js +6 -8
- package/tests/base/t_test_.js +3 -5
- package/tests/base/t_throws.js +82 -18
- package/tests/base/test.js +14 -21
- package/tests/e2e/samples/{loader/.watestrc.cjs → folder/.watestrc.js} +1 -1
- package/tests/e2e/samples/folder/package-lock.json +1019 -5940
- package/tests/e2e/samples/folder/package.json +3 -2
- package/tests/e2e/samples/folder/tests/meta.js +1 -1
- package/tests/e2e/samples/folder/tests/unit/t_test.js +3 -3
- package/tests/e2e/samples/{loader_mixed/.watestrc.cjs → loader/.watestrc.js} +1 -1
- package/tests/e2e/samples/loader/package-lock.json +1751 -28
- package/tests/e2e/samples/loader/package.json +2 -2
- package/tests/e2e/samples/loader/tests/meta.js +2 -2
- package/tests/e2e/samples/{folder/.watestrc.cjs → loader_mixed/.watestrc.js} +1 -1
- package/tests/e2e/samples/loader_mixed/package-lock.json +1751 -28
- package/tests/e2e/samples/loader_mixed/tests/ui/meta.js +2 -2
- package/tests/e2e/samples/loader_multiple/{.watestrc.cjs → .watestrc.js} +1 -1
- package/tests/e2e/samples/loader_multiple/package-lock.json +1751 -28
- package/tests/e2e/samples/loader_multiple/package.json +2 -2
- package/tests/e2e/samples/loader_multiple/tests/base/meta.js +2 -2
- package/tests/e2e/samples/loader_multiple/tests/core/meta.js +2 -2
- package/tests/e2e/samples/single/.watestrc.js +5 -0
- package/tests/e2e/samples/single/package-lock.json +1017 -5938
- package/tests/e2e/samples/single/package.json +5 -2
- package/tests/e2e/samples/wd_mixed/{.watestrc.cjs → .watestrc.js} +1 -1
- package/tests/e2e/samples/wd_mixed/package-lock.json +779 -4862
- package/tests/e2e/samples/wd_mixed/package.json +2 -2
- package/tests/e2e/samples/wd_single/{.watestrc.cjs → .watestrc.js} +1 -1
- package/tests/e2e/samples/wd_single/package-lock.json +779 -4862
- package/tests/e2e/samples/wd_single/package.json +2 -2
- package/tests/e2e/t_folder.js +4 -6
- package/tests/e2e/t_loader.js +4 -6
- package/tests/e2e/t_loader_mixed.js +4 -6
- package/tests/e2e/t_loader_multiple.js +4 -6
- package/tests/e2e/t_loader_multiple_patterns.js +4 -6
- package/tests/e2e/t_single.js +4 -6
- package/tests/e2e/t_wd_firefox.js +4 -6
- package/tests/e2e/t_wd_firefox_chrome.js +4 -6
- package/tests/e2e/t_wd_firefox_chrome_pattern.js +4 -6
- package/tests/e2e/t_wd_mixed_firefox.js +4 -6
- package/tests/e2e/t_wd_mixed_firefox_chrome.js +4 -6
- package/tests/e2e/test.js +15 -16
- package/tests/meta.js +1 -3
- package/tests/series/build/t_adjust_names.js +4 -6
- package/tests/series/build/t_adjust_names_webdriver.js +6 -10
- package/tests/series/build/t_expected_failures.js +4 -6
- package/tests/series/build/t_loader.js +4 -6
- package/tests/series/build/t_loader_mixed.js +4 -6
- package/tests/series/build/t_mixed.js +4 -6
- package/tests/series/build/t_nested.js +4 -6
- package/tests/series/build/t_patterns_loader.js +4 -6
- package/tests/series/build/t_patterns_webdriver.js +4 -6
- package/tests/series/build/t_webdriver.js +4 -6
- package/tests/series/build/t_webdriver_firefox_mixed.js +4 -6
- package/tests/series/build/t_webdriver_nested.js +4 -6
- package/tests/series/build/t_webdriver_services.js +4 -6
- package/tests/series/generic/t_failures_info.js +9 -12
- package/tests/series/loader/meta.mjs +2 -2
- package/tests/series/logging/t_failures.js +18 -20
- package/tests/series/logging/t_success.js +15 -17
- package/tests/series/logging/t_verify.js +17 -14
- package/tests/series/meta.js +1 -3
- package/tests/series/mock_series.js +7 -13
- package/tests/series/perform/t_failure.js +4 -6
- package/tests/series/perform/t_failure_notest.js +4 -6
- package/tests/series/perform/t_intermittent.js +5 -7
- package/tests/series/perform/t_intermittent_global.js +4 -6
- package/tests/series/perform/t_missing_perma.js +5 -7
- package/tests/series/perform/t_nested.js +4 -10
- package/tests/series/perform/t_perma.js +4 -6
- package/tests/series/perform/t_success.js +5 -11
- package/tests/series/run/t_debunk_failure.js +7 -6
- package/tests/series/run/t_debunk_success.js +7 -6
- package/tests/series/run/t_nested.js +7 -6
- package/tests/series/run/t_verify.js +7 -6
- package/tests/series/run/t_verify_webdriver.js +7 -6
- package/tests/series/test.js +29 -40
- package/tests/webdriver/meta.js +1 -3
- package/tests/webdriver/t_app_driver.js +3 -5
- package/tests/webdriver/t_app_driver_selectors.js +3 -5
- package/tests/webdriver/t_attribute.js +5 -7
- package/tests/webdriver/t_attribute_all.js +6 -8
- package/tests/webdriver/t_doubleclick.js +3 -5
- package/tests/webdriver/t_doubleclickat.js +3 -5
- package/tests/webdriver/t_execute.js +4 -6
- package/tests/webdriver/t_if_has_elements.js +6 -8
- package/tests/webdriver/t_if_no_elements.js +6 -8
- package/tests/webdriver/t_no_elements_or_not_visible.js +7 -9
- package/tests/webdriver/t_properties.js +11 -13
- package/tests/webdriver/t_script.js +8 -10
- package/tests/webdriver/t_select_all.js +6 -11
- package/tests/webdriver/t_selection.js +4 -6
- package/tests/webdriver/t_text.js +12 -14
- package/tests/webdriver/t_text_all.js +6 -8
- package/tests/webdriver/test.js +32 -41
- package/webdriver/app_driver.js +28 -19
- package/webdriver/control_driver.js +4 -8
- package/webdriver/driver.js +64 -63
- package/webdriver/driver_base.js +52 -62
- package/webdriver/session.js +6 -11
- package/webdriver/util.js +7 -8
- package/.eslintrc.js +0 -45
- package/index.mjs +0 -5
- package/tests/e2e/samples/folder/node_modules/.package-lock.json +0 -3871
- package/tests/e2e/samples/loader/node_modules/.package-lock.json +0 -36
- package/tests/e2e/samples/loader_mixed/node_modules/.package-lock.json +0 -36
- package/tests/e2e/samples/loader_multiple/node_modules/.package-lock.json +0 -36
- package/tests/e2e/samples/single/.watestrc.cjs +0 -5
- package/tests/e2e/samples/single/node_modules/.package-lock.json +0 -3871
- package/tests/e2e/samples/wd_mixed/node_modules/.package-lock.json +0 -3586
- package/tests/e2e/samples/wd_single/node_modules/.package-lock.json +0 -3586
package/webdriver/driver_base.js
CHANGED
|
@@ -1,42 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const { is } = require('../core/base.js');
|
|
6
|
-
const {
|
|
7
|
-
core,
|
|
8
|
-
fail,
|
|
9
|
-
todo,
|
|
10
|
-
warn,
|
|
1
|
+
import settings from '../core/settings.js';
|
|
2
|
+
import { is } from '../core/base.js';
|
|
3
|
+
import {
|
|
11
4
|
assert,
|
|
5
|
+
fail,
|
|
12
6
|
info,
|
|
13
7
|
success,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
testflow,
|
|
9
|
+
todo,
|
|
10
|
+
warn,
|
|
11
|
+
} from '../core/core.js';
|
|
12
|
+
import { stringify } from '../core/util.js';
|
|
13
|
+
import { log, log_error } from '../logging/logging.js';
|
|
14
|
+
import { LogPipe } from '../logging/logpipe.js';
|
|
15
|
+
import { define_class_promise } from './util.js';
|
|
16
|
+
import {
|
|
22
17
|
Browser,
|
|
23
18
|
Builder,
|
|
24
19
|
By,
|
|
25
20
|
Condition,
|
|
26
21
|
error,
|
|
27
22
|
until,
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const chrome = require('selenium-webdriver/chrome');
|
|
23
|
+
} from 'selenium-webdriver';
|
|
24
|
+
import firefox from 'selenium-webdriver/firefox.js';
|
|
25
|
+
import chrome from 'selenium-webdriver/chrome.js';
|
|
32
26
|
|
|
33
27
|
function getChromeOptions() {
|
|
34
28
|
const chromeOptions = new chrome.Options().windowSize({
|
|
35
|
-
width:
|
|
36
|
-
height:
|
|
29
|
+
width: settings.webdriver_window_width,
|
|
30
|
+
height: settings.webdriver_window_height,
|
|
37
31
|
});
|
|
38
32
|
if (settings.webdriver_headless) {
|
|
39
|
-
chromeOptions.headless
|
|
33
|
+
chromeOptions.addArguments('headless');
|
|
40
34
|
}
|
|
41
35
|
if (settings.webdriver == 'chrome-mobile') {
|
|
42
36
|
chromeOptions.setMobileEmulation({
|
|
@@ -51,8 +45,8 @@ function getFirefoxArgs() {
|
|
|
51
45
|
}
|
|
52
46
|
|
|
53
47
|
const defaultTimeout = 10;
|
|
54
|
-
const getTimeout = () => (core.getTimeout() || defaultTimeout) * 1000;
|
|
55
|
-
const getTimeoutOnFailure = () => (core.getTimeout() || 0) * 1000; // use non zero values for failure debugging
|
|
48
|
+
const getTimeout = () => (testflow.core.getTimeout() || defaultTimeout) * 1000;
|
|
49
|
+
const getTimeoutOnFailure = () => (testflow.core.getTimeout() || 0) * 1000; // use non zero values for failure debugging
|
|
56
50
|
const browserLogLevel = 'ALL'; // 'WARNING'
|
|
57
51
|
|
|
58
52
|
function warn_if_stale(e, msg) {
|
|
@@ -80,7 +74,7 @@ class NoElementsError extends Error {
|
|
|
80
74
|
class UnexpectedElementCountError extends Error {
|
|
81
75
|
constructor(selector, gotCount, expectedCount) {
|
|
82
76
|
super(
|
|
83
|
-
`ambigious '${selector}' selector, got ${gotCount} elements, expected ${expectedCount}
|
|
77
|
+
`ambigious '${selector}' selector, got ${gotCount} elements, expected ${expectedCount}`,
|
|
84
78
|
);
|
|
85
79
|
}
|
|
86
80
|
}
|
|
@@ -226,7 +220,7 @@ class DriverBase {
|
|
|
226
220
|
msg,
|
|
227
221
|
`Expected: ${stringify(expected)}`,
|
|
228
222
|
test,
|
|
229
|
-
is_matched
|
|
223
|
+
is_matched,
|
|
230
224
|
);
|
|
231
225
|
}
|
|
232
226
|
|
|
@@ -242,12 +236,12 @@ class DriverBase {
|
|
|
242
236
|
this.dvr
|
|
243
237
|
.wait(until.elementsLocated(By.css(selector)), getTimeout())
|
|
244
238
|
.then(els =>
|
|
245
|
-
this.dvr.executeAsyncScript(this.wrapScript(script), els[0])
|
|
239
|
+
this.dvr.executeAsyncScript(this.wrapScript(script), els[0]),
|
|
246
240
|
),
|
|
247
241
|
msg,
|
|
248
242
|
`Selector: '${selector}'`,
|
|
249
243
|
test,
|
|
250
|
-
is_matched
|
|
244
|
+
is_matched,
|
|
251
245
|
);
|
|
252
246
|
}
|
|
253
247
|
|
|
@@ -297,8 +291,8 @@ class DriverBase {
|
|
|
297
291
|
els_and_tags.map(([el, tag]) =>
|
|
298
292
|
/^(textarea|input)$/i.test(tag)
|
|
299
293
|
? this.dvr.executeScript(`return arguments[0].value;`, el)
|
|
300
|
-
: el.getText()
|
|
301
|
-
)
|
|
294
|
+
: el.getText(),
|
|
295
|
+
),
|
|
302
296
|
).then(list => list.map(item => item.replace(/\s+/g, ' ').trim())),
|
|
303
297
|
test,
|
|
304
298
|
is_matched: got =>
|
|
@@ -338,7 +332,7 @@ class DriverBase {
|
|
|
338
332
|
Promise.all(els.map(el => Promise.all([el, el.getTagName()])))
|
|
339
333
|
.then(els_and_tags => get_text(els_and_tags))
|
|
340
334
|
.catch(e =>
|
|
341
|
-
warn_if_stale(e, `on '${selector}' element text retrieval`)
|
|
335
|
+
warn_if_stale(e, `on '${selector}' element text retrieval`),
|
|
342
336
|
),
|
|
343
337
|
get_result_description: 'tag name',
|
|
344
338
|
test,
|
|
@@ -441,7 +435,7 @@ class DriverBase {
|
|
|
441
435
|
if (e instanceof error.TimeoutError) {
|
|
442
436
|
if (
|
|
443
437
|
e.message.startsWith(
|
|
444
|
-
'Waiting for at least one element to be located'
|
|
438
|
+
'Waiting for at least one element to be located',
|
|
445
439
|
)
|
|
446
440
|
) {
|
|
447
441
|
throw new NoElementsError(selector);
|
|
@@ -454,7 +448,7 @@ class DriverBase {
|
|
|
454
448
|
throw new UnexpectedElementCountError(
|
|
455
449
|
selector,
|
|
456
450
|
els.length,
|
|
457
|
-
count
|
|
451
|
+
count,
|
|
458
452
|
);
|
|
459
453
|
}
|
|
460
454
|
return els;
|
|
@@ -463,13 +457,13 @@ class DriverBase {
|
|
|
463
457
|
.catch(e =>
|
|
464
458
|
warn_if_stale(
|
|
465
459
|
e,
|
|
466
|
-
`on '${selector}' ${get_result_description} retrieval
|
|
467
|
-
)
|
|
460
|
+
`on '${selector}' ${get_result_description} retrieval`,
|
|
461
|
+
),
|
|
468
462
|
),
|
|
469
463
|
msg,
|
|
470
464
|
`Expected: ${expected}. Selector: '${selector}'`,
|
|
471
465
|
test,
|
|
472
|
-
is_matched
|
|
466
|
+
is_matched,
|
|
473
467
|
);
|
|
474
468
|
}
|
|
475
469
|
|
|
@@ -480,7 +474,7 @@ class DriverBase {
|
|
|
480
474
|
selector,
|
|
481
475
|
msg,
|
|
482
476
|
{ do_not_fail_if_not_unique, throw_on_fail, no_click_check },
|
|
483
|
-
click_func
|
|
477
|
+
click_func,
|
|
484
478
|
) {
|
|
485
479
|
let listenClick = `
|
|
486
480
|
window.__selenium_lastClick = new Promise(resolve => {
|
|
@@ -583,13 +577,13 @@ class DriverBase {
|
|
|
583
577
|
.executeAsyncScript(listenClick, selector)
|
|
584
578
|
.then(() => click_func(el))
|
|
585
579
|
.then(
|
|
586
|
-
() => !no_click_check && this.dvr.executeAsyncScript(checkClick)
|
|
580
|
+
() => !no_click_check && this.dvr.executeAsyncScript(checkClick),
|
|
587
581
|
)
|
|
588
582
|
.then(r => {
|
|
589
583
|
if (!r) {
|
|
590
584
|
if (!no_click_check) {
|
|
591
585
|
info(
|
|
592
|
-
`No click event result. The webpage must be navigated out
|
|
586
|
+
`No click event result. The webpage must be navigated out.`,
|
|
593
587
|
);
|
|
594
588
|
}
|
|
595
589
|
return;
|
|
@@ -600,7 +594,7 @@ class DriverBase {
|
|
|
600
594
|
let targetRect = rtos(r.targetRect);
|
|
601
595
|
let elRect = rtos(r.elRect);
|
|
602
596
|
info(
|
|
603
|
-
`clicked at ${r.target} at (${r.x}, ${r.y}), target's rect: ${targetRect}; dispatched to: ${r.el}, rect: ${elRect}}
|
|
597
|
+
`clicked at ${r.target} at (${r.x}, ${r.y}), target's rect: ${targetRect}; dispatched to: ${r.el}, rect: ${elRect}}`,
|
|
604
598
|
);
|
|
605
599
|
let x_before = r.x < r.elRect.x;
|
|
606
600
|
let x_after = r.x > r.elRect.x + r.elRect.width;
|
|
@@ -624,15 +618,15 @@ class DriverBase {
|
|
|
624
618
|
let xs = `x ${ptos(
|
|
625
619
|
r.elRect.x,
|
|
626
620
|
r.elRect.x + r.elRect.width,
|
|
627
|
-
r.x
|
|
621
|
+
r.x,
|
|
628
622
|
)}`;
|
|
629
623
|
let ys = `y ${ptos(
|
|
630
624
|
r.elRect.y,
|
|
631
625
|
r.elRect.y + r.elRect.height,
|
|
632
|
-
r.y
|
|
626
|
+
r.y,
|
|
633
627
|
)}}`;
|
|
634
628
|
((throw_on_fail && todo) || warn)(
|
|
635
|
-
`Unexpected element clicked: ${xs}, ${ys}
|
|
629
|
+
`Unexpected element clicked: ${xs}, ${ys}`,
|
|
636
630
|
);
|
|
637
631
|
if (throw_on_fail) {
|
|
638
632
|
throw new Error(`Expected failure`);
|
|
@@ -644,7 +638,7 @@ class DriverBase {
|
|
|
644
638
|
msg,
|
|
645
639
|
null, // failure_details
|
|
646
640
|
do_not_fail_if_not_unique,
|
|
647
|
-
throw_on_fail
|
|
641
|
+
throw_on_fail,
|
|
648
642
|
);
|
|
649
643
|
}
|
|
650
644
|
|
|
@@ -665,13 +659,13 @@ class DriverBase {
|
|
|
665
659
|
chain().then(v => {
|
|
666
660
|
breadcrumbs.got = v;
|
|
667
661
|
return criteria(v);
|
|
668
|
-
})
|
|
662
|
+
}),
|
|
669
663
|
);
|
|
670
664
|
|
|
671
665
|
return this.run(
|
|
672
666
|
() => this.waitForCondition(cond, () => breadcrumbs),
|
|
673
667
|
msg,
|
|
674
|
-
details_msg
|
|
668
|
+
details_msg,
|
|
675
669
|
);
|
|
676
670
|
}
|
|
677
671
|
|
|
@@ -692,7 +686,7 @@ class DriverBase {
|
|
|
692
686
|
}
|
|
693
687
|
}
|
|
694
688
|
throw e;
|
|
695
|
-
}
|
|
689
|
+
},
|
|
696
690
|
);
|
|
697
691
|
}
|
|
698
692
|
|
|
@@ -714,7 +708,7 @@ class DriverBase {
|
|
|
714
708
|
is(
|
|
715
709
|
breadcrumbs[i].got,
|
|
716
710
|
breadcrumbs[i].expected,
|
|
717
|
-
`${breadcrumbs[i].msg} at ${i} index
|
|
711
|
+
`${breadcrumbs[i].msg} at ${i} index`,
|
|
718
712
|
);
|
|
719
713
|
}
|
|
720
714
|
}
|
|
@@ -746,7 +740,7 @@ class DriverBase {
|
|
|
746
740
|
msg,
|
|
747
741
|
failure_details,
|
|
748
742
|
do_not_fail_if_not_unique,
|
|
749
|
-
expected_failure
|
|
743
|
+
expected_failure,
|
|
750
744
|
) {
|
|
751
745
|
assert(selector, `No selector is provided`);
|
|
752
746
|
assert(func);
|
|
@@ -765,7 +759,7 @@ class DriverBase {
|
|
|
765
759
|
msg,
|
|
766
760
|
`Selector: '${selector}'`,
|
|
767
761
|
failure_details,
|
|
768
|
-
expected_failure
|
|
762
|
+
expected_failure,
|
|
769
763
|
);
|
|
770
764
|
}
|
|
771
765
|
|
|
@@ -787,7 +781,7 @@ class DriverBase {
|
|
|
787
781
|
// and thus is a real performance bummer.
|
|
788
782
|
let message = entry.message.replace(
|
|
789
783
|
/(data:\S+?)(\s|:)(\d+):(\d+)/g,
|
|
790
|
-
(match, p1, p2, p3, p4) => `dataurl-placeholder:${p3}:${p4}
|
|
784
|
+
(match, p1, p2, p3, p4) => `dataurl-placeholder:${p3}:${p4}`,
|
|
791
785
|
);
|
|
792
786
|
log(`[${entry.level.name}] ${message}`);
|
|
793
787
|
}
|
|
@@ -878,7 +872,7 @@ class DriverBase {
|
|
|
878
872
|
throw new TestExecutionError(`Test failed`);
|
|
879
873
|
});
|
|
880
874
|
});
|
|
881
|
-
})
|
|
875
|
+
}),
|
|
882
876
|
);
|
|
883
877
|
}
|
|
884
878
|
|
|
@@ -889,7 +883,7 @@ class DriverBase {
|
|
|
889
883
|
let chainLink = new this.constructor.CtorPromise(
|
|
890
884
|
this.p.then(link),
|
|
891
885
|
this.dvr,
|
|
892
|
-
this.options
|
|
886
|
+
this.options,
|
|
893
887
|
);
|
|
894
888
|
|
|
895
889
|
this.dvr.lastChainLink = chainLink;
|
|
@@ -903,7 +897,7 @@ class DriverBase {
|
|
|
903
897
|
if (this.dvr.lastChainLink == chainLink) {
|
|
904
898
|
this.dvr.lastChainLink = null;
|
|
905
899
|
}
|
|
906
|
-
}
|
|
900
|
+
},
|
|
907
901
|
);
|
|
908
902
|
return chainLink;
|
|
909
903
|
}
|
|
@@ -927,8 +921,4 @@ class DriverBase {
|
|
|
927
921
|
}
|
|
928
922
|
}
|
|
929
923
|
|
|
930
|
-
|
|
931
|
-
DriverBase,
|
|
932
|
-
getTimeout,
|
|
933
|
-
TestExecutionError,
|
|
934
|
-
};
|
|
924
|
+
export { DriverBase, getTimeout, TestExecutionError };
|
package/webdriver/session.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const { log, log_error } = require('../logging/logging.js');
|
|
5
|
-
const { Driver } = require('./driver.js');
|
|
1
|
+
import { assert, group, fail, info } from '../core/core.js';
|
|
2
|
+
import { log, log_error } from '../logging/logging.js';
|
|
3
|
+
import { Driver } from './driver.js';
|
|
6
4
|
|
|
7
5
|
let active_sessions = [];
|
|
8
6
|
|
|
@@ -137,8 +135,8 @@ async function start_session(arg1, arg2) {
|
|
|
137
135
|
if (libs) {
|
|
138
136
|
await Promise.all(
|
|
139
137
|
libs.map(lib =>
|
|
140
|
-
import(lib).then(lib_module => lib_module.loadIntoSession(s))
|
|
141
|
-
)
|
|
138
|
+
import(lib).then(lib_module => lib_module.loadIntoSession(s)),
|
|
139
|
+
),
|
|
142
140
|
);
|
|
143
141
|
}
|
|
144
142
|
|
|
@@ -181,7 +179,4 @@ const scope = (arg1, arg2, arg3) => async () => {
|
|
|
181
179
|
}
|
|
182
180
|
};
|
|
183
181
|
|
|
184
|
-
|
|
185
|
-
start_session,
|
|
186
|
-
scope,
|
|
187
|
-
};
|
|
182
|
+
export { start_session, scope };
|
package/webdriver/util.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const { assert } = require('../core/core.js');
|
|
1
|
+
import { assert } from '../core/core.js';
|
|
4
2
|
|
|
5
3
|
/**
|
|
6
4
|
* Defines a forward-proxy promise for a given class. For a class T
|
|
7
5
|
* the TPromise class is created.
|
|
8
6
|
*/
|
|
9
|
-
|
|
7
|
+
export function define_class_promise(
|
|
10
8
|
T,
|
|
11
|
-
Resolvent = (v, ...args) => new T(...args, v)
|
|
12
|
-
)
|
|
13
|
-
class extends T {
|
|
9
|
+
Resolvent = (v, ...args) => new T(...args, v),
|
|
10
|
+
) {
|
|
11
|
+
return class extends T {
|
|
14
12
|
constructor(p, ...args) {
|
|
15
13
|
assert(p, 'No promise for promise class');
|
|
16
14
|
super(...args);
|
|
@@ -28,7 +26,7 @@ module.exports.define_class_promise = (
|
|
|
28
26
|
}
|
|
29
27
|
throw e;
|
|
30
28
|
}),
|
|
31
|
-
...this.args
|
|
29
|
+
...this.args,
|
|
32
30
|
);
|
|
33
31
|
}
|
|
34
32
|
|
|
@@ -36,3 +34,4 @@ module.exports.define_class_promise = (
|
|
|
36
34
|
return new this.constructor(this.p.catch(reject), ...this.args);
|
|
37
35
|
}
|
|
38
36
|
};
|
|
37
|
+
}
|
package/.eslintrc.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
env: {
|
|
5
|
-
es6: true,
|
|
6
|
-
node: true,
|
|
7
|
-
},
|
|
8
|
-
extends: ['eslint:recommended', 'plugin:node/recommended'],
|
|
9
|
-
parserOptions: {
|
|
10
|
-
ecmaVersion: 2021,
|
|
11
|
-
},
|
|
12
|
-
rules: {
|
|
13
|
-
'node/no-unsupported-features/es-syntax': [
|
|
14
|
-
'error',
|
|
15
|
-
{ ignores: ['dynamicImport'] },
|
|
16
|
-
],
|
|
17
|
-
},
|
|
18
|
-
overrides: [
|
|
19
|
-
{
|
|
20
|
-
files: ['bin/watest.js'],
|
|
21
|
-
rules: {
|
|
22
|
-
'no-process-exit': 'off',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
files: ['tests/e2e/samples/**'],
|
|
27
|
-
settings: {
|
|
28
|
-
node: {
|
|
29
|
-
allowModules: ['watest'],
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
parserOptions: {
|
|
33
|
-
sourceType: 'module',
|
|
34
|
-
},
|
|
35
|
-
rules: {
|
|
36
|
-
'node/no-unsupported-features/es-syntax': [
|
|
37
|
-
'error',
|
|
38
|
-
{
|
|
39
|
-
ignores: ['modules'],
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
};
|