You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

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

0.2.3
latest
Source
npm
Version published
Weekly downloads
622
21.72%
Maintainers
1
Weekly downloads
 
Created
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

cypress

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