-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress.d.ts
70 lines (63 loc) · 2.55 KB
/
cypress.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
/// <reference types="@cypress/xpath" />
/// <reference types="cypress" />
/// <reference types="cypress-wait-until" />
/// <reference types="cypress-plugin-api" />
/// <reference types="cypress-map" />
interface CustomWorld {
params: Record<string, any>;
}
declare namespace Mocha {
interface Context extends CustomWorld { }
}
type WaitUntilLogger = Pick<Cypress.LogConfig, 'name' | 'message' | 'consoleProps'>
type ErrorMsgCallbacks<Subject = any> = (
result: Subject,
options: WaitUntilOptions<Subject>
) => string
interface WaitUntilOptions<Subject = any> {
timeout?: number
interval?: number
errorMsg?: string | ErrorMsgCallbacks<Subject>
description?: string
customMessage?: string
verbose?: boolean
customCheckMessage?: string
logger?: (logOptions: WaitUntilLogger) => any
log?: boolean
}
declare namespace Cypress {
interface Chainable<Subject = any> {
waitUntil<ReturnType = any>(
checkFunction: (
subject: Subject | undefined
) => ReturnType | Chainable<ReturnType> | Promise<ReturnType>,
options?: WaitUntilOptions<Subject>
): Chainable<ReturnType>
/**
* Custom command to type a few random words into input elements
* @param count=3
* @example cy.get('input').typeRandomWords()
*/
typeRandomWords(
count?: number,
options?: Partial<TypeOptions>
): Chainable<JQuery<HTMLElement>>
frame(selector: string): Cypress.Chainable<unknown>
mouseOver(selector: string): Cypress.Chainable<JQuery<any>>
// assertList(subject: Array<JQuery<HTMLElement>>, expected: Array<string>): Cypress.Chainable<Subject>
assertList(expected: Array<string>): Cypress.Chainable<Subject>
getAttrList(attr: string): Cypress.Chainable<string[]>
tab(options?: Partial<{shift: Boolean}>): Chainable
cucumberLog(data: string, mediaType: string): void
schemaValidate(body: any, schema: any): void
text(): Cypress.Chainable<string>
isVisible(): Cypress.Chainable<boolean>
isHidden(): Cypress.Chainable<boolean>
mustBeVisible(): Cypress.Chainable<Subject>
mustBeHidden(): Cypress.Chainable<Subject>
attr(name: string): Cypress.Chainable<string | undefined>
css(key: string): Cypress.Chainable<string | undefined>
byXpath(selector: string): Cypress.Chainable<JQuery<HTMLElement>>
waitForElementToDisappear(selector: string, timeout?: number): Cypress.Chainable<JQuery<HTMLElement>>
}
}