codeceptjs / codeceptjs/CodeceptJS
[feature-request] Send `current` into `Before` / `After` hooks in Data Driven Tests
未关闭
- 主要语言
- JavaScript
- 星标
- 4.2k
- 派生
- 757
- 平均合并
- 2 天 9 小时
- 30 天内合并 PR
- 16
描述
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)});
});
```
贡献指南
评估
这个 Issue 还没有评估数据。