codeceptjs / codeceptjs/CodeceptJS
[feature-request] Send `current` into `Before` / `After` hooks in Data Driven Tests
Open
- Dominant language
- JavaScript
- Stars
- 4.2k
- Forks
- 757
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 16
Description
sample
```
let accounts = new DataTable(['login', 'password']);
accounts.add(['davert', '123456']);
accounts.add(['admin', '123456']);
Before(async (I, current) => {
await fetch('/api/createTestAccount', {method: 'post', body: JSON.stringify(current)})
});
Data(accounts).Scenario('Test Login', (I, current) => {
I.fillField('Username', current.login);
I.fillField('Password', current.password);
I.click('Sign In');
});
After(async (I, current) => {
await fetch('/api/removeTestAccount', {method: 'post', body: JSON.stringify(current)});
});
```
Contributor guide
Assessment
This issue has not been assessed yet.