codeceptjs / codeceptjs/CodeceptJS

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

Aperta
#1,243 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
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.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.