Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overloaded method to either clear or not for existing driver when calling driver().use() #214

Merged
merged 2 commits into from May 2, 2019

Conversation

privatejava
Copy link

Sometime we want not to close the current webdriver and switch between the driver then we cannot just do $.driver().use(webDriver); because it will automatically close the existing driver. So to make it easy we need an extra parameter for developer to either clear or not the existing driver before instantiating the new webdriver.

$.driver().use(webDriver,false);

@codecov
Copy link

codecov bot commented Mar 9, 2019

Codecov Report

Merging #214 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #214      +/-   ##
============================================
+ Coverage     84.38%   84.39%   +<.01%     
============================================
  Files           342      342              
  Lines          3483     3485       +2     
  Branches        277      277              
============================================
+ Hits           2939     2941       +2     
  Misses          444      444              
  Partials        100      100
Impacted Files Coverage Δ Complexity Δ
...eniumquery/browser/driver/SeleniumQueryDriver.java 91.17% <100%> (+0.55%) 0 <0> (-14) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f1f24f...629b8ff. Read the comment docs.

@acdcjunior
Copy link
Member

acdcjunior commented Mar 9, 2019

I like the idea, there's a real use case there. How about, instead of creating a new overloaded method, we create a different one, say:

$.driver().switch(anotherWebDriver);

And also add a note mentioning it in the .use() javadoc?

What do you think?

@privatejava
Copy link
Author

privatejava commented Mar 9, 2019 via email

@acdcjunior
Copy link
Member

acdcjunior commented Mar 9, 2019 via email

@privatejava
Copy link
Author

I have changed it to switchTo since switch is keyword :)

@acdcjunior acdcjunior merged commit 8495d35 into seleniumQuery:master May 2, 2019
@acdcjunior
Copy link
Member

Thanks a lot. Sorry for the immense delay (I was hoping to find time to do many changes to release one big version, but I don't seem to find the time -- I have a newborn :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants