【发布时间】:2021-04-20 20:32:11
【问题描述】:
我想登录一个应用程序,从测试数据中运行几次搜索,然后退出。我不想为数据集中的每个项目登录和退出,如果我这样编码就会出现这种情况......
dataSet.forEach(数据 =>{ test('搜索测试', async t => {......
我希望能够...
test('搜索测试', async t => {...... foreeach(数据集中的数据) 调用函数进行搜索 调用一个函数来验证搜索返回。
这样的……
test('Simple Search Test', async t => {
//await t
await loginPage.login(loginName, password);
await t
.expect(getURL()).contains('home')
// Check logged in user display...
.expect(pageHeader.userName.withText(data.loggedInUser).visible).ok()
dataSet.forEach(data =>{
leftSidebar.searchWithCriteria(data.criteria, 'Filename');
recordNav.verifyTotal(data.srchresult);
});
// Log out
await pageHeader.logout();
await t
.expect(loginPage.copyRight.visible).ok();
});
enter code here
我已经尝试了所有方法,但无法正常工作。这是可能的,还是必须为集合中的每个数据记录运行整个测试?
【问题讨论】:
标签: testing automation automated-tests e2e-testing testcafe