我为我的网站写了一个夜间监视js e-t-e测试。我的网站有一个右侧选项卡,用作允许用户导航的菜单。问题是我的niightwatch无法执行单击选项卡。我尽一切可能无济于事。
this.addLine = function(vertices)
{
var geometry = new THREE.Geometry();
for (var i = 0; i < vertices.length; i++)
{
geometry.vertices.push(new THREE.Vector3(
vertices[i].X,
vertices[i].Y,
vertices[i].Z));
}
var line = new THREE.Line(geometry, new THREE.LineBasicMaterial({}));
line.width = 199.9;
scope.scene.add(line);
};
.verifying var objects = [
{ X: 216939.73, Y: 6595308.75, Z: 547.92 },
{ X: 216927.30, Y: 6595310.31, Z: 547.92 },
{ X: 216929.54, Y: 6595328.01, Z: 547.92 },
{ X: 216941.93, Y: 6595326.46, Z: 547.92 },
{ X: 216939.73, Y: 6595308.75, Z: 547.92 },
{ X: 209160.61, Y: 6589441.50, Z: 547.92 },
{ X: 209163.06, Y: 6589460.77, Z: 547.92 },
{ X: 209185.80, Y: 6589457.87, Z: 547.92 },
{ X: 209183.25, Y: 6589438.52, Z: 547.92 },
{ X: 209160.61, Y: 6589441.50, Z: 547.92 },
{ X: 220745.54, Y: 6593881.96, Z: 547.92 },
{ X: 220762.77, Y: 6593892.37, Z: 547.92 },
{ X: 220767.23, Y: 6593885.00, Z: 547.92 },
{ X: 220750.01, Y: 6593874.55, Z: 547.92 },
{ X: 220745.54, Y: 6593881.96, Z: 547.92 },
];
viewer.addLine(objects);
目前返回正面。但是,点击.verify.elementPresent('div[role="tab"][title="Asset Index"]')
.click('#right-tab-list div:nth-child(5)', function(status){
console.log('the click status is', status.status);
browser.click('#right-tab-list div:nth-child(5)');
})
.waitForElementVisible('div[role="tab"][aria-selected="true"][title="Asset Index"]', 3000)
的{{1}}失败了。第五个孩子是div[role="tab"][title="Asset Index"]
。点击状态返回-1。在我的代码
div:nth-child(5)
验证元素存在返回true。但是,点击状态返回否定。诉讼#right-tab-list
也失败了。我尽可能地尝试了一切。它虽然工作了4个月。我今天不确定为什么不这样做。任何帮助将不胜感激。