mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 06:29:40 +08:00
Merge pull request #19744 from rvanmarkus/master
adds type definitions for 'trigger' method in cypress.io
This commit is contained in:
17
types/cypress/index.d.ts
vendored
17
types/cypress/index.d.ts
vendored
@@ -2,6 +2,7 @@
|
||||
// Project: https://cypress.io
|
||||
// Definitions by: Gert Hengeveld <https://github.com/ghengeveld>
|
||||
// Mike Woudenberg <https://github.com/mikewoudenberg>
|
||||
// Robbert van Markus <https://github.com/rvanmarkus>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
@@ -375,6 +376,12 @@ declare namespace Cypress {
|
||||
*/
|
||||
title(options?: Loggable): Chainable;
|
||||
|
||||
/**
|
||||
* @description Trigger an event on a DOM element.
|
||||
* @see https://docs.cypress.io/api/commands/trigger.html
|
||||
*/
|
||||
trigger(eventName: string, position?: PositionType, x?: number, y?: number, options?: TriggerOptions): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/type
|
||||
*/
|
||||
@@ -539,6 +546,16 @@ declare namespace Cypress {
|
||||
onBeforeLoad?(args: any[]): void;
|
||||
onLoad?(args: any[]): void;
|
||||
}
|
||||
|
||||
interface TriggerOptions {
|
||||
log?: boolean;
|
||||
force?: boolean;
|
||||
bubbles?: boolean;
|
||||
cancable?: boolean;
|
||||
timeout?: number;
|
||||
}
|
||||
|
||||
type PositionType = "topLeft" | "top" | "topRight" | "left" | "center" | "right" | "bottomLeft" | "bottom" | "bottomRight";
|
||||
}
|
||||
|
||||
declare const cy: Cypress.Chainable;
|
||||
|
||||
Reference in New Issue
Block a user