Waiter for new window appeared after an action added.#153
Open
Lao-Ax wants to merge 5 commits intoWileyLabs:masterfrom
Open
Waiter for new window appeared after an action added.#153Lao-Ax wants to merge 5 commits intoWileyLabs:masterfrom
Lao-Ax wants to merge 5 commits intoWileyLabs:masterfrom
Conversation
Added unit test for such function. Added message() call into existing test to be sure about such function.
vefimofff
requested changes
Mar 20, 2018
| * @param element - an element to click to new window switch. | ||
| */ | ||
| @Override | ||
| public void switchToLastAfter(TeasyElement element) { |
Contributor
There was a problem hiding this comment.
just a note about name being unclear. "switch to last after element" - says nothing about the click inside.
| void switchToLast(); | ||
|
|
||
| void switchToLastAfter(Actions action); | ||
| void switchToLastAfter(TeasyElement element); |
Contributor
There was a problem hiding this comment.
i would prefer keeping Window api straightforward and clean. Window represents a browser window and keeping it independent from anything like after click, after action is a plus from my point of view.
However, I like the idea of adding such layer of actions+conditions. Lets discuss in skype a potential place where we can have such layer of actions.
| } | ||
| if (result == null) { | ||
| throw new StopTestExecutionException(getErrorMessage()); | ||
| } else return result; |
| } | ||
| } | ||
|
|
||
| public T performAndGet() { |
Contributor
There was a problem hiding this comment.
whenever we need to add "and" in a name - it might be a sign that something might be wrong with our design
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.
Into Window class added method with a waiter to be sure before switching, that new window is really appeared or closed.
Imagine, a new window should be appeared by clicking link or button, and tester must switch to that window to continue a test. Sometimes, a new window appears after switchToLast() call.
I'm not sure, that it would be used only with element.click(), so I added also Actions.class as a parameter.