ignoreSynchronization still has immediate side effects, needs to be executed on control flow
See original GitHub issueProtractor Version: 5.1
I have tests that navigate to a non-Angular page (OAuth login), then after login they continue on my Angular app. The outline looks like this:
// Gonna leave to 3rd party page, disable synchronization
browser.ignoreSynchronization = true;
element(by.css('.sign-in-button')).click();
// Now we're on the login page
browser.wait(ExpectedConditions.visibilityOf(element(by.id('Email'))));
element(by.id('Email')).sendKeys('jimmy');
element(by.id('next')).click();
// .. and so on
// This one redirects back to my page:
element(by.id('submit_approve_access')).click();
// Now I want to proceed with testing my app
browser.ignoreSynchronization = false;
// Run test scenario
As you can see, I am updating ignoreSynchronization
twice. Problem is, part of the call is executed in control flow, but it also immediately (synchronously) updates internalIgnoreSynchronization
. As a result, this whole test fails because after navigating away to OAuth provider, it’s still looking for window.angular there.
I think it can be worked around by manually putting that in control flow:
browser.controlFlow().execute(() => { browser.ignoreSynchronization = false; });
However, it seems like a bug to me. If it is intended, I would really like to understand the rationale and correct usage (docs needed?).
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
What is browser.ignoreSynchronization in protractor?
There are cases when an understanding of the control flow, ... to the control flow after the rest of the functions in the...
Read more >chore(core): Add better error message for client-side redirects ...
My use case: I have a test that enters username/password and hits a log ... waitForAngular() because protractor will continue control flow ......
Read more >Untitled
IgnoreSynchronization still has immediate side effects, needs to be executed on control flow #4061. Protractor Version: 5.1 I have tests that navigate to...
Read more >Untitled
IgnoreSynchronization still has immediate side effects, needs to be executed on control flow #4061. Protractor Version: 5.1 I have tests that navigate to...
Read more >Silk Test 21.0 - Micro Focus
Do I Need Administrator Privileges to Run Silk4J? ... If you have not created the package yet, type the package name into the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Actually, that workaround still does not put things in the right order. What seems to be working for me is:
Thanks, glad you like it :-)Yes, Blocking Proxy is a really cool project, great job! I wrote a piece on it some time ago.