simulated mouse fixes, rightclick, dblclick (#3030)

* cleanup type_spec, allow unused-vars for args

* fix missing return

* rename mouse/keyboard

* apply changes on this branch with rename

* temp 07/18/19 [skip ci] type_spec minor changes

* temp 07/19/19 [skip ci]

* temp 07/22/19 [skip ci]

* temp 07/22/19 [skip ci]

* remove accidental spec, use beforeEach visit in click_spec

* add tests for cy.trigger changes

* re-run build

* add typedefs

* temp 08/08/19 [skip ci]

* fix type_spec, click_spec

* fix console table event table logging

* fix spec utils

* fix invalid clicking-into-iframe spec

* address review, cleanup

* temp 09/25/19 [skip ci]

* add test for clicking checkbox, cleanup click_spec

* document mouse click and mouse move algo, adjust mouse move, add test for recursive movement

* cleanup / formatting

* scope the getCommandLogWithText to the active runnable to prevent leakage

* cleanup tests, make values static so tests pass consistently

- use attach listener alias APIs
- remove magic number constants
- fix some incoherent html / script tag stuff

* begin implementation for returning fromAutWindow

- restore original fromWindow algorithm
- begin writing fromAutWindow for calculating red hitbox coordinates
which are layered on the AUT

* move describe block with the others

* refactor actions to DRY up duplicated logic between click/dblclick/rightclick

- tighten up the mouse.js method names, name them consistently

* remove comment

* fix iframe coords and test

* rename fromDocCoords->fromWindowCoords, fix type_spec ux test

* tighten up method, remove unnecessary arg

* add debug logic for retries to console.error() non cypress errors

* renamed fromWindow -> fromElWindow, and fromViewport -> fromElViewport

* handle calculating the fromElWindow coordinates inline

* extract out function for clarity, receive consistent arg names

* cleanup, add lots of comments


Co-authored-by: Brian Mann <brian.mann86@gmail.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
This commit is contained in:
Ben Kucera
2019-10-11 18:43:57 -04:00
committed by Brian Mann
parent a877474df1
commit abdf436638
34 changed files with 3768 additions and 1041 deletions
+8 -1
View File
@@ -620,7 +620,14 @@ declare namespace Cypress {
*
* @see https://on.cypress.io/dblclick
*/
dblclick(options?: Partial<Loggable>): Chainable
dblclick(options?: Partial<ClickOptions>): Chainable<Subject>
/**
* Right-click a DOM element.
*
* @see https://on.cypress.io/rightclick
*/
rightclick(options?: Partial<ClickOptions>): Chainable<Subject>
/**
* Set a debugger and log what the previous command yields.
+4
View File
@@ -452,3 +452,7 @@ cy.writeFile('../file.path', '', {
flag: 'a+',
encoding: 'utf-8'
})
cy.get('foo').click()
cy.get('foo').rightclick()
cy.get('foo').dblclick()