Added restart driver capability#14
Open
dimitrianos wants to merge 1 commit into
Open
Conversation
thanosa75
requested changes
Aug 4, 2020
| @Bean | ||
| public WebController getWebController(@Autowired AnaxDriver anaxDriver, @Value("${anax.defaultWaitSeconds:5}") Integer defaultWaitSeconds) throws Exception { | ||
| return new WebDriverWebController(anaxDriver.getWebDriver(), defaultWaitSeconds); | ||
| return new WebDriverWebController(anaxDriver.getWebDriver(), anaxDriver, defaultWaitSeconds); |
Collaborator
There was a problem hiding this comment.
@dimitrianos pls simplify the signature to new WebDriverWebController(anaxDriver, defaultWaitSeconds) since you can receive the WebDriver from that object - no need to have both of them.
| */ | ||
| String getPageSource() ; | ||
|
|
||
| boolean restart(); |
Collaborator
There was a problem hiding this comment.
please add documentation - why restart exists and what it does, how
| public AppiumDriverWebController(WebDriver webDriver, long defaultWaitSeconds) { | ||
| public AppiumDriverWebController(WebDriver webDriver, AnaxDriver anaxDriver, long defaultWaitSeconds) { | ||
| this.driver = webDriver; | ||
| this.anaxDriver = anaxDriver; |
Collaborator
There was a problem hiding this comment.
replace this.driver = webDriver with this.driver = anaxDriver.getWebDriver() - much cleaner after you simplify the signature (see first comment)
| return null; | ||
| } | ||
|
|
||
| @Override |
Collaborator
There was a problem hiding this comment.
Instead of adding restart() as implementation to all drivers, consider adding a default on the interface (that returns false) and only implement in WebControllers that can possibly do it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restart browser is sometimes essential to clean up the environment