-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
command_tab_helpers.d.ts
53 lines (43 loc) · 1.56 KB
/
command_tab_helpers.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
/// <reference types="cypress" />
declare namespace Cypress {
interface TabOptions {
timeout?: number,
tab_name: string,
// https://developer.mozilla.org/en-US/docs/Web/API/Window/open
windowFeatures?: string
}
interface TabVisitOptions extends Cypress.VisitOptions {
/**
* Defaults to `root`.
*/
tab_name?: string
}
interface TabDebugData {
active_tab_index: number,
myTabNames: string[],
myTabs: Window[],
}
interface Chainable<Subject = any> {
openTab(url: string, opts: Cypress.TabOptions): Chainable<Subject>;
/**
* Pass an index or name to close a specific window, otherwise, pass nothing to delete the most recently opened
* window in the stack.
*/
closeTab(index_or_name?: number | string): void;
/**
* Methods like `cy.reload`, `win.location.reload`, etc break our context aware popups. Use this special visit
* function that maintains our context awareness when navigating on the currently active context.
*/
tabVisit(url: string, window_name: string): Chainable<Subject>;
switchToTab(tab_name: string): Chainable<Subject>;
/**
* Close all popup windows.
*/
closeAllTabs(): void;
debugTabHelper(): Cypress.TabDebugData;
/**
* Adds a `tab_name` option to the original `visit` method.
*/
visit(url: string, options?: Partial<Cypress.TabVisitOptions>): Chainable<Subject>;
}
}