Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Potential fix for issue 4151: Forked driver ignores waitForAngularEnabled#4418

Open
slotik wants to merge 1 commit intoangular:masterfrom
slotik:master
Open

Potential fix for issue 4151: Forked driver ignores waitForAngularEnabled#4418
slotik wants to merge 1 commit intoangular:masterfrom
slotik:master

Conversation

@slotik
Copy link
Copy Markdown

@slotik slotik commented Aug 1, 2017

Very minimalistic candidate to fix #4151.

My hope is that it won't break other stuff.

@slotik
Copy link
Copy Markdown
Author

slotik commented Aug 6, 2017

@cnishina Do you think you might find the time to look at this within the following week? It would be super helpful if a fix for the issue got released in the near future.

@slotik slotik closed this Oct 3, 2017
@slotik slotik reopened this Oct 3, 2017
@slotik
Copy link
Copy Markdown
Author

slotik commented Jan 26, 2018

@wojtek1150 Could we merge this in? Is that something I can do?

@rafalf
Copy link
Copy Markdown

rafalf commented Apr 9, 2018

when will this be available?

@rafalf
Copy link
Copy Markdown

rafalf commented Apr 9, 2018

@cnishina, @wojtek1150 @slotik @wswebcreation can we merge this?

Comment thread lib/browser.ts
*/
waitForAngularEnabled(enabled: boolean|wdpromise.Promise<boolean> = null):
wdpromise.Promise<boolean> {
waitForAngularEnabled(enabled: boolean|wdpromise.Promise<boolean> = null): boolean
Copy link
Copy Markdown
Contributor

@qiyigg qiyigg May 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of changing the return type? IMO, changing the return type will make user confused and user don't know whether the function is async or not. If you want to give a clear/accurate type inference, you could use function overloading.

Comment thread lib/runner.ts
browser_.forkNewDriverInstance =
(useSameUrl: boolean, copyMockModules: boolean, copyConfigUpdates = true) => {
let newBrowser = this.createBrowser(plugins);
let newBrowser = this.createBrowser(plugins, browser_);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, using the default config or the config of current browser for new browser, both of them make sense.
Creating browser based on parent browser just copy some init data from parent browser, I don't know why setting "waitForAngularEnabled" after creating the browser doesn't work in your case. Perhaps "waitForAngularEnabled" is async, you need wait for it? I am a little hesitate about this since I don't know whether some tests rely on the previous behavior and this change will break their tests.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Forked driver instance ignores waitForAngularEnabled

6 participants