garris / garris/BackstopJS

Support onAfter

Open
#985 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.2k
Forks
621
PR merge metrics
No merged PRs in 30d

Description

In some cases, a callback is needed after each scenario is tested. Similar to all the other testing frameworks that provide `afterEach`, it would be very useful to support `onAfter`.

In my case, because the back-end has limited number of active sessions, I need a callback to log out the testing account after each scenario.

I'd love to have something similar like `onAfterScript`, and then I can simply do this
```
// onAfter.js
module.exports = async (page, scenario, vp) => {
await page.evaluate(() => logout());
};
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.