quot;angular is not definedquot; error while executing Protractor test on angular application stored in Liferay(“角度未定义对存储在 Liferay 中的角度应用程序执行量角器测试时出错)
问题描述
我在 Ubuntu 14.04 虚拟主机上运行,我正在尝试使用 PROTRACTOR 和托管在Liferay"中的应用程序创建一些 E2E 测试.
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".
对于登录部分(不需要角度),使用量角器的测试正常,页面登录并正确导航,但是当我尝试在基于 angularjs 的应用程序上打开下拉"菜单时,使用以下内容代码:
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>
我收到了这个错误日志:
i got this error log:
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
推荐答案
谢谢你,问题是测试没有等到 angular 加载到页面...所以我用"Grunt"、Yeoman"和 Ruby +ruby-compass" gem 并避免使用 liferay.我也设置了
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 中的角度应用程序执行量角器测试时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:“角度未定义"对存储在 Liferay 中的角度应用程序执行量角器测试时出错
基础教程推荐
- Chart.js 在线性图表上拖动点 2022-01-01
- 如何使用TypeScrip将固定承诺数组中的项设置为可选 2022-01-01
- html表格如何通过更改悬停边框来突出显示列? 2022-01-01
- 直接将值设置为滑块 2022-01-01
- 如何使用JIT在顺风css中使用布局变体? 2022-01-01
- 我可以在浏览器中与Babel一起使用ES模块,而不捆绑我的代码吗? 2022-01-01
- Electron 将 Node.js 和 Chromium 上下文结合起来意味着 2022-01-01
- Vue 3 – <过渡>渲染不能动画的非元素根节点 2022-01-01
- 自定义 XMLHttpRequest.prototype.open 2022-01-01
- 用于 Twitter 小部件宽度的 HTML/CSS 2022-01-01