WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

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.

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

}
}

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