-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add TypeScript support for Cypress action events (#1187)
* feat: Add support for Cypress action events * fix: Fixed documentation URL for actions * fix dtslint test failures
- Loading branch information
1 parent
2c122b0
commit ae8b147
Showing
3 changed files
with
226 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
Cypress.on('uncaught:exception', (error, runnable) => { | ||
error // $ExpectType Error | ||
runnable // $ExpectType IRunnable | ||
}) | ||
|
||
Cypress.on('window:confirm', (text) => { | ||
text // $ExpectType string | ||
}) | ||
|
||
Cypress.on('window:alert', (text) => { | ||
text // $ExpectType string | ||
}) | ||
|
||
Cypress.on('window:before:load', (win) => { | ||
win // $ExpectType Window | ||
}) | ||
|
||
Cypress.on('window:load', (win) => { | ||
win // $ExpectType Window | ||
}) | ||
|
||
Cypress.on('window:before:unload', (event) => { | ||
event // $ExpectType BeforeUnloadEvent | ||
}) | ||
|
||
Cypress.on('window:unload', (event) => { | ||
event // $ExpectType Event | ||
}) | ||
|
||
Cypress.on('url:changed', (url) => { | ||
url // $ExpectType string | ||
}) | ||
|
||
Cypress.on('fail', (error, mocha) => { | ||
error // $ExpectType Error | ||
mocha // $ExpectType IRunnable | ||
}) | ||
|
||
Cypress.on('viewport:changed', (viewport) => { | ||
viewport // $ExpectType Viewport | ||
}) | ||
|
||
Cypress.on('scrolled', ($el) => { | ||
$el // $ExpectType JQuery<HTMLElement> | ||
}) | ||
|
||
Cypress.on('command:enqueued', (command) => { | ||
command // $ExpectType EnqueuedCommand | ||
}) | ||
|
||
Cypress.on('command:start', (command) => { | ||
command // $ExpectType CommandQueue | ||
}) | ||
|
||
Cypress.on('command:end', (command) => { | ||
command // $ExpectType CommandQueue | ||
}) | ||
|
||
Cypress.on('command:retry', (command) => { | ||
command // $ExpectType CommandQueue | ||
}) | ||
|
||
Cypress.on('log:added', (log, interactive: boolean) => { | ||
log // $ExpectTyped any | ||
}) | ||
|
||
Cypress.on('log:changed', (log, interactive: boolean) => { | ||
log // $ExpectTyped any | ||
}) | ||
|
||
Cypress.on('test:before:run', (attributes , test) => { | ||
attributes // $ExpectType ObjectLike | ||
test // $ExpectType ITest | ||
}) | ||
|
||
Cypress.on('test:after:run', (attributes , test) => { | ||
attributes // $ExpectType ObjectLike | ||
test // $ExpectType ITest | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters