Skip to content

Instantly share code, notes, and snippets.

@ArisAgnew
Last active June 1, 2020 17:02
Show Gist options
  • Select an option

  • Save ArisAgnew/c942e8b3011b567f508a3859567b7c4b to your computer and use it in GitHub Desktop.

Select an option

Save ArisAgnew/c942e8b3011b567f508a3859567b7c4b to your computer and use it in GitHub Desktop.
preparePage(final Method invokedMethod, final ITestContext testContext)
@BeforeMethod
public void preparePage(final Method invokedMethod, final ITestContext testContext) {
inBrowser().navigate(refresh());
testContext.getSuite().getAllMethods()
.stream()
.filter(m -> m.getMethodName().equals(invokedMethod.getName()))
.flatMap(tngm -> Stream.of(tngm.getGroups()))
.filter(s -> s.equals("Управление доступами"))
.findFirst()
.ifPresentOrElse(__ -> {
inBrowser().navigate(toUrl("/tags-manager"))
.click(on(tab("Управление доступами")))
.edit(valueOfThe(textField("Поиск по пользователю или по тегу"),
of(getCurrentUser().getLogin())));
},
() -> {
inBrowser().navigate(toUrl("/tags-manager"));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment