-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
85 lines (79 loc) · 2.93 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// https://glebbahmutov.com/blog/publishing-cypress-command/
// load type definitions that come with Cypress module
// and then add our new commands to the "cy" object
/// <reference types="cypress" />
declare namespace Cypress {
interface Chainable {
/**
* Creates a timestamp with the given name.
* Yields the current subject to the next command or assertion.
* @param name Name for the new time mark
* @see https://github.com/bahmutov/cypress-time-marks
*/
timeMark(name: string): Chainable<any>
/**
* Measures the time elapsed since the given time mark.
* Yields the current subject to the next command or assertion.
* @see https://github.com/bahmutov/cypress-time-marks
* @param label Extra text to show in the Command Log
* @param timeLimit The time limit to warn in milliseconds
* @param throwError Throws an error if the elapsed time is above the time limit
*/
timeSince(
name: string,
label?: string,
timeLimit?: number,
throwError?: boolean,
): Chainable<any>
/**
* Measures the time elapsed since the given time mark.
* Yields the current subject to the next command or assertion.
* @param timeLimit The time limit to warn in milliseconds
* @param throwError Throws an error if the elapsed time is above the time limit
* @see https://github.com/bahmutov/cypress-time-marks
*/
timeSince(
name: string,
timeLimit?: number,
throwError?: boolean,
): Chainable<any>
/**
* Measures the time elapsed between two time marks.
* The marks should have already happened.
* Yields the current subject to the next command or assertion.
* @see https://github.com/bahmutov/cypress-time-marks
* @param mark1 The first time mark
* @param mark2 The second time mark
* @param label Extra text to show in the Command Log
* @param timeLimit The time limit to warn in milliseconds
* @param throwError Throws an error if the elapsed time is above the time limit
* @example
* cy.timeBetween('start', 'end', 'loading time', 2000, true)
*/
timeBetween(
mark1: string,
mark2: string,
label?: string,
timeLimit?: number,
throwError?: boolean,
): Chainable<any>
/**
* Measures the time elapsed between two time marks.
* The marks should have already happened.
* Yields the current subject to the next command or assertion.
* @see https://github.com/bahmutov/cypress-time-marks
* @param mark1 The first time mark
* @param mark2 The second time mark
* @param timeLimit The time limit to warn in milliseconds
* @param throwError Throws an error if the elapsed time is above the time limit
* @example
* cy.timeBetween('start', 'end', 2000, true)
*/
timeBetween(
mark1: string,
mark2: string,
timeLimit?: number,
throwError?: boolean,
): Chainable<any>
}
}