Skip to content

Commit

Permalink
Emptied copied readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Svish committed Dec 13, 2019
1 parent c052e84 commit b900d37
Showing 1 changed file with 1 addition and 42 deletions.
43 changes: 1 addition & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1 @@
# cypress-helper-getcy

A simple [Cypress](https://www.cypress.io/) [command](https://docs.cypress.io/api/cypress-api/custom-commands.html) for getting elements via `data-cy` attributes.

[![npm version](https://img.shields.io/npm/v/cypress-helper-getcy.svg?style=flat-square) ![npm downloads](https://img.shields.io/npm/dm/cypress-helper-getcy?style=flat-square)](https://www.npmjs.com/package/cypress-helper-getcy)

## Inspiration

- [Cypress Best Practices](https://docs.cypress.io/guides/references/best-practices.html#Selecting-Elements)

### Why not just `cy.get('[data-cy=submit]')`?

Well, I like clean tests, and I found both the test code and logs to be rather ugly and harder to read when doing that. So I wanted something cleaner, and made this, which cleans up both the code and the log. 👍

## Setup

### 1. Install

```shell
npm install --save-dev cypress-helper-getcy
```

### 2. Include

```js
// E.g. in cypress/support/index.js
include 'cypress-helper-getcy';
```

## Usage

```html
<div data-cy="my-test-subject"></div>
```

```js
it('finds my test subject', () => {
cy.getCy('my-test-subject').should('exist');
});
```

_**Note:** See [tests](test/tests/getCy.ts) for more examples._
# cypress-hmr-restarter

0 comments on commit b900d37

Please sign in to comment.