Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
JaySunSyn authored Apr 25, 2019
1 parent a8e9084 commit 178513a
Showing 1 changed file with 4 additions and 30 deletions.
34 changes: 4 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
### Installation
# Cypress Daywalker

## Installation

Add the plugin to `devDependencies`
```bash
Expand All @@ -10,35 +12,7 @@ At the top of **`cypress/support/commands.js`**:
import 'cypress-daywalker/commands'
```

**Include the daywalker script:**

either via a) At the top of your entrypoint e.g. **`index.html`** add following script tag
```html
<script src="./node_modules/cypress-daywalker/cypress-daywalker.js"></script>
```
or via b) Dynamically add the daywalker script before each test

```javascript
context('Default', () => {
before(() => {

cy.on('window:before:load', (w) => {
const script = w.document.createElement('script');
script.src = '/node_modules/cypress-daywalker/cypress-daywalker.js';
w.document.querySelector('head').appendChild(script);
});

cy.visit('http://localhost:3000/');
});

it('input gets filled', () => {
...
});
});

```

### Usage
## Usage
[Example](https://github.com/JaySunSyn/cypress-daywalker/blob/master/example/cypress/integration/example.spec.js)

Some custom commands:
Expand Down

0 comments on commit 178513a

Please sign in to comment.