codeceptjs / codeceptjs/CodeceptJS
[feature-request] Send `current` into `Before` / `After` hooks in Data Driven Tests
Aperta
- Lingua principale
- JavaScript
- Stelle
- 4.2k
- Fork
- 757
- Merge medio
- 2g 9h
- PR unite (30g)
- 16
Descrizione
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)});
});
```
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.