“angular is not defined” error while executing Protractor test on angular application stored in Liferay

核能气质少年 提交于 2019-12-01 04:27:43

The problem is likely that your tests are running before the browser page is completely loaded. The angular global variable has not been created yet. You can ensure that all has been loaded before tests start by putting the following line in your protractor.conf.js file's onPrepare method:

browser.driver.get(browser.baseUrl);

This will navigate to the page before any tests start and ensure that all is loaded.

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,

in the config.js file and now the tests is running okay.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!