【发布时间】:2019-03-07 20:40:40
【问题描述】:
我正在尝试访问非角页面,例如 google.com,然后单击该页面上的链接。 我正在使用带有黄瓜插件的量角器。 我的黄瓜功能是这样的:
Feature: Google
Scenario: Google test
Given I visit google
When I click the link
Then result
步骤定义如下所示:
Given('I visit google', function(callback) {
browser.driver.get('https://www.google.com')
.then(callback);
});
When('I click the link', function() {
browser.driver.findElement(by.linkText('Images')).click();
});
Then('result', function() {
});
运行量角器时,页面打开,但未点击链接(未加载 Google 图片搜索)
如何让被点击的链接重定向到谷歌图片搜索?
【问题讨论】:
标签: javascript angular testing protractor cucumber