Skip to content

StepDefinitions.addSeriesToCollection(): simplify a step by opening a series from the beginning #644

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

Closed
php-coder opened this issue Sep 25, 2017 · 1 comment

Comments

@php-coder
Copy link
Owner

In the StepDefinitions.addSeriesToCollection() method, we open a main page, click on a link with a series, then we do something useful on a page with a series:

public void addSeriesToCollection() {
driver.get(Url.SITE);
driver.findElement(By.linkText("1 item(s)")).click();
if (driver.findElements(By.id("series-danger")).size() != 0) {
driver.findElement(By.id("series-danger")).click();
driver.get(Url.SITE);
driver.findElement(By.linkText("1 item(s)")).click();
}
driver.findElement(By.id("series-success")).click();

While it works, it makes test more fragile because test will fail if we modify a series to, let's say, "2 item(s)"). But the most important things here is performance -- opening the pages is a slow process and we shouldn't do it if we don't really need it.

Let's just open a page with a series (/series/1) -- it's simpler and faster.

Tech debt for f72c87d (#46)

@php-coder
Copy link
Owner Author

Won't fix as we're going get rid of Cucumber JVM (#1019).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants