Mobile testing helper for Cypress
![map pan and zoom](https://gitlab.com/nTopus/cy-mobile-commands/uploads/8142ff0818f4326032c722c7b5348029/map.gif
Step 1, intall this package
npm install --save-dev cy-mobile-commands
Step 2, load it to your Cypress test context
cypress/support/index.js and add:
Step 3, ...
there is no more steps.
configObject parameter is optional. The available options are:
delay: (number of milliseconds = 300) the delta time from the
steps: (integer = computed) the number of steps between two checkpoints.
draw: (boolean = true) display the swipe path over the page.
You can set two or more steps to make the swipe path as complex as you need.
checkpoint# can be a position, or an array of positions. An array of positions perform a multi touch action.
Where position can be:
- A explicit position defined with number values:
- A named position:
center. (You can replace
It is exactly like the
cy.visit command, extended with some env configuration to make mobile friendly libs to believe it is a mobile env.
💡 Tip: If your lib expects a mobile env not yet provided by
cypress open and with the visible browser GUI, open the console (F12) and click in "Toggle device toolbar" icon (or press
Ctrl+Shift+M). Then you can run the test again as it was in a mobile chrome.