問題描述
我在 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 中的角度應用程序執行量角器測試時出錯的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!