# cypress-cy-select

> data-cy shorthand notation for cypress get and find functions

Latest version **0.2.3** (published 2023-02-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install cypress-cy-select
pnpm add cypress-cy-select
yarn add cypress-cy-select
bun add cypress-cy-select
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2023-02-28 |
| First published | 2019-10-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Florian Goussin |
| Maintainers | floriangoussin |
| Keywords | cypress, e2e, end to end, test, selector, overwrite, custom, commands, get, find |

## Links

- npm: https://www.npmjs.com/package/cypress-cy-select
- Repository: https://github.com/FlorianGoussin/cypress-cy-select
- Issues: https://github.com/FlorianGoussin/cypress-cy-select/issues
- npm.io page: https://npm.io/package/cypress-cy-select

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 0.2.3 (latest) — 2023-02-28
- 0.2.2 — 2020-04-09
- 0.2.0 — 2019-11-08
- 0.1.9 — 2019-11-07
- 0.1.8 — 2019-11-07
- 0.1.7 — 2019-11-04
- 0.1.6 — 2019-11-04
- 0.1.5 — 2019-11-04
- 0.1.4 — 2019-11-02
- 0.1.3 — 2019-11-02
- 0.1.2 — 2019-11-02
- 0.1.1 — 2019-11-02
- 0.1.0 — 2019-11-02
- 0.0.3 — 2019-10-30
- 0.0.2 — 2019-10-30
- … 1 more at https://npm.io/package/cypress-cy-select/versions

## README

[![Build Status](https://travis-ci.com/FlorianGoussin/cypress-cy-select.svg?branch=master)](https://travis-ci.com/FlorianGoussin/cypress-cy-select)

# cypress-cy-select

data-cy shorthand notation for cypress [`.get()`](https://on.cypress.io/get) and [`.find()`](https://on.cypress.io/find) commands.

## Install

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

## Usage

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

```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:

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

will be actually formatted to:

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

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

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

This:

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

will be actually formatted to:

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

---
_Source: https://npm.io/package/cypress-cy-select · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
