【发布时间】:2019-03-25 08:45:50
【问题描述】:
我正在尝试使用 testcafe 测试应用程序的提交。但是,我似乎无法让 testcafe 点击“提交申请”。
到目前为止,我已经尝试了以下方法:
.click(Selector('button').withText('Submit Applicaition'))
.click('#submit-application').withText('Submit Application')
还有更多选择。
我什至无法让 testcafe 找到按钮
import {Selector} from 'testcafe';
fixture `MES login`
.page `http://mes.coeo.com.au/`;
test('FindButton', async t => {
await t
.wait(2000)
.navigateTo('/le12625-senior-exploration-geologist')
.wait(2000);
const one = await Selector('#submit-application');
const two = one.exists;
await t
.expect(two).ok()
await t
.wait(5000)
.click(Selector(one));
}
谁能帮我解释一下是我的testcafe脚本还是网站的构建方式以及如何让testcafe点击按钮?
非常感谢。
【问题讨论】:
-
您的测试对我有用,但单击按钮确实会触发 javascript 错误。您还可以添加测试失败时遇到的错误吗?
标签: javascript button automated-tests e2e-testing testcafe