net.serenitybdd.screenplay.Task Java Examples

The following examples show how to use net.serenitybdd.screenplay.Task. 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: Start.java    From serenity-cucumber-bdd-screenplay with Apache License 2.0 5 votes vote down vote up
@Step("{0} starts and performs the step **#title**")
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            Open.browserOn().the(applicationHomePage),
            Refresh.theBrowserSession()
           ,Check.whether(steps != null).andIfSo(Task.where(title, steps))
    );
}
 
Example #5
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 #6
Source File: HaveAFolderCreated.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public Task andInsideIt(Task... createProjects) {
    configurationTasks.addAll(createProjects);

    return this;
}
 
Example #7
Source File: SearchForKeyword.java    From tutorials with MIT License 4 votes vote down vote up
public static Task of(String keyword) {
    return Instrumented.instanceOf(SearchForKeyword.class).withProperties(keyword);
}
 
Example #8
Source File: HaveANestedProjectCreated.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public static Task called(String name) {
    return instrumented(HaveANestedProjectCreated.class, name);
}
 
Example #9
Source File: CreateAFreestyleProject.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public CreateAFreestyleProject andConfigureItTo(Task configurationTask) {
    this.configureTheProject.add(configurationTask);

    return this;
}
 
Example #10
Source File: GoBack.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public static Task to(String target) {
    return instrumented(GoBack.class, target);
}
 
Example #11
Source File: Enable.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public static Task executingConcurrentBuilds() {
    return new EnableExecutingConcurrentBuilds();
}
 
Example #12
Source File: AddAPostBuildAction.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public static Task called(String buildStepName) {
    return new AddAPostBuildAction(buildStepName);
}
 
Example #13
Source File: SetPipelineDefinition.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public static Task asFollows(String pipelineDefintion) {
    return instrumented(SetPipelineDefinition.class, pipelineDefintion);
}
 
Example #14
Source File: AddAGroovyPostbuildScript.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public static Task that(GroovyScript expectedOutcome) {
    return instrumented(AddAGroovyPostbuildScript.class, expectedOutcome);
}
 
Example #15
Source File: AddABuildStep.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public static Task called(String buildStepName) {
    return new AddABuildStep(buildStepName);
}
 
Example #16
Source File: ExecuteAShellScript.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public static Task that(ShellScript expectedOutcome) {
    return instrumented(ExecuteAShellScript.class, expectedOutcome);
}
 
Example #17
Source File: CreateAPipelineProject.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public CreateAPipelineProject andConfigureItTo(Task configurationTask) {
    this.configureTheProject.add(configurationTask);

    return this;
}
 
Example #18
Source File: ScheduleABuild.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public static Task of(String project) {
    return instrumented(ScheduleABuild.class, project);
}
 
Example #19
Source File: CreateAProject.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public CreateAProject andConfigureItTo(Task configurationTask) {
    this.configureTheProject.add(configurationTask);

    return this;
}
 
Example #20
Source File: HaveASuccessfulProjectCreated.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public static Task called(String name) {
    return instrumented(HaveASuccessfulProjectCreated.class, name);
}
 
Example #21
Source File: HaveAFailingProjectCreated.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public static Task called(String name) {
    return instrumented(HaveAFailingProjectCreated.class, name);
}
 
Example #22
Source File: HaveAProjectCreated.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public Task andConfiguredTo(Task... configurationTasks) {
    this.requiredConfiguration.addAll(configurationTasks);

    return this;
}
 
Example #23
Source File: HaveAPipelineProjectCreated.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public Task andConfiguredTo(Task... configurationTasks) {
    this.requiredConfiguration.addAll(configurationTasks);

    return this;
}
 
Example #24
Source File: ViewNewsAbout.java    From bdd-trader with Apache License 2.0 4 votes vote down vote up
public static Performable theShare(String stockid) {
    return Task.where("{0} gets news about #share",
            Get.resource("/api/stock/{stockid}/news").with( request -> request.pathParam("stockid", stockid))
    ).with("share").of(stockid);
}
 
Example #25
Source File: UseFailureCauseManagement.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public UseFailureCauseManagement(List<Task> defineFailureCauses) {
    this.defineFailureCauses.addAll(defineFailureCauses);
}
 
Example #26
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 #27
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 #28
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 #29
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));
}
 
Example #30
Source File: HaveAFailingClaimableProjectCreated.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
public static Task called(String name) {
    return instrumented(HaveAFailingClaimableProjectCreated.class, name);
}