
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
cy-mobile-commands
Advanced tools
npm install --save-dev cy-mobile-commands
Open cypress/support/index.js
and add:
import 'cy-mobile-commands'
there is no more steps.
swipe
.swipe(checkpoint1, checkpoint2[, ..., checkpointN])
.swipe(configObject, checkpoint1, checkpoint2[, ..., checkpointN])
The configObject
parameter is optional. The available options are:
delay
: (number of milliseconds = 300) the delta time from the touchstart
to touchend
.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.
Where checkpoint#
can be a position, or an array of positions. An array of positions perform a multi touch action.
Where position can be:
[clientX, clientY]
.left
, right
, top
, bottom
, top-left
, top-right
, bottom-left
, bottom-right
or center
. (You can replace kebab-case
by camelCase
)visitMobile
cy.visitMobile(url)
cy.visitMobile(url, options)
cy.visitMobile(options)
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.
For now it is necessary for swipe.js and leaflet.js.
If you discover a lib that wont work with cy.visit
or cy.visitMobile
, please, send us a issue.
💡 Tip: If your lib expects a mobile env not yet provided by cy.visitMobile
, run 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.
it('page switch', () => {
cy.visit('book.somewhere')
cy.get('#my-page1').should('be.visible')
cy.get('#my-page2').should('not.be.visible')
cy.get('#my-slidable-book').swipe('right', 'left')
cy.get('#my-page1').should('not.be.visible')
cy.get('#my-page2').should('be.visible')
})
it('zoom a map', () => {
cy.visitMobile('map.somewhere')
cy.get('#map').swipe({delay: 2000}, [[80,250],[80,350]], [[80,100],[80,500]])
})
FAQs
Mobile testing helper for Cypress
The npm package cy-mobile-commands receives a total of 12,286 weekly downloads. As such, cy-mobile-commands popularity was classified as popular.
We found that cy-mobile-commands demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.