1
- /* eslint-disable @typescript-eslint/consistent-type-imports*/
2
- type ServiceInstance = import ( '@wdio/types' ) . Services . ServiceInstance
3
- type Test = import ( '@wdio/types' ) . Frameworks . Test
4
- type TestResult = import ( '@wdio/types' ) . Frameworks . TestResult
5
- type PickleStep = import ( '@wdio/types' ) . Frameworks . PickleStep
6
- type Scenario = import ( '@wdio/types' ) . Frameworks . Scenario
7
- type SnapshotResult = import ( '@vitest/snapshot' ) . SnapshotResult
8
- type SnapshotUpdateState = import ( '@vitest/snapshot' ) . SnapshotUpdateState
1
+ type ServiceInstance = import ( '@wdio/types' ) . Services . ServiceInstance ;
2
+ type Test = import ( '@wdio/types' ) . Frameworks . Test ;
3
+ type TestResult = import ( '@wdio/types' ) . Frameworks . TestResult ;
4
+ type PickleStep = import ( '@wdio/types' ) . Frameworks . PickleStep ;
5
+ type Scenario = import ( '@wdio/types' ) . Frameworks . Scenario ;
6
+ type SnapshotResult = import ( '@vitest/snapshot' ) . SnapshotResult ;
7
+ type SnapshotUpdateState = import ( '@vitest/snapshot' ) . SnapshotUpdateState ;
9
8
10
9
declare namespace ExpectWebdriverIO {
11
10
const expect : ExpectWebdriverIO . Expect
12
11
function setOptions ( options : DefaultOptions ) : void
13
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
12
function getConfig ( ) : any
15
13
16
14
interface SnapshotServiceArgs {
@@ -25,34 +23,32 @@ declare namespace ExpectWebdriverIO {
25
23
}
26
24
27
25
interface SoftFailure {
28
- error : Error
29
- matcherName : string
30
- location ?: string
26
+ error : Error ;
27
+ matcherName : string ;
28
+ location ?: string ;
31
29
}
32
30
33
31
class SoftAssertService {
34
- static getInstance ( ) : SoftAssertService
35
- setCurrentTest ( testId : string , testName ?: string , testFile ?: string ) : void
36
- clearCurrentTest ( ) : void
37
- getCurrentTestId ( ) : string | null
38
- addFailure ( error : Error , matcherName : string ) : void
39
- getFailures ( testId ?: string ) : SoftFailure [ ]
40
- clearFailures ( testId ?: string ) : void
41
- assertNoFailures ( testId ?: string ) : void
32
+ static getInstance ( ) : SoftAssertService ;
33
+ setCurrentTest ( testId : string , testName ?: string , testFile ?: string ) : void ;
34
+ clearCurrentTest ( ) : void ;
35
+ getCurrentTestId ( ) : string | null ;
36
+ addFailure ( error : Error , matcherName : string ) : void ;
37
+ getFailures ( testId ?: string ) : SoftFailure [ ] ;
38
+ clearFailures ( testId ?: string ) : void ;
39
+ assertNoFailures ( testId ?: string ) : void ;
42
40
}
43
41
44
42
interface SoftAssertionServiceOptions {
45
- autoAssertOnTestEnd ?: boolean
43
+ autoAssertOnTestEnd ?: boolean ;
46
44
}
47
45
48
46
class SoftAssertionService implements ServiceInstance {
49
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
- constructor ( serviceOptions ?: SoftAssertionServiceOptions , capabilities ?: any , config ?: any )
51
- beforeTest ( test : Test ) : void
52
- beforeStep ( step : PickleStep , scenario : Scenario ) : void
53
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
54
- afterTest ( test : Test , context : any , result : TestResult ) : void
55
- afterStep ( step : PickleStep , scenario : Scenario , result : { passed : boolean , error ?: Error } ) : void
47
+ constructor ( serviceOptions ?: SoftAssertionServiceOptions , capabilities ?: any , config ?: any ) ;
48
+ beforeTest ( test : Test ) : void ;
49
+ beforeStep ( step : PickleStep , scenario : Scenario ) : void ;
50
+ afterTest ( test : Test , context : any , result : TestResult ) : void ;
51
+ afterStep ( step : PickleStep , scenario : Scenario , result : { passed : boolean , error ?: Error } ) : void ;
56
52
}
57
53
58
54
interface AssertionResult {
@@ -63,9 +59,7 @@ declare namespace ExpectWebdriverIO {
63
59
const matchers : Map <
64
60
string ,
65
61
(
66
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
62
actual : any ,
68
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
69
63
...expected : any [ ]
70
64
) => Promise < AssertionResult >
71
65
>
@@ -85,7 +79,6 @@ declare namespace ExpectWebdriverIO {
85
79
* expect(el).toHaveAttribute('attr', 'value', { ... }) // expectedValue is `['attr', 'value]`
86
80
* ```
87
81
*/
88
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
89
82
expectedValue ?: any ,
90
83
/**
91
84
* Options that the user has passed in, e.g. `expect(el).toHaveText('foo', { ignoreCase: true })` -> `{ ignoreCase: true }`
@@ -245,10 +238,10 @@ declare namespace ExpectWebdriverIO {
245
238
* **Usage**
246
239
* ```js
247
240
* // Check if an element has the class 'btn'
248
- * await expect(element).toHaveElementClass('btn')
241
+ * await expect(element).toHaveElementClass('btn');
249
242
*
250
243
* // Check if an element has any of the specified classes
251
- * await expect(element).toHaveElementClass(['btn', 'btn-large'])
244
+ * await expect(element).toHaveElementClass(['btn', 'btn-large']);
252
245
* ```
253
246
*/
254
247
toHaveElementClass ( className : string | RegExp | Array < string | RegExp > | ExpectWebdriverIO . PartialMatcher , options ?: ExpectWebdriverIO . StringOptions ) : R
@@ -258,7 +251,6 @@ declare namespace ExpectWebdriverIO {
258
251
*/
259
252
toHaveElementProperty (
260
253
property : string | RegExp | ExpectWebdriverIO . PartialMatcher ,
261
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
262
254
value ?: any ,
263
255
options ?: ExpectWebdriverIO . StringOptions
264
256
) : R
@@ -426,7 +418,7 @@ declare namespace ExpectWebdriverIO {
426
418
toBeElementsArrayOfSize (
427
419
size : number | ExpectWebdriverIO . NumberOptions ,
428
420
options ?: ExpectWebdriverIO . NumberOptions
429
- ) : R & Promise < WebdriverIO . ElementArray >
421
+ ) : R & Promise < WebdriverIO . ElementArray > ;
430
422
431
423
// ==== network mock ====
432
424
/**
@@ -487,10 +479,8 @@ declare namespace ExpectWebdriverIO {
487
479
type JsonCompatible = jsonObject | jsonArray
488
480
489
481
interface PartialMatcher {
490
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
491
482
sample ?: any
492
483
$$typeof : symbol
493
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
494
484
asymmetricMatch ( ...args : any [ ] ) : boolean
495
485
toString ( ) : string
496
486
}
@@ -537,7 +527,6 @@ declare namespace ExpectWebdriverIO {
537
527
}
538
528
539
529
interface AsymmetricMatchers {
540
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
541
530
any ( expectedObject : any ) : PartialMatcher
542
531
anything ( ) : PartialMatcher
543
532
arrayContaining ( sample : Array < unknown > ) : PartialMatcher
0 commit comments