Automated tests 单击下拉列表中带有“编辑”或“删除”按钮的下拉窗口时出现问题

Automated tests 单击下拉列表中带有“编辑”或“删除”按钮的下拉窗口时出现问题,automated-tests,click,e2e-testing,testcafe,web-testing,Automated Tests,Click,E2e Testing,Testcafe,Web Testing,将1与2和1与3进行比较,当我从expect中排除Wait或当我确实在等待t时,可以单击编辑 1. wait t t.expect(DetailsPage.commentsBody.find(`.dropdown menu.show`)。存在)。确定(`comments dropdown menu unavailable`) .click(DetailsPage.edit)/***----不单击并抛出错误*** .expect(wait DetailsPage.addCommentWindow.

将1与2和1与3进行比较,当我从expect中排除Wait或当我确实在等待t时,可以单击编辑

1.
wait t t.expect(DetailsPage.commentsBody.find(`.dropdown menu.show`)。存在)。确定(`comments dropdown menu unavailable`)
.click(DetailsPage.edit)/***----不单击并抛出错误***
.expect(wait DetailsPage.addCommentWindow.value).eql(comData.comment);
2.
wait t t.expect(DetailsPage.commentsBody.find(`.dropdown menu.show`)。存在)。确定(`comments dropdown menu unavailable`)
。单击(DetailsPage.edit)/**----是否单击且没有错误**
.expect(DetailsPage.addCommentWindow.value).eql(comData.comment);
3.
wait t t.expect(DetailsPage.commentsBody.find(`.dropdown menu.show`)。存在)。确定(`comments dropdown menu unavailable`)
。单击(DetailsPage.edit);//**-是否单击并没有错误**
wait t.expect(wait DetailsPage.addCommentWindow.value).eql(comData.comment);

选项2是正确的。切勿在
expect
中使用
wait
。TestCafe等待选择器的承诺,并在正确的时间和指定的超时期间执行该操作。选项1不起作用,因为您在单击
DetailsPage.addCommentWindow.value
之前强制执行了
DetailsPage.edit
评估