From 37f75ff18ce995938636cfdc08c51cc5dd0602b7 Mon Sep 17 00:00:00 2001 From: "Demeusy, Valentin" Date: Mon, 4 Dec 2017 18:26:03 +0100 Subject: [PATCH] enh : cypress : update cy.trigger and cy.log API --- types/cypress/cypress-tests.ts | 5 ++++- types/cypress/index.d.ts | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/types/cypress/cypress-tests.ts b/types/cypress/cypress-tests.ts index 9502f1a63d..be1b3cc959 100644 --- a/types/cypress/cypress-tests.ts +++ b/types/cypress/cypress-tests.ts @@ -10,7 +10,8 @@ cy .get('#querying') .contains('ul', 'oranges').should('have.class', 'query-list') .get('.query-button') - .contains('Save Form').should('have.class', 'btn'); + .contains('Save Form').should('have.class', 'btn') + .trigger('mousemove', {clientX: 100, clientY: 200}); cy.location('host'); @@ -39,3 +40,5 @@ cy .spread((x , y, z) => { x + y + z; }); + +cy.log('end'); diff --git a/types/cypress/index.d.ts b/types/cypress/index.d.ts index 1ffb365418..6cbc65f819 100644 --- a/types/cypress/index.d.ts +++ b/types/cypress/index.d.ts @@ -255,7 +255,7 @@ declare namespace Cypress { /** * @see https://on.cypress.io/api/log */ - log(message: string, args: any): Chainable; + log(message: string, args?: any): Chainable; /** * @see https://on.cypress.io/api/next @@ -382,6 +382,7 @@ declare namespace Cypress { * @see https://docs.cypress.io/api/commands/trigger.html */ trigger(eventName: string, position?: PositionType, x?: number, y?: number, options?: TriggerOptions): Chainable; + trigger(eventName: string, eventObject: object): Chainable; /** * @see https://on.cypress.io/api/type