public final void can(Consequence... consequences) { should(consequences); }
public final void can(Consequence... consequences) { should(consequences); }
@Override public <A extends Actor> void performAs(A actor) { actor.should(eventually(seeThat(WebElementQuestion.the(target), expectedState)).withNoReporting()); }
@Override public <T extends Actor> void performAs(T actor) { actor.should(eventually(seeThat(the(target), expectedState)) .withNoReporting() .waitingForNoLongerThan(amount).milliseconds()); } };
public final void should(String groupStepName, Consequence... consequences) { try { String groupTitle = injectActorInto(groupStepName); StepEventBus.getEventBus().stepStarted(ExecutedStepDescription.withTitle(groupTitle)); should(consequences); } catch (Throwable error) { throw error; } finally { StepEventBus.getEventBus().stepFinished(); } }
@Override public <T extends Actor> void performAs(T actor) { actor.should(eventually(seeThat(the(target), expectedState)) .withNoReporting() .waitingForNoLongerThan(amount).seconds()); } };
@Then("I should pay \\$(\\d+)") public void shouldPay(int totalPrice) { john.should(seeThat(TheTotalPrice.ofTheGizmos(billedPrice), equalTo(totalPrice))); }
@Test public void should_be_able_to_acquire_token() { james.attemptsTo( clearCache, clickDone, acquireToken, clickDone, readCache); int expectedCacheCount = james.asksFor(ExpectedCacheItemCount.displayed()); then(james).should(seeThat(TokenCacheItemCount.displayed(), is(expectedCacheCount))); }
@Test public void should_be_able_to_acquire_token() { james.attemptsTo( acquireToken, mdmEnroll, clickDone, readCache); int expectedCacheCount = james.asksFor(ExpectedCacheItemCount.displayed()); then(james).should(seeThat(TokenCacheItemCount.displayed(), is(expectedCacheCount))); }
@Test public void should_be_able_to_acquire_token_prompt_always() { james.attemptsTo( clearCache, clickDone, acquireToken.withPrompt("Always"), clickDone, readCache); int expectedCacheCount = james.asksFor(ExpectedCacheItemCount.displayed()); then(james).should(seeThat(TokenCacheItemCount.displayed(), is(expectedCacheCount))); }
@Test public void should_be_able_to_acquire_token_prompt_null() { james.attemptsTo( clearCache, clickDone, acquireToken.withPrompt(null), clickDone, readCache); int expectedCacheCount = james.asksFor(ExpectedCacheItemCount.displayed()); then(james).should(seeThat(TokenCacheItemCount.displayed(), is(expectedCacheCount))); }
@Test public void should_be_able_to_acquire_token_prompt_auto() { james.attemptsTo( clearCache, clickDone, acquireToken.withPrompt("Auto"), clickDone, readCache); int expectedCacheCount = james.asksFor(ExpectedCacheItemCount.displayed()); then(james).should(seeThat(TokenCacheItemCount.displayed(), is(expectedCacheCount))); }
@Test public void should_be_able_to_acquire_token_with_login_hint() { james.attemptsTo( clearCache, clickDone, acquireToken.withUserIdentifier(james.getCredential().userName), clickDone, readCache); int expectedCacheCount = james.asksFor(ExpectedCacheItemCount.displayed()); then(james).should(seeThat(TokenCacheItemCount.displayed(), is(expectedCacheCount))); }
@Test public void should_be_able_to_acquire_token_with_broker() { givenThat(james).wasAbleTo( acquireToken.withBroker(), WaitUntil.the(Results.RESULT_FIELD, isVisible()).forNoMoreThan(10).seconds() ); then(james).should(seeThat(AccessTokenFromAuthenticationResult.displayed(), notNullValue())); james.attemptsTo(workplaceLeave); }
@Test public void should_be_able_to_acquire_token_with_broker_with_prompt_always() { givenThat(james).wasAbleTo( acquireToken .withBroker() .withPrompt("Always"), WaitUntil.the(Results.RESULT_FIELD, isVisible()).forNoMoreThan(10).seconds() ); then(james).should(seeThat(AccessTokenFromAuthenticationResult.displayed(), notNullValue())); james.attemptsTo(workplaceLeave); }
@Test public void should_be_able_to_acquire_token_with_broker_with_prompt_null() { givenThat(james).wasAbleTo( acquireToken .withBroker() .withPrompt(null), WaitUntil.the(Results.RESULT_FIELD, isVisible()).forNoMoreThan(10).seconds() ); then(james).should(seeThat(AccessTokenFromAuthenticationResult.displayed(), notNullValue())); james.attemptsTo(workplaceLeave); }
@Test public void should_be_able_to_acquire_token_with_broker_with_prompt_auto() { givenThat(james).wasAbleTo( acquireToken .withBroker() .withPrompt("Auto"), WaitUntil.the(Results.RESULT_FIELD, isVisible()).forNoMoreThan(10).seconds() ); then(james).should(seeThat(AccessTokenFromAuthenticationResult.displayed(), notNullValue())); james.attemptsTo(workplaceLeave); }
@Test public void should_be_able_to_acquire_token_and_then_acquire_silent_with_force_refresh() { givenThat(james).wasAbleTo( acquireToken ); String accessToken1 = james.asksFor(AccessTokenFromAuthenticationResult.displayed()); james.attemptsTo(clickDone); when(james).attemptsTo( acquireTokenSilent.withUserIdentifier(james.getCredential().userName).withForceRefresh() ); then(james).should(seeThat(AccessTokenFromAuthenticationResult.displayed(), not(accessToken1))); }
@Test public void should_be_able_to_acquire_token_with_broker_with_login_hint() { givenThat(james).wasAbleTo( acquireToken .withBroker() .withUserIdentifier(james.getCredential().userName), WaitUntil.the(Results.RESULT_FIELD, isVisible()).forNoMoreThan(10).seconds() ); then(james).should(seeThat(AccessTokenFromAuthenticationResult.displayed(), notNullValue())); james.attemptsTo(workplaceLeave); }
@Test public void should_be_able_to_acquire_token_and_then_acquire_silent_with_force_refresh() { givenThat(james).wasAbleTo( acquireToken.withBroker() ); String accessToken1 = james.asksFor(AccessTokenFromAuthenticationResult.displayed()); AuthenticationResult result = james.asksFor(AuthenticationResultFromResultInfo.displayed()); james.attemptsTo(clickDone); james.getSilentTokenRequest().setAuthority("https://login.microsoftonline.com/" + result.tenantId); when(james).attemptsTo( acquireTokenSilent.withUserIdentifier(james.getCredential().userName).withForceRefresh() ); then(james).should(seeThat(AccessTokenFromAuthenticationResult.displayed(), not(accessToken1))); }