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

Waiter for new window appeared after an action added. #153

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Lao-Ax
Copy link

@Lao-Ax Lao-Ax commented Mar 17, 2018

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.

* @param element - an element to click to new window switch.
*/
@Override
public void switchToLastAfter(TeasyElement element) {
Copy link
Contributor

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);
Copy link
Contributor

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;
Copy link
Contributor

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() {
Copy link
Contributor

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

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.

3 participants