net.serenitybdd.screenplay.actions.Enter Java Examples

The following examples show how to use net.serenitybdd.screenplay.actions.Enter. 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: SearchAnItem.java    From serenity-cucumber-bdd-screenplay with Apache License 2.0 5 votes vote down vote up
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            Enter.theValue(keyword)
                    .into(SEARCH_BAR)
                    .thenHit(Keys.ENTER)
    );
}
 
Example #4
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 #5
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 #6
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 #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: 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 #9
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 #10
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 #11
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 #12
Source File: SetBuildDescription.java    From jenkins-build-monitor-plugin with MIT License 5 votes vote down vote up
@Step("{0} indicates that the build description should be set to '#description', based on regex '#regex')")
@Override
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(
            AddABuildStep.called("Set build description"),
            Enter.theValue(regex).into(Setting.defining("Regular expression")),
            Enter.theValue(description).into(Setting.defining("Description"))
    );
}
 
Example #13
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 #14
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 #15
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 #16
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 #17
Source File: SearchForKeyword.java    From tutorials with MIT License 4 votes vote down vote up
@Step("{0} searches for '#keyword'")
public <T extends Actor> void performAs(T actor) {
    actor.attemptsTo(Enter.theValue(keyword).into(GoogleSearchPage.SEARCH_INPUT_BOX).thenHit(Keys.RETURN));
}