Socket
Socket
Sign inDemoInstall

cypress-cy-select

Package Overview
Dependencies
0
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cypress-cy-select

Allows cypress get and find to use cy shorthand notation


Version published
Weekly downloads
489
increased by4.94%
Maintainers
1
Install size
5.37 kB
Created
Weekly downloads
 

Readme

Source

cypress-cy-select

Allows cypress get and find to use cy shorthand notation within get and find functions

Install

npm i --save-dev cypress-cy-select

Usage

In support/commands.js or support/index.js:

import setup from 'cypress-cy-select';
setup();

Use cy.get as you would normally use it, but you can now select data-cy with a shorthand notation: cy|mySelector

This:

cy.get("cy|mySelector .myClass1 > .myClass2 tagName")

will be actually formatted to:

cy.get('[data-cy="mySelector"] .myClass1 > .myClass2 tagName')

Alternatively, if you don't want the defaults, you can pass a configuration object:

const config = {
  name: 'e2e',
  separator: ':'
}
setup(config);

This:

cy.get("e2e:mySelector .myClass1 > .myClass2 tagName")

will be actually formatted to:

cy.get('[data-e2e="mySelector"] .myClass1 > .myClass2 tagName')

Keywords

FAQs

Last updated on 02 Nov 2019

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc