net.serenitybdd.screenplay.actions.Click Java Examples

The following examples show how to use net.serenitybdd.screenplay.actions.Click. 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: CreateRepository.java    From base_project_for_web_automation_projects with MIT License 6 votes vote down vote up
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            Click.on(NEW_REPOSITORY),
            Enter.theValue(repository.name()).into(REPOSITORY_NAME)
    );

    actor.should(seeThat(the(MESSAGE_REPOSITORY_ALREADY_EXISTS), isNotVisible())
            .orComplainWith(RepositoryAlreadyExistsError.class,
                    withMessageBy(repository.name())));

    actor.attemptsTo(
            Check.whether(isNotEmptyOrNull(repository.description()))
                    .andIfSo(Enter.theValue(repository.description()).into(REPOSITORY_DESCRIPTION)),
            Check.whether(repository.isInitializeWithREADME())
                    .andIfSo(Click.on(INITIALIZE_THIS_REPOSITORY_WITH_README)),
            Scroll.to(CREATE_REPOSITORY),
            Check.whether(repository.gitIgnore() != NONE)
                    .andIfSo(SelectDropDownButton.addGitIgnoreFilteringBy(repository.gitIgnore())),
            Check.whether(repository.license() != License.NONE)
                    .andIfSo(SelectDropDownButton.addLicenseFilteringBy(repository.license())),
            Click.on(CREATE_REPOSITORY)
    );
}
 
Example #2
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 #3
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 #4
Source File: ShowBadges.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} decides to display the badges on the dashboard")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
        WaitUntil.the(BuildMonitorDashboard.Show_Badges, isVisible()),
        Click.on(BuildMonitorDashboard.Show_Badges)
    );
}
 
Example #5
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 #6
Source File: HaveAFolderCreated.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} creates and configures the '#name' folder")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            CreateAFolder.called(name),
            configurationTasks,
            Click.on(FolderDetailsPage.Up_Link)
    );
}
 
Example #7
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 #8
Source File: HaveANestedProjectCreated.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} creates the '#projectName' project")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            CreateAFreestyleProject.called(projectName),
            Click.on(FolderDetailsPage.Up_Link)
    );
}
 
Example #9
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 #10
Source File: EnableExecutingConcurrentBuilds.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} enables executing concurrent builds")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            Click.on(ProjectConfigurationPage.Execute_Concurrent_Builds)
    );
}
 
Example #11
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 #12
Source File: ModifyControlPanelOptions.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Override
@Step("{0} modifies the Build Monitor View control panel options")
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            Click.on(BuildMonitorDashboard.Control_Panel),
            configureTheView,
            Click.on(BuildMonitorDashboard.Control_Panel)
    );
}
 
Example #13
Source File: ScheduleABuild.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Override
@Step("{0} schedules a build of the '#project' project  ")
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            Click.on(JenkinsHomePage.Schedule_A_Build.of(project))
            // todo: should wait for the build to finish
    );
}
 
Example #14
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 #15
Source File: EnterCode.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Override
@Step("{0} enters '#code' into the code editor field")
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
      Click.on(target),
      Evaluate.javascript(
            setCodeMirrorValueTo(code),
            target.resolveFor(actor)
    ));
}
 
Example #16
Source File: HaveAnExternalProjectCreated.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} creates the '#projectName' external project")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            CreateAnExternalProject.called(projectName),
            Click.on(Back_to_Dashboard)
    );
}
 
Example #17
Source File: HaveAProjectCreated.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} creates the '#projectName' project")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            CreateAFreestyleProject.called(projectName).andConfigureItTo(requiredConfiguration),
            Click.on(SidePanel.Back_to_Dashboard)
    );
}
 
Example #18
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 #19
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 #20
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 #21
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 #22
Source File: LogIn.java    From serenity-cucumber-bdd-screenplay with Apache License 2.0 5 votes vote down vote up
@Step
public <T extends Actor> void performAs(T user) {
    user.attemptsTo(
            Enter.theValue(authenticated(user).username())
                .into(FILL_USERNAME),
            Enter.theValue(authenticated(user).password())
                .into(FILL_PASSWORD),
            Click.on(SIGN_IN)
    );
}
 
Example #23
Source File: Claim.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} claims the last broken build of '#project' saying: '#reason'")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
        Click.on(Link.called(project)),
        Click.on(ProjectDetailsPage.Last_Failed_Build_Link),
        Click.on(ClaimableBuildDetailsPage.Claim_It_Link),
        Enter.theValue(reason).into(ClaimableBuildDetailsPage.Reason_Field),
        Click.on(ClaimableBuildDetailsPage.Claim_Button)
    );
}
 
Example #24
Source File: DefineAFailureCause.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            Click.on(FailureCauseManagementPage.Create_New_Link),
            Enter.theValue(name).into(FailureCauseManagementPage.Name),
            Enter.theValue(description).into(FailureCauseManagementPage.Description),
            configureFailureCauseIndicators,
            Click.on(FailureCauseManagementPage.Save)
    );
}
 
Example #25
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 #26
Source File: UseFailureCauseManagement.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} uses the 'Failure Cause Management'")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            Click.on(JenkinsHomePageWithBFA.Failure_Cause_Management_Link),
            defineFailureCauses,
            Click.on(Breadcrumbs.Jenkins_Link)
    );
}
 
Example #27
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 #28
Source File: GoBack.java    From jenkins-build-monitor-plugin with MIT License 4 votes vote down vote up
@Step("{0} navigates back to '#target'")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(Click.on(Breadcrumbs.linkTo(target)));
}
 
Example #29
Source File: FilterItems.java    From serenity-documentation with Apache License 2.0 4 votes vote down vote up
@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));
}
 
Example #30
Source File: CompleteAllItems.java    From serenity-documentation with Apache License 2.0 4 votes vote down vote up
@Override
@Step("Completes item called #itemName")
public <T extends Actor> void performAs(T theActor) {
    theActor.attemptsTo(Click.on(CompleteAll.BUTTON));
}