【发布时间】:2019-10-10 14:13:24
【问题描述】:
我的应用有超过 1 个登录按钮,在测试各种功能时,它在 12 次迭代中的第 1 次和第 8 次迭代失败。需要建议来修复代码。
public async clickLoginMenu() {
try {
const button = await element(await by.buttonText('Login'));
/* await browser.executeScript('return arguments[0].click()', await button).then(() => {
browser.sleep(2000);
});*/
await browser.wait(until.presenceOf(await button), TIMEOUT_MILLIS,
'Unable to locate logout button.');
await button.click();
} else {
logger.info('Cannot find the login button to click');
}
} catch (e) {
logger.error('Throw Exception error ' + e);
}
}
【问题讨论】:
标签: typescript jasmine protractor