-
Notifications
You must be signed in to change notification settings - Fork 31
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
Waiter for new window appeared after an action added. #153
base: master
Are you sure you want to change the base?
Conversation
Added unit test for such function. Added message() call into existing test to be sure about such function.
* @param element - an element to click to new window switch. | ||
*/ | ||
@Override | ||
public void switchToLastAfter(TeasyElement element) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a note about name being unclear. "switch to last after element" - says nothing about the click inside.
@@ -11,6 +12,9 @@ | |||
|
|||
void switchToLast(); | |||
|
|||
void switchToLastAfter(Actions action); | |||
void switchToLastAfter(TeasyElement element); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add brackets
@@ -79,6 +93,22 @@ public void perform() { | |||
} | |||
} | |||
|
|||
public T performAndGet() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whenever we need to add "and" in a name - it might be a sign that something might be wrong with our design
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.