expect-webdriverio 7.0.0 → 8.0.0-alpha.0
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/README.md +7 -3
- package/jasmine-wdio-expect-async.d.ts +1 -1
- package/lib/constants.js +0 -6
- package/lib/index.js +1 -13
- package/lib/jasmineUtils.js +2 -2
- package/lib/matchers/asymmetrics/oneOf.js +2 -2
- package/lib/matchers/browser/toHaveClipboardText.js +7 -3
- package/lib/matchers/browser/toHaveLocalStorageItem.js +1 -11
- package/lib/matchers/element/toBeClickable.js +3 -2
- package/lib/matchers/element/toBeDisabled.js +3 -2
- package/lib/matchers/element/toBeDisplayed.js +3 -2
- package/lib/matchers/element/toBeDisplayedInViewport.js +3 -2
- package/lib/matchers/element/toBeEnabled.js +3 -2
- package/lib/matchers/element/toBeExisting.js +5 -2
- package/lib/matchers/element/toBeFocused.js +3 -2
- package/lib/matchers/element/toBeSelected.js +4 -4
- package/lib/matchers/element/toHaveAttribute.js +2 -14
- package/lib/matchers/element/toHaveChildren.js +7 -13
- package/lib/matchers/element/toHaveComputedLabel.js +0 -2
- package/lib/matchers/element/toHaveComputedRole.js +0 -2
- package/lib/matchers/element/toHaveElementClass.js +3 -8
- package/lib/matchers/element/toHaveElementProperty.js +0 -5
- package/lib/matchers/element/toHaveHTML.js +3 -5
- package/lib/matchers/element/toHaveHeight.js +4 -5
- package/lib/matchers/element/toHaveHref.js +6 -3
- package/lib/matchers/element/toHaveId.js +3 -2
- package/lib/matchers/element/toHaveSize.js +0 -1
- package/lib/matchers/element/toHaveStyle.js +0 -1
- package/lib/matchers/element/toHaveText.js +2 -5
- package/lib/matchers/element/toHaveValue.js +1 -1
- package/lib/matchers/element/toHaveWidth.js +4 -5
- package/lib/matchers/elements/toBeElementsArrayOfSize.js +9 -11
- package/lib/matchers/mock/toBeRequested.js +1 -1
- package/lib/matchers/mock/toBeRequestedTimes.js +6 -6
- package/lib/matchers/mock/toBeRequestedWith.js +0 -3
- package/lib/matchers.js +32 -32
- package/lib/snapshot.js +1 -8
- package/lib/tsconfig.build.tsbuildinfo +1 -1
- package/lib/util/elementsUtil.js +3 -2
- package/lib/util/executeBrowserCommand.js +2 -2
- package/lib/util/executeCommand.js +2 -41
- package/lib/util/formatMessage.js +4 -4
- package/lib/util/multiRemoteUtils.js +9 -1
- package/lib/util/numberOptionsUtil.js +15 -26
- package/lib/utils.js +10 -110
- package/package.json +36 -39
- package/types/expect-global.d.ts +1 -2
- package/types/expect-webdriverio.d.ts +31 -222
|
@@ -21,7 +21,7 @@ type ExpectLibAsyncExpectationResult = import('expect').AsyncExpectationResult
|
|
|
21
21
|
type ExpectLibExpectationResult = import('expect').ExpectationResult
|
|
22
22
|
type ExpectLibMatcherContext = import('expect').MatcherContext
|
|
23
23
|
type MatchersObject = Parameters<typeof import('expect').expect.extend>[0]
|
|
24
|
-
type ExpectLibAnything = ReturnType<typeof expect.any> | ReturnType<typeof expect.anything>
|
|
24
|
+
type ExpectLibAnything = ReturnType<typeof import('expect').expect.any> | ReturnType<typeof import('expect').expect.anything>
|
|
25
25
|
type WdioGetHTMLOptions = NonNullable<Parameters<WebdriverIO.Element['getHTML']>[0]>
|
|
26
26
|
|
|
27
27
|
// Extracted from the expect library, this is the type of the matcher function used in the expect library.
|
|
@@ -206,29 +206,32 @@ interface WdioBrowserMatchers<_R, ActualT>{
|
|
|
206
206
|
*/
|
|
207
207
|
{
|
|
208
208
|
/**
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
* Only check that the item exists.
|
|
210
|
+
* Use `toHaveLocalStorageItem(key, expect.anything(), options)` to check it with options.
|
|
211
|
+
*/
|
|
212
|
+
(key: string): Promise<void>
|
|
211
213
|
(
|
|
212
214
|
key: string,
|
|
213
|
-
expectedValue:
|
|
215
|
+
expectedValue: MaybeOneOf<string | RegExp | ExpectWebdriverIO.PartialMatcher<string> | ExpectWebdriverIO.PartialMatcherAnything>,
|
|
214
216
|
options?: ExpectWebdriverIO.StringOptions
|
|
215
|
-
): Promise<void
|
|
216
|
-
|
|
217
|
-
(
|
|
218
|
-
key: string,
|
|
219
|
-
expectedValue?: MaybeOneOf<string | RegExp | ExpectWebdriverIO.PartialMatcher<string> | ExpectWebdriverIO.PartialMatcherAnything>,
|
|
220
|
-
options?: ExpectWebdriverIO.StringOptions
|
|
221
|
-
) : Promise<void>
|
|
217
|
+
): Promise<void>
|
|
222
218
|
},
|
|
223
219
|
|
|
224
220
|
/**
|
|
225
221
|
* `WebdriverIO.MultiRemoteBrowser` -> `getLocalStorageItem`
|
|
226
222
|
*/
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
223
|
+
{
|
|
224
|
+
/**
|
|
225
|
+
* Only check that the item exists.
|
|
226
|
+
* Use `toHaveLocalStorageItem(key, expect.anything(), options)` to check it with options.
|
|
227
|
+
*/
|
|
228
|
+
(key: string): Promise<void>
|
|
229
|
+
(
|
|
230
|
+
key: string,
|
|
231
|
+
expectedValue: MultiRemoteValuesOrOneOf<string | RegExp | ExpectWebdriverIO.PartialMatcher<string> | ExpectWebdriverIO.PartialMatcherAnything>,
|
|
232
|
+
options?: ExpectWebdriverIO.StringOptions
|
|
233
|
+
): Promise<void>
|
|
234
|
+
}
|
|
232
235
|
>
|
|
233
236
|
}
|
|
234
237
|
|
|
@@ -248,21 +251,10 @@ interface WdioNetworkMatchers<_R, ActualT> {
|
|
|
248
251
|
* Check that `WebdriverIO.Mock` was called N times.
|
|
249
252
|
* With multi-remote mocks (`multiRemoteBrowser.mock()`), every instance's mock must be called N times.
|
|
250
253
|
*/
|
|
251
|
-
toBeRequestedTimes: FnWhenMock<ActualT,
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
): Promise<void>
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* @deprecated since v6.0.0, remove in v8.0.0. Use `NumberMatcher` & `CommandOptions` separately `toBeRequestedTimes(NumberMatcher, options)`.
|
|
259
|
-
*/
|
|
260
|
-
(
|
|
261
|
-
times: ExpectWebdriverIO.NumberOptions,
|
|
262
|
-
options?: ExpectWebdriverIO.CommandOptions
|
|
263
|
-
): Promise<void>;
|
|
264
|
-
|
|
265
|
-
}>
|
|
254
|
+
toBeRequestedTimes: FnWhenMock<ActualT, (
|
|
255
|
+
times: number | ExpectWebdriverIO.NumberMatcher,
|
|
256
|
+
options?: ExpectWebdriverIO.CommandOptions
|
|
257
|
+
) => Promise<void>>
|
|
266
258
|
|
|
267
259
|
/**
|
|
268
260
|
* Check that `WebdriverIO.Mock` was called with the specific parameters.
|
|
@@ -336,16 +328,7 @@ interface WdioElementOrArrayMatchers<_R, ActualT = unknown> {
|
|
|
336
328
|
|
|
337
329
|
toHaveAttribute: FnWhenElementOrArrayLike<ActualT, {
|
|
338
330
|
/** Element $() API */
|
|
339
|
-
/**
|
|
340
|
-
* @deprecated since v6.0.0, remove in v8.0.0. Passing explicit `undefined` as a value is deprecated. Omit the second argument entirely or pass options instead: `toHaveAttribute(attribute, options)`.
|
|
341
|
-
*/
|
|
342
|
-
(
|
|
343
|
-
attribute: string,
|
|
344
|
-
value: undefined,
|
|
345
|
-
options?: ExpectWebdriverIO.StringOptions
|
|
346
|
-
): Promise<void>;
|
|
347
|
-
|
|
348
|
-
/** Check ONLY for the presence of the attribute (and optional configuration options) */
|
|
331
|
+
/** Check ONLY for the presence of the attribute. For options, use `toHaveAttribute(attribute, expect.anything(), options)` */
|
|
349
332
|
(
|
|
350
333
|
attribute: string,
|
|
351
334
|
): Promise<void>;
|
|
@@ -358,16 +341,7 @@ interface WdioElementOrArrayMatchers<_R, ActualT = unknown> {
|
|
|
358
341
|
): Promise<void>;
|
|
359
342
|
}, {
|
|
360
343
|
/** Elements $$() API */
|
|
361
|
-
/**
|
|
362
|
-
* @deprecated Not supported
|
|
363
|
-
*/
|
|
364
|
-
(
|
|
365
|
-
attribute: string,
|
|
366
|
-
value: undefined,
|
|
367
|
-
options?: ExpectWebdriverIO.StringOptions
|
|
368
|
-
): Promise<void>;
|
|
369
|
-
|
|
370
|
-
/** Check ONLY for the presence of the attribute (and optional configuration options) */
|
|
344
|
+
/** Check ONLY for the presence of the attribute. For options, use `toHaveAttribute(attribute, expect.anything(), options)` */
|
|
371
345
|
(
|
|
372
346
|
attribute: string,
|
|
373
347
|
): Promise<void>;
|
|
@@ -401,25 +375,6 @@ interface WdioElementOrArrayMatchers<_R, ActualT = unknown> {
|
|
|
401
375
|
}
|
|
402
376
|
>
|
|
403
377
|
|
|
404
|
-
/**
|
|
405
|
-
* @deprecated since v6.0.0, removed in v8.0.0. Use `toHaveAttribute` instead.
|
|
406
|
-
* `WebdriverIO.Element` -> `getAttribute`
|
|
407
|
-
*/
|
|
408
|
-
toHaveAttr: FnWhenElementOrArrayLike<ActualT, (
|
|
409
|
-
attribute: string,
|
|
410
|
-
value?: string | RegExp | ExpectWebdriverIO.PartialMatcher<string>,
|
|
411
|
-
options?: ExpectWebdriverIO.StringOptions
|
|
412
|
-
) => Promise<void>>
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* `WebdriverIO.Element` -> `getAttribute` class
|
|
416
|
-
* @deprecated since v1.3.1 - use `toHaveElementClass` instead.
|
|
417
|
-
*/
|
|
418
|
-
toHaveClass: FnWhenElementOrArrayLike<ActualT, (
|
|
419
|
-
className: string | RegExp | ExpectWebdriverIO.PartialMatcher<string>,
|
|
420
|
-
options?: ExpectWebdriverIO.StringOptions
|
|
421
|
-
) => Promise<void>>
|
|
422
|
-
|
|
423
378
|
/**
|
|
424
379
|
* `WebdriverIO.Element` -> `getAttribute` class
|
|
425
380
|
*
|
|
@@ -442,7 +397,7 @@ interface WdioElementOrArrayMatchers<_R, ActualT = unknown> {
|
|
|
442
397
|
className: string | RegExp | ExpectWebdriverIO.PartialMatcher<string>,
|
|
443
398
|
options?: ExpectWebdriverIO.StringOptions
|
|
444
399
|
) :Promise<void>
|
|
445
|
-
/** @deprecated
|
|
400
|
+
/** @deprecated an array means "has any of these classes", to review in https://github.com/webdriverio/expect-webdriverio/issues/2266 (`expect.oneOf()` compares the full class attribute) */
|
|
446
401
|
(
|
|
447
402
|
className: Array<string | RegExp | ExpectWebdriverIO.PartialMatcher<string>>,
|
|
448
403
|
options?: ExpectWebdriverIO.StringOptions
|
|
@@ -477,16 +432,6 @@ interface WdioElementOrArrayMatchers<_R, ActualT = unknown> {
|
|
|
477
432
|
property: string,
|
|
478
433
|
): Promise<void>;
|
|
479
434
|
|
|
480
|
-
/**
|
|
481
|
-
* @deprecated since v6.0.0, removed in v8.0.0. Passing explicit `undefined` or `null` as a value is deprecated.
|
|
482
|
-
* Omit the second argument entirely or use expect.anything() with options: `toHaveElementProperty(property, expect.anything(), options)`.
|
|
483
|
-
*/
|
|
484
|
-
(
|
|
485
|
-
property: string,
|
|
486
|
-
value: undefined | null, // Use expect.any(type) or expect.anything() instead of undefined or null
|
|
487
|
-
options?: ExpectWebdriverIO.StringOptions
|
|
488
|
-
): Promise<void>;
|
|
489
|
-
|
|
490
435
|
/** Assert both property name AND a specific expected value */
|
|
491
436
|
(
|
|
492
437
|
property: string,
|
|
@@ -504,20 +449,10 @@ interface WdioElementOrArrayMatchers<_R, ActualT = unknown> {
|
|
|
504
449
|
property: string,
|
|
505
450
|
): Promise<void>;
|
|
506
451
|
|
|
507
|
-
/**
|
|
508
|
-
* @deprecated Not supported
|
|
509
|
-
* Use `expect.anything()` or `[expect.anything()] as value` to check for the presence of the property with options.
|
|
510
|
-
*/
|
|
511
|
-
(
|
|
512
|
-
property: string,
|
|
513
|
-
propertyValue: undefined | null, // Use expect.any(type) or expect.anything() instead of undefined or null
|
|
514
|
-
options?: ExpectWebdriverIO.StringOptions
|
|
515
|
-
): Promise<never>;
|
|
516
|
-
|
|
517
452
|
/** Assert both property name AND a specific expected value */
|
|
518
453
|
(
|
|
519
454
|
property: string,
|
|
520
|
-
value: MaybeArrayOrOneOf<string | number | RegExp | ExpectWebdriverIO.PartialMatcher<string> | ExpectWebdriverIO.PartialMatcherAnything | null>,
|
|
455
|
+
value: Exclude<MaybeArrayOrOneOf<string | number | RegExp | ExpectWebdriverIO.PartialMatcher<string> | ExpectWebdriverIO.PartialMatcherAnything | null>, null>,
|
|
521
456
|
options?: ExpectWebdriverIO.StringOptions
|
|
522
457
|
): Promise<void>;
|
|
523
458
|
}, {
|
|
@@ -537,7 +472,7 @@ interface WdioElementOrArrayMatchers<_R, ActualT = unknown> {
|
|
|
537
472
|
): Promise<void>
|
|
538
473
|
(
|
|
539
474
|
property: string,
|
|
540
|
-
value: MaybeArrayOrOneOf<string | number | RegExp | ExpectWebdriverIO.PartialMatcher<string> | ExpectWebdriverIO.PartialMatcherAnything | null> | ExpectWebdriverIO.MultiRemotePartialMatcher<MaybeArrayOrOneOf<string | number | RegExp | ExpectWebdriverIO.PartialMatcher<string> | ExpectWebdriverIO.PartialMatcherAnything | null>>,
|
|
475
|
+
value: Exclude<MaybeArrayOrOneOf<string | number | RegExp | ExpectWebdriverIO.PartialMatcher<string> | ExpectWebdriverIO.PartialMatcherAnything | null>, null> | ExpectWebdriverIO.MultiRemotePartialMatcher<MaybeArrayOrOneOf<string | number | RegExp | ExpectWebdriverIO.PartialMatcher<string> | ExpectWebdriverIO.PartialMatcherAnything | null>>,
|
|
541
476
|
options?: ExpectWebdriverIO.StringOptions
|
|
542
477
|
): Promise<void>
|
|
543
478
|
}>
|
|
@@ -590,15 +525,6 @@ interface WdioElementOrArrayMatchers<_R, ActualT = unknown> {
|
|
|
590
525
|
* Same as `expect(el).toHaveChildren({ gte: 1 })` or `expect(el).toHaveChildren({ gte: 1 }, options)`.
|
|
591
526
|
*/
|
|
592
527
|
(): Promise<void>;
|
|
593
|
-
/**
|
|
594
|
-
* @deprecated since 6.0.0, remove in v8.0.0.
|
|
595
|
-
* Passing explicit `undefined` or `{ wait : 1 }` (NumberOptions) as a value is deprecated.
|
|
596
|
-
* Use options with `toHaveChildren({ gte: 1 }, options)`.
|
|
597
|
-
*/
|
|
598
|
-
(
|
|
599
|
-
expectedValue: undefined, // {} also deprecated but we cannot use it as a type because it would match any object
|
|
600
|
-
options?: ExpectWebdriverIO.CommandOptions
|
|
601
|
-
): Promise<void>;
|
|
602
528
|
|
|
603
529
|
/**
|
|
604
530
|
* When called with an expected child count or number matcher.
|
|
@@ -607,16 +533,6 @@ interface WdioElementOrArrayMatchers<_R, ActualT = unknown> {
|
|
|
607
533
|
expectedValue: number | ExpectWebdriverIO.NumberMatcher,
|
|
608
534
|
options?: ExpectWebdriverIO.CommandOptions
|
|
609
535
|
): Promise<void>;
|
|
610
|
-
|
|
611
|
-
/**
|
|
612
|
-
* @deprecated since 6.0.0, remove in v8.0.0.
|
|
613
|
-
* NumberOptions is no longer supported. Use `expect(el).toHaveChildren(numberMatcher, options)` instead.
|
|
614
|
-
* Instead of `expect(el).toHaveChildren({ wait: 1 })` use `expect(el).toHaveChildren({ gte: 1 }, { wait: 1 })`.
|
|
615
|
-
*/
|
|
616
|
-
(
|
|
617
|
-
expectedValue: ExpectWebdriverIO.NumberOptions,
|
|
618
|
-
options?: ExpectWebdriverIO.CommandOptions
|
|
619
|
-
): Promise<void>;
|
|
620
536
|
}, {
|
|
621
537
|
/** Element $$() API */
|
|
622
538
|
/**
|
|
@@ -625,16 +541,6 @@ interface WdioElementOrArrayMatchers<_R, ActualT = unknown> {
|
|
|
625
541
|
*/
|
|
626
542
|
(): Promise<void>;
|
|
627
543
|
|
|
628
|
-
/**
|
|
629
|
-
* @deprecated Not supported
|
|
630
|
-
* NumberOptions is no longer supported. Use `expect(el).toHaveChildren(numberMatcher, options)` instead.
|
|
631
|
-
* Instead of `expect(el).toHaveChildren({ wait: 1 })` use `expect(el).toHaveChildren({ gte: 1 }, { wait: 1 })`.
|
|
632
|
-
*/
|
|
633
|
-
(
|
|
634
|
-
expectedValue: undefined,
|
|
635
|
-
options?: ExpectWebdriverIO.CommandOptions
|
|
636
|
-
): Promise<void>;
|
|
637
|
-
|
|
638
544
|
/**
|
|
639
545
|
* When called with an expected child count or number matcher.
|
|
640
546
|
*/
|
|
@@ -771,11 +677,6 @@ interface WdioElementOrArrayMatchers<_R, ActualT = unknown> {
|
|
|
771
677
|
text: MaybeOneOf<string | RegExp | ExpectWebdriverIO.PartialMatcher<string>>,
|
|
772
678
|
options?: ExpectWebdriverIO.StringOptions
|
|
773
679
|
) : Promise<void>
|
|
774
|
-
/** @deprecated Use `expect.oneOf()` instead. */
|
|
775
|
-
(
|
|
776
|
-
text: Array<string | RegExp | ExpectWebdriverIO.PartialMatcher<string>>,
|
|
777
|
-
options?: ExpectWebdriverIO.StringOptions
|
|
778
|
-
) : Promise<void>
|
|
779
680
|
}, {
|
|
780
681
|
/** Elements browser.$$() API */
|
|
781
682
|
(
|
|
@@ -807,11 +708,6 @@ interface WdioElementOrArrayMatchers<_R, ActualT = unknown> {
|
|
|
807
708
|
text: MaybeOneOf<string | RegExp | ExpectWebdriverIO.PartialMatcher<string>>,
|
|
808
709
|
options?: ExpectWebdriverIO.HTMLOptions
|
|
809
710
|
) : Promise<void>
|
|
810
|
-
/** @deprecated to replace by oneOf() or anyOf() when available */
|
|
811
|
-
(
|
|
812
|
-
text: Array<string | RegExp | ExpectWebdriverIO.PartialMatcher<string>>,
|
|
813
|
-
options?: ExpectWebdriverIO.HTMLOptions
|
|
814
|
-
) : Promise<void>
|
|
815
711
|
}, {
|
|
816
712
|
/** Elements $$() API */
|
|
817
713
|
(
|
|
@@ -842,12 +738,6 @@ interface WdioElementOrArrayMatchers<_R, ActualT = unknown> {
|
|
|
842
738
|
computedLabel: MaybeOneOf<string | RegExp | ExpectWebdriverIO.PartialMatcher<string>>,
|
|
843
739
|
options?: ExpectWebdriverIO.StringOptions
|
|
844
740
|
) : Promise<void>
|
|
845
|
-
|
|
846
|
-
/** @deprecated use `expect.oneOf()` instead of an array */
|
|
847
|
-
(
|
|
848
|
-
computedLabel: Array<string | RegExp | ExpectWebdriverIO.PartialMatcher<string>>,
|
|
849
|
-
options?: ExpectWebdriverIO.StringOptions
|
|
850
|
-
) : Promise<void>
|
|
851
741
|
}, {
|
|
852
742
|
/** Elements $$() API */
|
|
853
743
|
(
|
|
@@ -878,12 +768,6 @@ interface WdioElementOrArrayMatchers<_R, ActualT = unknown> {
|
|
|
878
768
|
computedRole: MaybeOneOf<string | RegExp | ExpectWebdriverIO.PartialMatcher<string>>,
|
|
879
769
|
options?: ExpectWebdriverIO.StringOptions
|
|
880
770
|
) : Promise<void>
|
|
881
|
-
|
|
882
|
-
/** @deprecated use `expect.oneOf()` instead of an array */
|
|
883
|
-
(
|
|
884
|
-
computedRole: Array<string | RegExp | ExpectWebdriverIO.PartialMatcher<string>>,
|
|
885
|
-
options?: ExpectWebdriverIO.StringOptions
|
|
886
|
-
) : Promise<void>
|
|
887
771
|
}, {
|
|
888
772
|
/** Elements $$() API */
|
|
889
773
|
(
|
|
@@ -913,15 +797,7 @@ interface WdioElementOrArrayMatchers<_R, ActualT = unknown> {
|
|
|
913
797
|
(
|
|
914
798
|
width: number | ExpectWebdriverIO.NumberMatcher,
|
|
915
799
|
options?: ExpectWebdriverIO.CommandOptions
|
|
916
|
-
) : Promise<void
|
|
917
|
-
|
|
918
|
-
/**
|
|
919
|
-
* @deprecated since v6.0.0, remove in v8.0.0. Use `toHaveWidth` with number | NumberMatcher instead. This matcher will be removed in version 8.0.0.
|
|
920
|
-
*/
|
|
921
|
-
(
|
|
922
|
-
size: ExpectWebdriverIO.NumberOptions,
|
|
923
|
-
options?: ExpectWebdriverIO.CommandOptions
|
|
924
|
-
): Promise<void>,
|
|
800
|
+
) : Promise<void>
|
|
925
801
|
}, {
|
|
926
802
|
/** Elements $$() API */
|
|
927
803
|
(
|
|
@@ -960,14 +836,6 @@ interface WdioElementOrArrayMatchers<_R, ActualT = unknown> {
|
|
|
960
836
|
height: number | ExpectWebdriverIO.NumberMatcher,
|
|
961
837
|
options?: ExpectWebdriverIO.CommandOptions
|
|
962
838
|
) : Promise<void>
|
|
963
|
-
|
|
964
|
-
/**
|
|
965
|
-
* @deprecated since v6.0.0, will be removed in version v8.0.0. Use `toHaveHeight` with number | NumberMatcher instead.
|
|
966
|
-
*/
|
|
967
|
-
(
|
|
968
|
-
size: ExpectWebdriverIO.NumberOptions,
|
|
969
|
-
options?: ExpectWebdriverIO.CommandOptions
|
|
970
|
-
): Promise<void>,
|
|
971
839
|
}, {
|
|
972
840
|
/** Elements $$() API */
|
|
973
841
|
(
|
|
@@ -1066,14 +934,6 @@ interface WdioElementArrayOnlyMatchers<_R, ActualT = unknown> {
|
|
|
1066
934
|
size: number | ExpectWebdriverIO.NumberMatcher,
|
|
1067
935
|
options?: ExpectWebdriverIO.CommandOptions
|
|
1068
936
|
): Promise<void>,
|
|
1069
|
-
|
|
1070
|
-
/**
|
|
1071
|
-
* @deprecated since v6.0.0, remove in v8.0.0. Use `toBeElementsArrayOfSize` with number | NumberMatcher instead. This matcher will be removed in version 8.0.0.
|
|
1072
|
-
*/
|
|
1073
|
-
(
|
|
1074
|
-
size: ExpectWebdriverIO.NumberOptions,
|
|
1075
|
-
options?: ExpectWebdriverIO.CommandOptions
|
|
1076
|
-
): Promise<void>,
|
|
1077
937
|
}, {
|
|
1078
938
|
/**
|
|
1079
939
|
* Elements MultiRemoteBrowser.$$() API: the size is checked per browser instance.
|
|
@@ -1220,21 +1080,11 @@ declare namespace ExpectWebdriverIO {
|
|
|
1220
1080
|
* Used by the webdriverio main project to configure the matchers in the runner.
|
|
1221
1081
|
*/
|
|
1222
1082
|
function setDefaultOptions(options: DefaultOptions): void
|
|
1223
|
-
/** @deprecated since v6.0.0, use setDefaultOptions instead, will be removed in v8.0.0 */
|
|
1224
|
-
function setOptions(options: DefaultOptions): void
|
|
1225
|
-
|
|
1226
|
-
/**
|
|
1227
|
-
* Allow to enable some new features in the expect-webdriverio library.
|
|
1228
|
-
* @param flags
|
|
1229
|
-
*/
|
|
1230
|
-
function setFeatureFlags(flags: FeatureFlags): void
|
|
1231
1083
|
|
|
1232
1084
|
/**
|
|
1233
1085
|
* Get the default options set by the user.
|
|
1234
1086
|
*/
|
|
1235
1087
|
function getDefaultOptions(): DefaultOptions
|
|
1236
|
-
/** @deprecated since v6.0.0, use getDefaultOptions instead, will be removed in v8.0.0 */
|
|
1237
|
-
function getConfig(): DefaultOptions
|
|
1238
1088
|
|
|
1239
1089
|
/**
|
|
1240
1090
|
* The this context available inside each matcher function.
|
|
@@ -1363,11 +1213,6 @@ declare namespace ExpectWebdriverIO {
|
|
|
1363
1213
|
*/
|
|
1364
1214
|
const wdioCustomMatchers: MatchersObject
|
|
1365
1215
|
|
|
1366
|
-
/**
|
|
1367
|
-
* @deprecated since 5.6.9 use `wdioCustomMatchers` instead, will be removed in v8.0.0?
|
|
1368
|
-
*/
|
|
1369
|
-
const matchers: Map<string, RawMatcherFn>
|
|
1370
|
-
|
|
1371
1216
|
interface AssertionHookParams {
|
|
1372
1217
|
/**
|
|
1373
1218
|
* name of the matcher, e.g. `toHaveText` or `toBeClickable`
|
|
@@ -1388,26 +1233,15 @@ declare namespace ExpectWebdriverIO {
|
|
|
1388
1233
|
/**
|
|
1389
1234
|
* Options that the user has passed in, e.g. `expect(el).toHaveText('foo', { ignoreCase: true })` -> `{ ignoreCase: true }`
|
|
1390
1235
|
*/
|
|
1391
|
-
options: CommandOptions | HTMLOptions | StringOptions
|
|
1236
|
+
options: CommandOptions | HTMLOptions | StringOptions
|
|
1392
1237
|
}
|
|
1393
1238
|
interface AfterAssertionHookParams extends AssertionHookParams {
|
|
1394
1239
|
result: AssertionResult
|
|
1395
1240
|
}
|
|
1396
1241
|
|
|
1397
|
-
interface FeatureFlags {
|
|
1398
|
-
/**
|
|
1399
|
-
* Feature flag to enable the new multi-elements comparison for `toHaveText` matcher, allowing to keep the current behavior without breaking changes.
|
|
1400
|
-
* When enabled, the matcher will compare the text of multiple elements in an indexed exact match manner, rather than using the array as a possible match for any of the elements.
|
|
1401
|
-
* Also required for `some()`, `expect.oneOf()` in an expected array, and multi-remote elements with `toHaveText`.
|
|
1402
|
-
*
|
|
1403
|
-
* The new behavior is planned to become the default in the next major version.
|
|
1404
|
-
*/
|
|
1405
|
-
useToHaveTextStrictMultiElementsCompareStrategy?: boolean
|
|
1406
|
-
}
|
|
1407
|
-
|
|
1408
1242
|
interface DefaultOptions {
|
|
1409
1243
|
/**
|
|
1410
|
-
* time in ms to wait for expectation to succeed. Default:
|
|
1244
|
+
* time in ms to wait for expectation to succeed. Default: 2000
|
|
1411
1245
|
*/
|
|
1412
1246
|
wait?: number
|
|
1413
1247
|
|
|
@@ -1425,8 +1259,6 @@ declare namespace ExpectWebdriverIO {
|
|
|
1425
1259
|
* hook that gets executed after each assertion, it contains the result of the assertion
|
|
1426
1260
|
*/
|
|
1427
1261
|
afterAssertion?: (params: AfterAssertionHookParams) => Promise<void>
|
|
1428
|
-
|
|
1429
|
-
featureFlags?: FeatureFlags
|
|
1430
1262
|
}
|
|
1431
1263
|
|
|
1432
1264
|
interface CommandOptions extends DefaultOptions {
|
|
@@ -1485,29 +1317,6 @@ declare namespace ExpectWebdriverIO {
|
|
|
1485
1317
|
asString?: boolean
|
|
1486
1318
|
}
|
|
1487
1319
|
|
|
1488
|
-
/**
|
|
1489
|
-
* @deprecated since v6.0.0, remove in v8.0.0. Use `NumberMatcher` & `CommandOptions` as separate parameters instead.
|
|
1490
|
-
* @see NumberMatcher
|
|
1491
|
-
* @see CommandOptions
|
|
1492
|
-
*/
|
|
1493
|
-
interface NumberOptions extends CommandOptions {
|
|
1494
|
-
|
|
1495
|
-
/**
|
|
1496
|
-
* equals
|
|
1497
|
-
*/
|
|
1498
|
-
eq?: number
|
|
1499
|
-
|
|
1500
|
-
/**
|
|
1501
|
-
* less than or equals
|
|
1502
|
-
*/
|
|
1503
|
-
lte?: number
|
|
1504
|
-
|
|
1505
|
-
/**
|
|
1506
|
-
* greater than or equals
|
|
1507
|
-
*/
|
|
1508
|
-
gte?: number
|
|
1509
|
-
}
|
|
1510
|
-
|
|
1511
1320
|
interface ToBeDisplayedOptions extends CommandOptions {
|
|
1512
1321
|
/**
|
|
1513
1322
|
* `true` to check if the element is within the viewport. false by default.
|