net.thucydides.core.annotations.Step Java Examples

The following examples show how to use net.thucydides.core.annotations.Step. 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: Start.java    From base_project_for_web_automation_projects with MIT License 6 votes vote down vote up
@Override
@Step("{0} performs an authentication")
public <T extends Actor> void performAs(T theActor) {
    theActor.attemptsTo(Open.browserOn(gitHubLoginPage));

    theActor.should(seeThat(the(USERNAME_OR_EMAIL_ADDRESS), isVisible())
            .orComplainWith(StartError.class,
                    MESSAGE_LOGIN_PAGE_NOT_LOADED));

    theActor.attemptsTo(
            Enter.theValue(user.getUsername()).into(USERNAME_OR_EMAIL_ADDRESS),
            EnterAndHide.theValue(user.getPassword()).as("a password").into(PASSWORD),
            Click.on(SIGN_IN));

    theActor.should(seeThat(the(DASHBOARD), isVisible())
            .orComplainWith(StartError.class,
                    MESSAGE_FAILED_AUTHENTICATION));
}
 
Example #2
Source File: HaveAFailingClaimableProjectCreated.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} creates the '#projectName' project and schedules a build that fails, but can be claimed")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            HaveAProjectCreated.called(projectName).andConfiguredTo(
                    ExecuteAShellScript.that(Finishes_With_Error),
                    BrokenBuildClaiming.allow()
            ),
            ScheduleABuild.of(projectName)
    );
}
 
Example #3
Source File: DisplayNestedProjects.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} indicates that the view should include projects nested in subfolders")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
        Choose.the(ViewConfigurationPage.Recurse_In_Subfolders)
    );
}
 
Example #4
Source File: HaveASuccessfulProjectCreated.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} creates the '#projectName' project and schedules a build that passes")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            HaveAProjectCreated.called(projectName).andConfiguredTo(
                    ExecuteAShellScript.that(Finishes_With_Success)
            ),
            ScheduleABuild.of(projectName)
    );
}
 
Example #5
Source File: CreateAnExternalProject.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Override
@Step("{0} creates a 'Freestyle Project' called '#name'")
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            CreateAProject.called(name)
                    .ofType(NewJobPage.External_Project)
    );
}
 
Example #6
Source File: EnterAndHideIntoTarget.java    From base_project_for_web_automation_projects with MIT License 5 votes vote down vote up
@Step("{0} enters #mask into #target")
public <T extends Actor> void performAs(T theUser) {
    target.resolveFor(theUser).type(theText);
    if (getFollowedByKeys().length > 0) {
        target.resolveFor(theUser).sendKeys(getFollowedByKeys());
    }
}
 
Example #7
Source File: LineInTheBuildLog.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} defines a pattern indicating the failure cause")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            Click.on(FailureCauseManagementPage.Add_Indication),
            WaitUntil.the(FailureCauseManagementPage.Build_Log_Indication_Link, WebElementStateMatchers.isVisible()),
            Click.on(FailureCauseManagementPage.Build_Log_Indication_Link),
            Enter.theValue(pattern).into(FailureCauseManagementPage.Pattern_Field)
    );
}
 
Example #8
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 #9
Source File: SelectDropDownButton.java    From base_project_for_web_automation_projects with MIT License 5 votes vote down vote up
@Override
@Step("{0} clicks on #button is filtered by #valueFilter and click on the resulting item")
public <T extends Actor> void performAs(T actor) {
    button.resolveFor(actor).click();
    filter.resolveFor(actor).sendKeys(valueFilter);
    Target selectedItem = Target.the("selected item").locatedBy(cssSelectorForElementSelected);
    await().forever().pollInterval(1, SECONDS).until(isNotNull(selectedItem.resolveFor(actor)));
    selectedItem.resolveFor(actor).click();
}
 
Example #10
Source File: DefineABuildLogIndicatedFailureCause.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} defines what constitutes a problem with '#name'")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            DefineAFailureCause.called(name).describedAs(getOrElse(description, name)).indicatedBy(
                    LineInTheBuildLog.matching(regex)
            )
    );
}
 
Example #11
Source File: AddATodoItem.java    From serenity-documentation with Apache License 2.0 5 votes vote down vote up
@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)
    );
}
 
Example #12
Source File: CreateAFolder.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Override
@Step("{0} creates a '#name' folder")
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            Click.on(SidePanel.New_Item_Link),
            Choose.the(NewJobPage.Folder),
            Enter.theValue(name).into(NewJobPage.Item_Name_Field).thenHit(ENTER),
            Click.on(Save)
    );
}
 
Example #13
Source File: BuyerSteps.java    From serenity-documentation with Apache License 2.0 5 votes vote down vote up
@Step
public void should_see_total_including_shipping_for(ListingItem selectedItem) {
    OrderCostSummary orderCostSummary
            = cartPage.getOrderCostSummaryFor(selectedItem).get();

    double itemTotal = orderCostSummary.getItemTotal();
    double shipping = orderCostSummary.getShipping();
    double totalCost = orderCostSummary.getTotalCost();

    assertThat(itemTotal).isEqualTo(selectedItem.getPrice());
    assertThat(shipping).isGreaterThan(0.0);
    assertThat(totalCost).isCloseTo(itemTotal + shipping, Offset.offset(0.001));
}
 
Example #14
Source File: CreateABuildMonitorView.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Override
@Step("{0} creates a 'Build Monitor View' called '#buildMonitorName'")
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            Click.on(JenkinsHomePage.New_View_link),
            Enter.theValue(buildMonitorName).into(NewViewPage.View_Name),
            Click.on(NewViewPage.Build_Monitor_View),
            Click.on(Buttons.OK),
            configureBuildMonitor,
            SaveTheChangesToBuildMonitor.andExitTheConfigurationScreen()
    );
}
 
Example #15
Source File: CreateAProject.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Override
@Step("{0} creates a 'Freestyle Project' called '#name'")
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            Click.on(SidePanel.New_Item_Link),
            Enter.theValue(name).into(NewJobPage.Item_Name_Field),
            Choose.the(projectType),
            Scroll.to(Buttons.OK),
            Click.on(Buttons.OK),
            configureTheProject,
            Click.on(Buttons.Save)
    );
}
 
Example #16
Source File: DisplayAllProjects.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} uses a regular expression to display all projects")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
        Choose.the(ViewConfigurationPage.Use_Regular_Expression),
        Enter.theValue(".*").into(ViewConfigurationPage.Regular_Expression)
    );
}
 
Example #17
Source File: AddProjects.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} decides to adds some projects to an empty Build Monitor")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            Click.on(BuildMonitorDashboard.Add_Some_Projects_link)
    );
}
 
Example #18
Source File: AddAGroovyPostbuildScript.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} configures the Groovy PostBuild Step to execute a script that '#scriptOutcome'")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
    	AddAPostBuildAction.called("Groovy Postbuild"),
        Enter.theValue(scriptOutcome.code()).into(GroovyPostBuildStep.Editor)
    );
}
 
Example #19
Source File: BrokenBuildClaiming.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} allows for a broken build to be claimed")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            AddAPostBuildAction.called("Allow broken build claiming")
    );
}
 
Example #20
Source File: LogIn.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} logs in")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            Click.on(JenkinsHomePage.Log_In_Link),
            Enter.theValue(actor.getName()).into(LogInForm.Username_Field),
            Enter.theValue(passwordOf(actor)).into(LogInForm.Password_Field),
            Click.on(LogInForm.Log_In_Buttton)
    );
}
 
Example #21
Source File: HaveAPipelineProjectCreated.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} creates the '#projectName' pipeline")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            CreateAPipelineProject.called(projectName).andConfigureItTo(requiredConfiguration),
            Click.on(Back_to_Dashboard)
    );
}
 
Example #22
Source File: AddAPostBuildAction.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} adds the '#postBuildAction' post-build action")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            Scroll.to(ProjectConfigurationPage.Add_Post_Build_Action),
            Click.on(ProjectConfigurationPage.Add_Post_Build_Action),
            Click.on(Link.called(postBuildActionName))
    );
}
 
Example #23
Source File: AddABuildStep.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} adds the '#buildStepName' build step")
@Override
public <T extends Actor> void performAs(final T actor) {
    actor.attemptsTo(
            Scroll.to(ProjectConfigurationPage.Add_Build_Step),
            Click.on(ProjectConfigurationPage.Add_Build_Step),
            Click.on(Link.called(buildStepName))
    );
}
 
Example #24
Source File: ExecuteAShellScript.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} configures the Shell Step to execute a script that '#scriptOutcome'")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
        AddABuildStep.called("Execute shell"),
        EnterCode.asFollows(scriptOutcome.code()).intoTheCodeMirror(ShellBuildStep.Editor)
    );
}
 
Example #25
Source File: HaveAFailingProjectCreated.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} creates the '#projectName' project and schedules a build that fails")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            HaveAProjectCreated.called(projectName).andConfiguredTo(
                    ExecuteAShellScript.that(Finishes_With_Error)
            ),
            ScheduleABuild.of(projectName)
    );
}
 
Example #26
Source File: SetPipelineDefinition.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} configures the Pipeline Defintion to execute '#pipelineDefintion'")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            EnterCode.asFollows(pipelineDefintion).intoThePipelineEditor(PipelineDefinition.Editor)
    );
}
 
Example #27
Source File: AdderSteps.java    From tutorials with MIT License 4 votes vote down vote up
@Step("summed up")
public void thenSummedUp() {
}
 
Example #28
Source File: TravellerSteps.java    From serenity-documentation with Apache License 2.0 4 votes vote down vote up
@Step("Given a traveller has a frequent flyer account with {0} points")             // <2>
public void a_traveller_has_a_frequent_flyer_account_with_balance(int initialBalance) {
    frequentFlyer = FrequentFlyer.withInitialBalanceOf(initialBalance);             // <3>
}
 
Example #29
Source File: FlightSearchSteps.java    From serenity-documentation with Apache License 2.0 4 votes vote down vote up
@Step
public void view_flight_details_for_flight(int flightNumber) {
    flightSearchResultsPage.selectFlightNumber(flightNumber);
}
 
Example #30
Source File: EndUserAtSearchPageSteps.java    From htmlelements-examples with Apache License 2.0 4 votes vote down vote up
@Step
@SuppressWarnings("unchecked")
public void searchItemsListShould(Matcher matcher) {
    assertThat(onSearchPage().getSearchResults().getSearchItems(), matcher);
}