Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nitive/nightwatch-mocha-each-hooks
https://github.com/nitive/nightwatch-mocha-each-hooks
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nitive/nightwatch-mocha-each-hooks
- Owner: Nitive
- Created: 2019-06-18T18:01:05.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-05T13:13:40.000Z (almost 2 years ago)
- Last Synced: 2024-04-17T06:01:14.199Z (10 months ago)
- Language: JavaScript
- Homepage:
- Size: 229 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# beforeEach and afterEach hooks bug example
Problem: beforeEach and afterEach hooks are not called when using mocha runner.
Issue: https://github.com/nightwatchjs/nightwatch/issues/1477Steps to reproduce:
1. Install dependencies with `npm install` or `yarn install`
2. Run `npm run nightwatch`. The output will be:
```bash
> nightwatchGLOBAL before
GLOBAL beforeEach
Running: Demo test GitHub✔ Element was visible after 25 milliseconds.
✔ Element <.container h1 strong a> was visible after 23 milliseconds.
✔ Checking project title is set to nightwatch - 25 ms.OK. 3 assertions passed. (2.581s)
GLOBAL afterEach
GLOBAL after
```
You can see that beforeEach and afterEach hooks have been called
3. Run `npm run mocha`. The output will be:```bash
> MOCHA=1 nightwatchGLOBAL before
Github
✓ Demo test GitHub (1468ms)1 passing (3s)
GLOBAL after
```
beforeEach and afterEach hooks have not been called