/** * A tense-neutral synonyme for has() for use with given() clauses */ public final void wasAbleTo(Performable... todos) { attemptsTo(todos); }
/** * A tense-neutral synonym for addFact() for use with given() clauses */ public final void wasAbleTo(Performable... todos) { attemptsTo(todos); }
@Override @Step("!#title") public <T extends Actor> void performAs(T actor) { actor.attemptsTo(steps.toArray(new Performable[]{})); }
@Step("{0} adds the todo items called #todos") public <T extends Actor> void performAs(T actor) { todos.forEach( todo -> actor.attemptsTo(AddATodoItem.called(todo)) ); }
@Step("{0} adds the todo items called: #todos") public <T extends Actor> void performAs(T actor) { todos.forEach( todo -> actor.attemptsTo(AddATodoItem.called(todo)) ); }
public void canSee(WebElementFacade targetElement) { if (!targetElement.isCurrentlyVisible()) { try { actor.attemptsTo(Scroll.to(targetElement)); } catch (WebDriverException failedToMoveToElement) { logger.warn("Failed to move to target", failedToMoveToElement); } } } }
@Override @Step("Completes item called #itemName") public <T extends Actor> void performAs(T theActor) { theActor.attemptsTo(Click.on(CompleteAll.BUTTON)); } }
@Step("{0} clears all the completed items") public <T extends Actor> void performAs(T actor) { actor.attemptsTo(Click.on(ClearCompleted.BUTTON)); } }
@Override public <T extends Actor> void performAs(T actor) { actor.attemptsTo( Open.browserOn().the(ApplicationHomePage.class) ); } }
@Override public <T extends Actor> void performAs(T actor) { actor.attemptsTo( Click.on(Main.READ_CACHE) ); }
@Step("{0} opens the application on the home page") public <T extends Actor> void performAs(T actor) { actor.attemptsTo(Open.browserOn().the(applicationHomePage)); } }
@Step("{0} deletes the item '#itemName'") public <T extends Actor> void performAs(T theActor) { Target deleteButton = TodoListItem.DELETE_ITEM_BUTTON.of(itemName); theActor.attemptsTo(JSClick.on(deleteButton)); }
@Override @Step("{0} completes the item called #itemName") public <T extends Actor> void performAs(T theActor) { Target completeButton = TodoListItem.COMPLETE_ITEM_BUTTON.of(itemName); theActor.attemptsTo(Click.on(completeButton)); } }
@Step("{0} starts with #todoListDescription") public <T extends Actor> void performAs(T actor) { actor.attemptsTo( GoTo.theRightPlace(), Refresh.theBrowserSession(), Check.whether(items.isEmpty()).otherwise(AddTodoItems.called(items))); }
@Step("{0} filters items by #filter") public <T extends Actor> void performAs(T theActor) { theActor.attemptsTo( Click.on(TodoList.FILTER.of(filter.name()).called("filter by "+ filter)) ); }
@When("I order the gizmos") public void orderGizmo() { john.attemptsTo(OrderGizmos.times(quantity)); billedPrice = cost * quantity; }
@Step("{0} filters items by #filter") public <T extends Actor> void performAs(T theActor) { Target filterSelection = FilterSelection.FILTER.of(filter.name()).called("filter by "+ filter); theActor.attemptsTo(Click.on(filterSelection)); } }
@Step("{0} adds a todo item called #thingToDo") public <T extends Actor> void performAs(T actor) { actor.attemptsTo( Enter.theValue(thingToDo).into(NewTodoForm.NEW_TODO_FIELD), Hit.the(RETURN).keyIn(NewTodoForm.NEW_TODO_FIELD) ); } // end::performAs[]
@Override public <T extends Actor> void performAs(T actor) { actor.attemptsTo( WaitUntil.the(Results.DONE_BUTTON, isVisible()).forNoMoreThan(10).seconds(), Click.on(Results.DONE_BUTTON) ); } }
@Override public <T extends Actor> void performAs(T actor) { User user = (User) actor; SignInUser signInUser = SignInUser.GetSignInUserByFederationProvider(user.getFederationProvider()); actor.attemptsTo( openAuthenticatorApp, Click.on(Main.MENU_BUTTON), Click.on(Main.EDIT_ACCOUNTS_MENU_BUTTON), Click.on(EditAccounts.LIST_ROW_DELETE), Click.on(RemoveAccountDialog.REMOVE_BUTTON) ); }