What are the methods we can use to wait for an Angular site to be loaded in order to test it with protractor in order to avoid this error caused by jasmine : A Jasmine spec timed out. Resetting the WebDriver Control Flow
?
I'm able to make the login and go to home page that test is passed, but from the second test i have problems of jasmine.
相关问题
- angularJS: ui-router equivalent to $location.searc
- Separate AngularJS Controllers Into Separate Files
- Angular ngAnimate not working first time on page l
- Ionic Spinner not showing up
- Upload file to Google Cloud Storage using AngularJ
相关文章
- Passing variable through URL with angular js
- Watch entire object (deep watch) with AngularJS
- Angular ng-if change span text
- How exactly do Firebase Analytics handle session d
- Can ng-show directive be used with a delay
- AngularJS $routeParams vs $stateParams
- Multiple parameters in AngularJS $resource GET
- How to set class/style of accordion heading in Ang
Can you wait for a url? Let's assume that when you click on the login button your page is redirected to another url. So you can wait for the expected url. Example:
This code waits for the page
browser.baseUrl/Dashboard
to be loaded, for 60 secondsThis error means that your test took too much time and exceeded the default Jasmine spec timeout interval which is 30 seconds by default (It looks like you've configured the timeout to be 60 seconds). It can be configured in the
jasmineNodeOpts
object in your Protractor config:The solution is usually use-case specific and it usually indicates there is an error in the test code. In order to fully understand what is going, we would need to see the code itself.
In your particular case, for starters, you should try moving the "ignore synchronization" and the
browser.get()
part into thebeforeEach
. Also, since you are turning the sync off, you need to wait for the element to be present on the page before interacting with it:And, I am not sure if you really need to turn the synchronization off since this is an AngularJS page you are working with.
You can use the browser object of Protractor to wait for angular.
As soon as you load your page add the following :
I have configured this problem by adding this function into my config file :