【发布时间】:2014-06-19 07:11:25
【问题描述】:
我正在尝试使用量角器为我的应用创建一些测试。
browser.get 没问题,当我的页面加载完毕并启动我的应用程序时,第一个测试正在运行。
it('should go to the where and when page', function() {
var nextButton = element(by.id('cg_btnValidationQuoi'));
expect(nextButton.getText()).toBe('Suivant');
}
这会导致超时。
it('should go to the where and when page', function() {
var nextButton = element(by.id('cg_btnValidationQuoi'));
nextButton.click()
}
导致“错误:使用定位器找不到元素:By.id("cg_btnValidationQuoi")”
it('should go to the where and when page', function() {
var nextButton = element(by.id('cg_btnValidationQuoi'));
expect(nextButton.getInnerHtml()).toBe('Suivant');
}
原因:
信息: 预期的 ' 被告人 '成为'Suvant'。这听起来像是任何人都知道的事情吗?
【问题讨论】:
-
你用的是哪个量角器版本?
-
这确实很奇怪,我们显然遗漏了一些东西。你能给我们更多的代码/信息吗?
-
我无法粘贴原始代码,但我写了一个类似的副本!在这里找到它:jsfiddle.net/89AR9
标签: angularjs protractor angularjs-e2e