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

data-cy shorthand notation for cypress get and find functions


Version published
Weekly downloads
328
decreased by-40.69%
Maintainers
1
Install size
8.18 kB
Created
Weekly downloads
 

Readme

Source

Build Status

cypress-cy-select

data-cy shorthand notation for cypress .get() and .find() commands.

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 28 Feb 2023

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