“未定义角度”在Liferay中存储的角度应用程序上执行Protractor测试时出错 [英] "angular is not defined" error while executing Protractor test on angular application stored in Liferay
问题描述
我在Ubuntu 14.04虚拟主机上运行,我正在尝试使用PROTRACTOR创建一些E2E测试,并在Liferay中托管应用程序。
i'm running on a Ubuntu 14.04 virtual-host and i'm trying to create some E2E tests with PROTRACTOR for and Application hosted in "Liferay".
对于登录部分(不需要角度),使用量角器的测试都没问题,页面登录并正确导航,但是当我尝试打开drop时基于angularjs的app上的down菜单,代码如下:
For the login section (that doesn't require angular) the test with protractor are Ok, the page logins and navigates correctly, but when i try to open a "drop-down" menu on the angularjs based app with the following code:
<select class = "form-control menu-select ng-pristine ng-valid"
ng-model = "topTitlesData.topFiveDateRange"
name = "topFiveDateRange"
ng-options = "range.name for range in topTitlesData.topFiveDateRangeValues"
ng-change = "" > < option value = "0" > Last day < /option><option value="1">Last 5 days</option > < option value = "2" > Last 7 days < /option><option value="3">Last 30 days</option > < option value = "4" > last 90 days < /option></select>
我收到此错误日志:
UnknownError:未知错误:未定义角度
UnknownError: unknown error: angular is not defined
This is the test script on js:
describe('pages with login', function() {
it('should log in with a non-Angular page and select and option', funcion() {
browser.ignoreSynchronization = true;
browser.get('***************');
element(by.id('_58_login')).clear();
element(by.id('_58_login')).sendKeys('*******');
expect(element(by.id('_58_login')).getAttribute('value')).toEqual('*****');
element(by.id('_58_password')).sendKeys('*****', protractor.Key.ENTER);
browser.get('***************');
//browser.ignoreSynchronization = false;
var selects = element.all(by.model('topTitlesData.topFiveDateRange'));
expect(selects.count()).toEqual(5);
});
});
我是想知道,我缺少什么?
i'm wondering, what am i missing ?
我有nodejs,量角器,webadmin-manager,jdk7。*安装和更新
i have nodejs, protractor, webadmin-manager,jdk7.* installed and updated
推荐答案
谢谢,问题是测试没有等到加载到页面的角度...所以我用Grunt设置了一个带有应用程序的localhost, Yeoman和Ruby +ruby-compass宝石,避免了生命。我也设置了
thank you, the issue was that the tests didn't wait till angular in loaded to the page... so i setup a localhost with the application with "Grunt", "Yeoman" and Ruby + "ruby-compass" gem and avoided liferay. I also setup
allScriptsTimeout: 5000000,
在config.js文件中,现在测试运行正常。
in the config.js file and now the tests is running okay.
这篇关于“未定义角度”在Liferay中存储的角度应用程序上执行Protractor测试时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!