Class PlansControl

    • Field Detail

      • DEFAULT_BUILD_WAIT_TIMEOUT

        public static final com.atlassian.pageobjects.elements.query.Poller.WaitTimeout DEFAULT_BUILD_WAIT_TIMEOUT
    • Constructor Detail

    • Method Detail

      • doesPlanExistAsRecord

        public boolean doesPlanExistAsRecord​(@NotNull
                                             @NotNull PlanKey planKey)
      • isPlanEnabled

        public boolean isPlanEnabled​(@NotNull
                                     @NotNull PlanKey planKey)
      • addCreatedPlan

        public PlansControl addCreatedPlan​(PlanKey planKey)
        Register plan created outside backdoor, so it would be removed on cleanup
      • deletePlan

        public PlansControl deletePlan​(@NotNull
                                       @NotNull PlanKey planKey)
        Delete plan
        Parameters:
        planKey - key of a Plan
      • deletePlanQuietly

        public PlansControl deletePlanQuietly​(@NotNull
                                              @NotNull PlanKey planKey)
        Delete plan quietly
        Parameters:
        planKey - key of a Plan
      • enablePlan

        public PlansControl enablePlan​(@NotNull
                                       @NotNull PlanKey planKey)
        Enable plan
        Parameters:
        planKey - key of a Plan
      • disablePlan

        public PlansControl disablePlan​(@NotNull
                                        @NotNull PlanKey planKey)
        Disable plan
        Parameters:
        planKey - key of a Plan
      • triggerBackgroundDeletionAndWait

        public void triggerBackgroundDeletionAndWait()
        Trigger background plan deletion and wait up to 30s for its completion.
      • getBranchByNameTimed

        public com.atlassian.pageobjects.elements.query.TimedQuery<RestPlanBranch> getBranchByNameTimed​(PlanKey key,
                                                                                                        String branchName)
                                                                                                 throws Exception
        Get branches with given name for chain as a timed query
        Throws:
        Exception
      • waitUntilBranchIsCreatedAndEnabled

        public RestPlanBranch waitUntilBranchIsCreatedAndEnabled​(PlanKey key,
                                                                 String branchName)
                                                          throws Exception
        Wait unit plan branch with given name is created and enabled for chain
        Throws:
        Exception
      • triggerBuild

        public PlansControl triggerBuild​(PlanKey planKey)
        Trigger build
        Parameters:
        planKey - which will be triggered
      • triggerBuildAndAwaitFailure

        public PlansControl triggerBuildAndAwaitFailure​(PlanKey planKey,
                                                        int expectStatusCode)
      • triggerBuild

        public PlansControl triggerBuild​(PlanKey planKey,
                                         Map<String,​String> params)
        Trigger build
        Parameters:
        planKey - which will be triggered
        params - additional params to be passed to the build
      • rerun

        public void rerun​(@NotNull
                          @NotNull PlanResultKey planResultKey)
        Rebuild completed build.
        Parameters:
        planResultKey - build result to be rerun
      • rerunFailedJobs

        public void rerunFailedJobs​(@NotNull
                                    @NotNull PlanResultKey planResultKey)
      • triggerBuildAndAwaitCompletion

        public PlansControl triggerBuildAndAwaitCompletion​(PlanKey planKey)
        Trigger build and wait for the completion
        Parameters:
        planKey - key of the plan to trigger
      • triggerBuildAndAwaitCompletion

        public PlansControl triggerBuildAndAwaitCompletion​(PlanKey planKey,
                                                           com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
        Trigger build and wait for the completion
        Parameters:
        planKey - key of the plan to trigger
      • getBuildResult

        public Result getBuildResult​(PlanResultKey planResultKey)
        Get build result
      • getBuildResultWithArtifacts

        public Result getBuildResultWithArtifacts​(PlanResultKey planResultKey)
        Get build result
      • triggerBuildAndAwaitSuccess

        public PlansControl triggerBuildAndAwaitSuccess​(@NotNull
                                                        @NotNull PlanKey planKey)
      • waitForSuccessfulBuild

        public PlansControl waitForSuccessfulBuild​(@NotNull
                                                   @NotNull PlanKey planKey,
                                                   int buildNumber)
      • waitForSuccessfulBuild

        public PlansControl waitForSuccessfulBuild​(@NotNull
                                                   @NotNull PlanResultKey planResultKey,
                                                   com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
      • waitForFailedBuild

        public PlansControl waitForFailedBuild​(@NotNull
                                               @NotNull PlanKey planKey,
                                               int buildNumber)
      • waitForFailedBuild

        public PlansControl waitForFailedBuild​(@NotNull
                                               @NotNull PlanResultKey planResultKey,
                                               com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
      • waitForCompletedBuild

        public PlansControl waitForCompletedBuild​(PlanResultKey key)
        Wait for a build to complete
        Parameters:
        key - plan result key
      • waitForCompletedBuild

        public PlansControl waitForCompletedBuild​(PlanResultKey key,
                                                  com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
        Throws:
        AssertionError - if build is not completed
      • waitForCompletedBuild

        public PlansControl waitForCompletedBuild​(PlanKey planKey,
                                                  int buildNumber)
        Waits for a build that is completed (builds stopped are not included)
      • waitUntilPlanIsUpdated

        public void waitUntilPlanIsUpdated​(PlanKey planKey,
                                           int buildNumber)
      • waitUntilPlanIsAffectedInSuccessfulSpecsRun

        public void waitUntilPlanIsAffectedInSuccessfulSpecsRun​(PlanKey planKey,
                                                                int buildNumber)
      • waitUntilPlanIsAffectedInFailedSpecsRun

        public String waitUntilPlanIsAffectedInFailedSpecsRun​(PlanKey planKey,
                                                              int buildNumber)
      • waitForCompletedBuild

        public PlansControl waitForCompletedBuild​(PlanKey planKey,
                                                  int buildNumber,
                                                  com.atlassian.pageobjects.elements.query.Poller.WaitTimeout waitTimeout)
      • waitForStartedBuild

        public PlansControl waitForStartedBuild​(PlanKey planKey,
                                                int buildNumber)
      • waitForStartedBuild

        @NotNull
        public @NotNull PlansControl waitForStartedBuild​(PlanResultKey key,
                                                         com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
      • waitForQueuedBuild

        @NotNull
        public @NotNull PlansControl waitForQueuedBuild​(PlanResultKey key,
                                                        com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
      • waitForQueuedOrStartedBuild

        @NotNull
        public @NotNull PlansControl waitForQueuedOrStartedBuild​(PlanResultKey key,
                                                                 com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
      • waitForFinishedBuild

        public PlansControl waitForFinishedBuild​(PlanKey planKey,
                                                 int buildNumber)
        Wait until build is finished (either completed or stopped)
      • waitForBuildWithResponse

        public io.restassured.path.json.JsonPath waitForBuildWithResponse​(PlanResultKey key,
                                                                          org.hamcrest.Matcher<io.restassured.path.json.JsonPath> matcher,
                                                                          com.atlassian.pageobjects.elements.query.Poller.WaitTimeout timeout)
      • createPlan

        public com.atlassian.bamboo.specs.api.model.plan.PlanProperties createPlan​(com.atlassian.bamboo.specs.api.builders.plan.Plan plan)
                                                                            throws Exception
        Throws:
        Exception
      • createOrUpdatePlan

        public com.atlassian.bamboo.specs.api.model.plan.PlanProperties createOrUpdatePlan​(TestUser user,
                                                                                           com.atlassian.bamboo.specs.api.builders.plan.Plan plan)
                                                                                    throws Exception
        Throws:
        Exception
      • getTriggerNames

        @NotNull
        public @NotNull List<String> getTriggerNames​(@NotNull
                                                     @NotNull PlanKey planKey)
      • getPlanRootArtifactDirectory

        public String getPlanRootArtifactDirectory​(PlanKey planKey)
        Get the plan directory information for the plan
        Parameters:
        planKey -
        Returns:
      • addCustomRequirement

        public PlansControl addCustomRequirement​(@NotNull
                                                 @NotNull PlanKey jobKey,
                                                 @NotNull
                                                 @NotNull String requirementKey)
      • addGetCustomRequirement

        public RestRequirement addGetCustomRequirement​(@NotNull
                                                       @NotNull PlanKey jobKey,
                                                       @NotNull
                                                       @NotNull String requirementKey)
      • getPlanId

        public long getPlanId​(PlanKey key)
      • getPlanLabels

        public List<String> getPlanLabels​(@NotNull
                                          @NotNull PlanKey planKey)
      • setPlanLabels

        public void setPlanLabels​(@NotNull
                                  @NotNull PlanKey planKey,
                                  @NotNull
                                  @NotNull List<String> labels)