You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

cypress-cy-select

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

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
694
increased by24.15%
Maintainers
1
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

Package last updated on 28 Feb 2023

Did you know?

Socket

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
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc