This repository has been archived by the owner on Jan 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.d.ts
59 lines (56 loc) · 1.58 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/// <reference types="cypress" />
declare namespace Cypress {
interface Chainable<Subject> {
/**
* Skips the current test if running on a given platform or browser
* @see https://github.com/cypress-io/cypress-skip-test
* @example
* // skips the current test on Windows,
* // also skips if running in Electron
* cy.skipOn('windows')
* .skipOn('electron')
* @example
* // skip the test if S is "foo"
* cy.skipOn(S === 'foo')
*
* @example
```
// skip entire block of tests on Firefox
// without starting them
skipOn('firefox', () => {
it('works', () => {...})
it('works too', () => {...})
})
```
*/
skipOn(nameOrFlag: string | boolean, cb?: () => void): Chainable<Subject>
/**
* Only runs the current test if the current browser or platform matches the given name
* @see https://github.com/cypress-io/cypress-skip-test
* @example
* // run this test on Mac
* cy.onlyOn('darwin')
* @example
* // run this test if S is "foo"
* cy.onlyOn(S === 'foo')
* @example
```
// run this group of tests against localhost only
onlyOn('localhost', () => {
it('works', () => {...})
it('works too', () => {...})
})
```
*/
onlyOn(nameOrFlag: string | boolean, cb?: () => void): Chainable<Subject>
}
}
export const skipOn: (
nameOrFlag: string | boolean,
cb?: () => void
) => Cypress.Chainable<any>
export const onlyOn: (
nameOrFlag: string | boolean,
cb?: () => void
) => Cypress.Chainable<any>
export const isOn: (name: string) => boolean