codeceptjs / codeceptjs/CodeceptJS

[feature-request] Send `current` into `Before` / `After` hooks in Data Driven Tests

Open
#1,243 0 comments 0 reactions 0 assignees View on GitHub
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

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.