Merge pull request #19744 from rvanmarkus/master

adds type definitions for 'trigger' method in cypress.io
This commit is contained in:
Arthur Ozga
2017-09-15 10:15:21 -07:00
committed by GitHub

View File

@@ -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;