Java Code Examples for net.serenitybdd.screenplay.Task#where()

The following examples show how to use net.serenitybdd.screenplay.Task#where() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AddItemToCart.java    From serenity-cucumber-bdd-screenplay with Apache License 2.0 5 votes vote down vote up
public static Task fromSearchResultsPage(){
    return Task.where("Add item to Cart",
            Hover.over(SearchResultsPage.FIRST_PRODUCT_PRICE),
            Check.whether(
                    valueOf(SearchResultsPage.QUICK_VIEW_LINK),isCurrentlyEnabled())
                    .andIfSo( Hover.over(SearchResultsPage.QUICK_VIEW_LINK)),
            Click.on(SearchResultsPage.QUICK_VIEW_LINK),
            Click.on(QuickViewPopup.SELECT_ITEM_COLOR),
            Click.on(QuickViewPopup.ADD_ITEM_TO_CART)
    );
}
 
Example 2
Source File: NavigateMenu.java    From serenity-cucumber-bdd-screenplay with Apache License 2.0 5 votes vote down vote up
public static Task toBlousesItem(){
    return Task.where("Navigate Menu to blouses option",
            Hover.over(GlobalMenu.CLOTHES),
            Check.whether(
                    valueOf(GlobalMenu.CLOTHES),isVisible())
                    .andIfSo( Hover.over(GlobalMenu.CLOTHES)),
            Check.whether(
                    valueOf(GlobalMenu.WOMEN),isVisible())
                    .andIfSo( Hover.over(GlobalMenu.WOMEN))
                    .andIfSo(Click.on(GlobalMenu.WOMEN))

    );

}
 
Example 3
Source File: ProceedToCheckOut.java    From serenity-cucumber-bdd-screenplay with Apache License 2.0 5 votes vote down vote up
public static Task fromCheckoutSummary(){
    return Task.where("Proceed to checkout from cart status popup",
            Scroll.to(CheckoutSummary.ADDRESSES_STEP),
            Click.on(CheckoutSummary.ADDRESSES_STEP),
            Click.on(CheckoutSummary.CONTNUE_TO_SHIPPING),
            //Click.on(CheckoutSummary.SHIPPING_STEP),
            Check.whether(
                    valueOf(CheckoutSummary.SHIPPING_CARRIER),isCurrentlyEnabled())
                    .andIfSo(Click.on(CheckoutSummary.SHIPPING_CARRIER)),
            Click.on(CheckoutSummary.CONTNUE_TO_PAYMENT),
            Check.whether(
                    valueOf(CheckoutSummary.PAY_BY_BANK_WIRE),isCurrentlyVisible())
                    .andIfSo(Click.on(CheckoutSummary.PAY_BY_BANK_WIRE))
    );
}
 
Example 4
Source File: LookForInformation.java    From serenity-cucumber-starter with Apache License 2.0 5 votes vote down vote up
public static Performable about(String searchTerm) {
    return Task.where("{0} searches for '" + searchTerm + "'",
            Enter.theValue(searchTerm)
                    .into(SearchForm.SEARCH_FIELD)
                    .thenHit(Keys.ENTER)
    );
}
 
Example 5
Source File: ProceedToCheckOut.java    From serenity-cucumber-bdd-screenplay with Apache License 2.0 4 votes vote down vote up
public static Task fromQuickViewPopup(){
    return Task.where("Proceed to checkout from cart status popup",
            Scroll.to(QuickViewPopup.PROCEED_TO_CHECKOUT),
            Click.on(QuickViewPopup.PROCEED_TO_CHECKOUT)
    );
}
 
Example 6
Source File: ProceedToCheckOut.java    From serenity-cucumber-bdd-screenplay with Apache License 2.0 4 votes vote down vote up
public static Task fromCartSummaryPopup(){
    return Task.where("Proceed to checkout from cart status popup",
            Scroll.to(ShoppingCartSummary.PROCEED_TO_CHECKOUT),
            Click.on(ShoppingCartSummary.PROCEED_TO_CHECKOUT)
    );
}
 
Example 7
Source File: GoToLogin.java    From serenity-cucumber-bdd-screenplay with Apache License 2.0 4 votes vote down vote up
public static Task called () {
   return Task.where("Go To Login screen",
           Click.on(getLoginScreen()));
}
 
Example 8
Source File: NavigateTo.java    From serenity-cucumber-starter with Apache License 2.0 4 votes vote down vote up
public static Performable theWikipediaHomePage() {
    return Task.where("{0} opens the Wikipedia home page",
            Open.browserOn().the(WikipediaHomePage.class));
}