import { WebmateAPISession } from "../webmate-api-session"; import { ProjectId, TestRunId, TestId, TestExecutionId } from "../types"; import { List, Map } from "immutable"; import { Observable } from "rxjs"; import { Test } from "./test"; import { TestResult } from "./test-result"; import { CreateTestExecutionResponse } from "./create-test-execution-response"; import { WMValue } from "../jobs/wm-value"; import { TestExecutionSpec } from "./spec/test-execution-spec"; import { TestExecutionSummary } from "./test-execution-summary"; import { TestRunInfo } from "./test-run-info"; import { TestTemplate } from "./test-template"; import { TestSession } from "./test-session"; import { TestRunEvaluationStatus } from "./test-run-evaluation-status"; import { TestRun } from "./test-run"; import { TestExecutionSpecBuilder } from "./test-execution-spec-builder"; export declare class SingleTestRunCreationSpec { private readonly parameterAssignments; constructor(parameterAssignments: Map); asJson(): any; } /** * Facade of the webmate TestMgmt subsystem, which provides access to information about Tests, TestRuns and * TestResults. */ export declare class TestMgmtClient { private session; private apiClient; /** * Creates a TestMgmtClient based on a WebmateApiSession. * * @param session The WebmateApiSession used by the TestMgmtClient */ constructor(session: WebmateAPISession); getTestTemplates(projectId: ProjectId): Observable; /** * Retrieve Test with id. * * @param testId Id of Test. * @return Test */ getTest(testId: TestId): Observable; /** * Retrieve list of TestResults for given test and test run. * * @param testRunId Id of TestRun. * @return List of TestResults */ getTestResults(testRunId: TestRunId): Observable>; /** * Retrieve information about TestRun. * * @param testRunId Id of TestRun. * @return TestRun information */ getTestRun(testRunId: TestRunId): Observable; /** * Set the name for a given test run. * * @param testRunId Id of TestRun. * @param name New TestRun name. */ setTestRunName(testRunId: TestRunId, name: string): Observable; /** * Create and start a test execution. * This method is blocking: * it internally calls a method similar to {@link waitForTestRunCompletion} * to wait until the associated test run is running. * If the test run is not running after the timeout, the returned observable will go into an error state. * * @param spec The specification metadata for the test execution. * @param projectId The id of the project the test execution belongs to. * @return The response data, including the test execution id and the id of the associated test run. */ startExecution(spec: TestExecutionSpec, projectId: ProjectId): Observable; /** * Create and start a test execution. * This method is blocking: * it internally calls a method similar to {@link waitForTestRunCompletion} * to wait until the associated test run is running. * If the test run is not running after the timeout, the returned observable will go into an error state. * * @param specBuilder A builder providing the required information for that test type, e.g. {@code Story}. * @return The test run associated with the test execution. */ startExecutionWithBuilder(specBuilder: TestExecutionSpecBuilder): Observable; getTestExecutionSummary(testExecutionId: TestExecutionId): Observable; /** * Create new TestSession in current project with given name. */ createTestSession(name: string): Observable; /** * Finish a running test run. * This method is blocking: * it internally calls the {@link waitForTestRunCompletion} method * to wait until the test run is finished. * If the test run does not finish before the timeout, the returned observable will go into an error state. * * @param id The id of the test run to finish. * @param status The status to finish the test run with. * @param msg A short message explaining the result of the test run. * @param detail Detailed information, e.g. a stack trace. */ finishTestRun(id: TestRunId, status: TestRunEvaluationStatus, msg?: string, detail?: string): Observable; /** * Generate an export for the given project using the specified exporter and config */ testlabExport(projectId: ProjectId, exporter: string, config: Map, targetFilePath: string): Observable; /** * Block until the test run goes into a finished state (completed or failed) or timeout occurs. * The default timeout is 10 minutes. * If the test run does not finish before the timeout, the returned observable will go into an error state. * * @param id The id of the test run to wait for. * @param maxWaitingTimeMillis How long to wait before timeout. * @return The test run info of the finished test run. */ waitForTestRunCompletion(id: TestRunId, maxWaitingTimeMillis?: number): Observable; }