/// <summary>
 /// This will create a test set with source type API.This endpoint it is
 /// supposed to be used by API integration.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: TestSets or TestSets.Write.
 ///
 /// Required permissions: TestSets.Create.
 ///
 /// Responses:
 /// 201 Created returns test set Id
 /// 403 If the caller doesn't have permissions to create a test set
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// </param>
 /// <param name='xUIPATHOrganizationUnitId'>
 /// Folder/OrganizationUnit Id
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <long?> CreateTestSetForReleaseVersionAsync(this ITestAutomation operations, BuildTestSetRequestMessage body = default(BuildTestSetRequestMessage), long?xUIPATHOrganizationUnitId = default(long?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateTestSetForReleaseVersionWithHttpMessagesAsync(body, xUIPATHOrganizationUnitId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Start a test set execution.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: TestSetExecutions or
 /// TestSetExecutions.Write.
 ///
 /// Required permissions: TestSetExecutions.Create.
 ///
 /// Responses:
 /// 200 OK returns test set execution Id
 /// 403 If the caller doesn't have permissions to execute a test set
 /// 404 If the test set was not found
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='testSetId'>
 /// The Id of the test set
 /// </param>
 /// <param name='triggerType'>
 /// Specifies how was the execution triggered. Possible values include:
 /// 'Manual', 'Scheduled', 'ExternalTool'
 /// </param>
 /// <param name='xUIPATHOrganizationUnitId'>
 /// Folder/OrganizationUnit Id
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <long?> StartTestSetExecutionAsync(this ITestAutomation operations, long?testSetId = default(long?), ExecutionTriggerType?triggerType = default(ExecutionTriggerType?), long?xUIPATHOrganizationUnitId = default(long?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.StartTestSetExecutionWithHttpMessagesAsync(testSetId, triggerType, xUIPATHOrganizationUnitId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Start a test set execution with additional options.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: TestSetExecutions or
 /// TestSetExecutions.Write.
 ///
 /// Required permissions: TestSetExecutions.Create.
 ///
 /// Responses:
 /// 200 OK returns test set execution Id
 /// 403 If the caller doesn't have permissions to execute a test set
 /// 404 If the test set was not found
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// Provides options to set the BatchExecutionKey and TriggerType and override
 /// the input parameters for specific test cases
 /// </param>
 /// <param name='testSetId'>
 /// The Id of the test set
 /// </param>
 /// <param name='xUIPATHOrganizationUnitId'>
 /// Folder/OrganizationUnit Id
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <long?> StartTestSetExecutionWithOptionsAsync(this ITestAutomation operations, TestSetExecutionOptionsDto body = default(TestSetExecutionOptionsDto), long?testSetId = default(long?), long?xUIPATHOrganizationUnitId = default(long?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.StartTestSetExecutionWithOptionsWithHttpMessagesAsync(body, testSetId, xUIPATHOrganizationUnitId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
        /// <summary>
        /// Get the screenshot for the specified test case assertion.
        /// </summary>
        /// <remarks>
        /// Client Credentials Flow required permissions: TestSetExecutions or
        /// TestSetExecutions.Write.
        ///
        /// Required permissions: TestSetExecutions.View.
        ///
        /// Responses:
        /// 200 OK
        /// 404 If the test case assertion is not found or the screenshot storage
        /// location is not found
        /// </remarks>
        /// <param name='operations'>
        /// The operations group for this extension method.
        /// </param>
        /// <param name='testCaseAssertionId'>
        /// Id of the test case assertion
        /// </param>
        /// <param name='xUIPATHOrganizationUnitId'>
        /// Folder/OrganizationUnit Id
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        public static async Task <Stream> GetAssertionScreenshot1Async(this ITestAutomation operations, long?testCaseAssertionId = default(long?), long?xUIPATHOrganizationUnitId = default(long?), CancellationToken cancellationToken = default(CancellationToken))
        {
            var _result = await operations.GetAssertionScreenshot1WithHttpMessagesAsync(testCaseAssertionId, xUIPATHOrganizationUnitId, null, cancellationToken).ConfigureAwait(false);

            _result.Request.Dispose();
            return(_result.Body);
        }
Example #5
0
        private void OnAutomatedTestSelected(ITestAutomation testAutomation)
        {
            var localEvent = AutomatedTestSelected;

            if (localEvent != null)
            {
                localEvent(this, new AutomatedTestSelectedEventArgs(TestCase, testAutomation));
            }
        }
Example #6
0
        /// <summary>
        /// Associates a test case with an automated test.
        /// </summary>
        public void AssociateWithAutomation(ITestCase testCase, ITestAutomation automation)
        {
            // Create the associated automation.
            var implementation = testCase.Project.CreateTmiTestImplementation(
                automation.Name, automation.TestType, automation.Storage, automation.Identifier);

            // Save the test. If you are doing this for lots of test, you can consider
            // bulk saving too (outside of this method) for performance reason.
            testCase.WorkItem.Open();
            testCase.Implementation = implementation;
            testCase.Save();
        }
        /// <summary>
        /// Associates a test case with an automated test.
        /// </summary>
        public void AssociateWithAutomation(ITestCase testCase, ITestAutomation automation)
        {
            // Create the associated automation.
            var implementation = testCase.Project.CreateTmiTestImplementation(
                automation.Name, automation.TestType, automation.Storage, automation.Identifier);

            // Save the test. If you are doing this for lots of test, you can consider
            // bulk saving too (outside of this method) for performance reason.
            testCase.WorkItem.Open();
            testCase.Implementation = implementation;
            testCase.Save();
        }
        /// <summary>
        /// Associates a test case with an automated test.
        /// </summary>
        public void AssociateWithAutomation(ITestCase testCase, ITestAutomation automation)
        {
            // Create the associated automation.
            var implementation = testCase.Project.CreateTmiTestImplementation(
                automation.Name, automation.TestType, automation.Storage, automation.Identifier);

            // Save the test. If you are doing this for lots of test, you can consider
            // bulk saving too (outside of this method) for performance reason.
            testCase.WorkItem.Open();
            testCase.Implementation = implementation;

            var invalidFields = testCase.WorkItem.Validate();

            if (invalidFields.Count > 0)
            {
                throw new WorkItemValidationException(invalidFields.Cast <Field>());
            }

            testCase.Save();
        }
 /// <summary>
 /// Cancels the specified test case execution.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: TestSetExecutions or
 /// TestSetExecutions.Write.
 ///
 /// Required permissions: TestSetExecutions.Edit.
 ///
 /// Responses:
 /// 202 Accepted
 /// 403 If the caller doesn't have permissions to cancel a test set execution
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='testCaseExecutionId'>
 /// Id for the test case execution to be canceled
 /// </param>
 /// <param name='xUIPATHOrganizationUnitId'>
 /// Folder/OrganizationUnit Id
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task CancelTestCaseExecutionAsync(this ITestAutomation operations, long?testCaseExecutionId = default(long?), long?xUIPATHOrganizationUnitId = default(long?), CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.CancelTestCaseExecutionWithHttpMessagesAsync(testCaseExecutionId, xUIPATHOrganizationUnitId, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Example #10
0
 /// <summary>
 /// Client Credentials Flow required permissions: Execution or Execution.Read.
 ///
 /// Requires authentication.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='packageIdentifier'>
 /// </param>
 /// <param name='version'>
 /// </param>
 public static IList <TestReleaseVersionDto> GetReleasesForPackageVersion(this ITestAutomation operations, string packageIdentifier, string version)
 {
     return(operations.GetReleasesForPackageVersionAsync(packageIdentifier, version).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Start a test set execution with additional options.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: TestSetExecutions or
 /// TestSetExecutions.Write.
 ///
 /// Required permissions: TestSetExecutions.Create.
 ///
 /// Responses:
 /// 200 OK returns test set execution Id
 /// 403 If the caller doesn't have permissions to execute a test set
 /// 404 If the test set was not found
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// Provides options to set the BatchExecutionKey and TriggerType and override
 /// the input parameters for specific test cases
 /// </param>
 /// <param name='testSetId'>
 /// The Id of the test set
 /// </param>
 /// <param name='xUIPATHOrganizationUnitId'>
 /// Folder/OrganizationUnit Id
 /// </param>
 public static long?StartTestSetExecutionWithOptions(this ITestAutomation operations, TestSetExecutionOptionsDto body = default(TestSetExecutionOptionsDto), long?testSetId = default(long?), long?xUIPATHOrganizationUnitId = default(long?))
 {
     return(operations.StartTestSetExecutionWithOptionsAsync(body, testSetId, xUIPATHOrganizationUnitId).GetAwaiter().GetResult());
 }
Example #12
0
 /// <summary>
 /// Client Credentials Flow required permissions: Execution or Execution.Read.
 ///
 /// Requires authentication.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='packageIdentifier'>
 /// </param>
 /// <param name='version'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <TestReleaseVersionDto> > GetReleasesForPackageVersionAsync(this ITestAutomation operations, string packageIdentifier, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.GetReleasesForPackageVersionWithHttpMessagesAsync(packageIdentifier, version, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Start a test set execution.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: TestSetExecutions or
 /// TestSetExecutions.Write.
 ///
 /// Required permissions: TestSetExecutions.Create.
 ///
 /// Responses:
 /// 200 OK returns test set execution Id
 /// 403 If the caller doesn't have permissions to execute a test set
 /// 404 If the test set was not found
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='testSetId'>
 /// The Id of the test set
 /// </param>
 /// <param name='triggerType'>
 /// Specifies how was the execution triggered. Possible values include:
 /// 'Manual', 'Scheduled', 'ExternalTool'
 /// </param>
 /// <param name='xUIPATHOrganizationUnitId'>
 /// Folder/OrganizationUnit Id
 /// </param>
 public static long?StartTestSetExecution(this ITestAutomation operations, long?testSetId = default(long?), ExecutionTriggerType?triggerType = default(ExecutionTriggerType?), long?xUIPATHOrganizationUnitId = default(long?))
 {
     return(operations.StartTestSetExecutionAsync(testSetId, triggerType, xUIPATHOrganizationUnitId).GetAwaiter().GetResult());
 }
Example #14
0
 /// <see cref="ITestCaseViewModel.UpdateAutomation"/>
 public void UpdateAutomation(ITestAutomation testAutomation)
 {
     _automationService.AssociateWithAutomation(_testCase, testAutomation);
 }
Example #15
0
 /// <summary>
 /// Initializes a new <see cref="TestAutomationViewModel"/>.
 /// </summary>
 /// <param name="testAutomation">An automated test</param>
 public TestAutomationViewModel(ITestAutomation testAutomation)
 {
     TestAutomation = testAutomation;
 }
 /// <summary>
 /// Get the package identifier and the latest version for the specified test
 /// case.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: Execution or Execution.Read.
 ///
 /// Requires authentication.
 ///
 /// Responses:
 /// 200 OK
 /// 403 If the caller doesn't have permissions to retrieve packages
 /// 404 If there is no test case with the specified UniqueId
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='testCaseUniqueId'>
 /// </param>
 /// <param name='packageIdentifier'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <TestPackageInfoDto> GetPackageInfoByTestCaseUniqueIdAsync(this ITestAutomation operations, System.Guid?testCaseUniqueId = default(System.Guid?), string packageIdentifier = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetPackageInfoByTestCaseUniqueIdWithHttpMessagesAsync(testCaseUniqueId, packageIdentifier, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Get the package identifier and the latest version for the specified test
 /// case.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: Execution or Execution.Read.
 ///
 /// Requires authentication.
 ///
 /// Responses:
 /// 200 OK
 /// 403 If the caller doesn't have permissions to retrieve packages
 /// 404 If there is no test case with the specified UniqueId
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='testCaseUniqueId'>
 /// </param>
 /// <param name='packageIdentifier'>
 /// </param>
 public static TestPackageInfoDto GetPackageInfoByTestCaseUniqueId(this ITestAutomation operations, System.Guid?testCaseUniqueId = default(System.Guid?), string packageIdentifier = default(string))
 {
     return(operations.GetPackageInfoByTestCaseUniqueIdAsync(testCaseUniqueId, packageIdentifier).GetAwaiter().GetResult());
 }
Example #18
0
 /// <summary>
 /// Client Credentials Flow required permissions: Execution or Execution.Read.
 ///
 /// Requires authentication.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='testCaseUniqueId'>
 /// </param>
 public static TestPackageInfoDto GetPackageInfoByTestCaseUniqueId(this ITestAutomation operations, System.Guid testCaseUniqueId)
 {
     return(operations.GetPackageInfoByTestCaseUniqueIdAsync(testCaseUniqueId).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Get the screenshot for the specified test case assertion.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: TestSetExecutions or
 /// TestSetExecutions.Write.
 ///
 /// Required permissions: TestSetExecutions.View.
 ///
 /// Responses:
 /// 200 OK
 /// 404 If the test case assertion is not found or the screenshot storage
 /// location is not found
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='testCaseAssertionId'>
 /// Id of the test case assertion
 /// </param>
 /// <param name='xUIPATHOrganizationUnitId'>
 /// Folder/OrganizationUnit Id
 /// </param>
 public static Stream GetAssertionScreenshot1(this ITestAutomation operations, long?testCaseAssertionId = default(long?), long?xUIPATHOrganizationUnitId = default(long?))
 {
     return(operations.GetAssertionScreenshot1Async(testCaseAssertionId, xUIPATHOrganizationUnitId).GetAwaiter().GetResult());
 }
 private void OnAutomatedTestSelected(ITestAutomation testAutomation)
 {
     var localEvent = AutomatedTestSelected;
     if (localEvent != null)
         localEvent(this, new AutomatedTestSelectedEventArgs(TestCase, testAutomation));
 }
 /// <summary>
 /// This will create a test set with source type API.This endpoint it is
 /// supposed to be used by API integration.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: TestSets or TestSets.Write.
 ///
 /// Required permissions: TestSets.Create.
 ///
 /// Responses:
 /// 201 Created returns test set Id
 /// 403 If the caller doesn't have permissions to create a test set
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='body'>
 /// </param>
 /// <param name='xUIPATHOrganizationUnitId'>
 /// Folder/OrganizationUnit Id
 /// </param>
 public static long?CreateTestSetForReleaseVersion(this ITestAutomation operations, BuildTestSetRequestMessage body = default(BuildTestSetRequestMessage), long?xUIPATHOrganizationUnitId = default(long?))
 {
     return(operations.CreateTestSetForReleaseVersionAsync(body, xUIPATHOrganizationUnitId).GetAwaiter().GetResult());
 }
 /// <see cref="ITestCaseViewModel.UpdateAutomation"/>
 public void UpdateAutomation(ITestAutomation testAutomation)
 {
     _automationService.AssociateWithAutomation(_testCase, testAutomation);
 }
 /// <summary>
 /// Cancels the specified test set execution.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: TestSetExecutions or
 /// TestSetExecutions.Write.
 ///
 /// Required permissions: TestSetExecutions.Edit.
 ///
 /// Responses:
 /// 202 Accepted
 /// 403 If the caller doesn't have permissions to cancel a test set execution
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='testSetExecutionId'>
 /// Id for the test set execution to be canceled
 /// </param>
 /// <param name='xUIPATHOrganizationUnitId'>
 /// Folder/OrganizationUnit Id
 /// </param>
 public static void CancelTestSetExecution(this ITestAutomation operations, long?testSetExecutionId = default(long?), long?xUIPATHOrganizationUnitId = default(long?))
 {
     operations.CancelTestSetExecutionAsync(testSetExecutionId, xUIPATHOrganizationUnitId).GetAwaiter().GetResult();
 }
Example #24
0
 /// <summary>
 /// Initializes a new <see cref="AutomatedTestSelectedEventArgs"/>.
 /// </summary>
 /// <param name="testCase">The test case associated with the automated test</param>
 /// <param name="testAutomation">The selected automated test</param>
 public AutomatedTestSelectedEventArgs(ITestCaseViewModel testCase, ITestAutomation testAutomation)
 {
     TestCase       = testCase;
     TestAutomation = testAutomation;
 }
 /// <summary>
 /// This will list all the processes filtered by package identifier and version
 /// cross-folder when no current folder is sent by header.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: Execution or Execution.Read.
 ///
 /// Required permissions: Processes.View.
 ///
 /// Responses:
 /// 200 OK
 /// 404 If there is no release for the specified package identifier
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='packageIdentifier'>
 /// </param>
 /// <param name='version'>
 /// </param>
 /// <param name='mandatoryPermissions'>
 /// If in a cross-folder scenario, these represent the additional permissions
 /// required in the folders the data is retrieved from; all permissions in this
 /// set must be met
 /// </param>
 /// <param name='atLeastOnePermissions'>
 /// If in a cross-folder scenario, these represent the additional permissions
 /// required in the folders the data is retrieved from; at least one permission
 /// in this set must be met
 /// </param>
 /// <param name='xUIPATHOrganizationUnitId'>
 /// Folder/OrganizationUnit Id
 /// </param>
 public static IList <TestReleaseVersionDto> GetReleasesForPackageVersion(this ITestAutomation operations, string packageIdentifier = default(string), string version = default(string), IList <string> mandatoryPermissions = default(IList <string>), IList <string> atLeastOnePermissions = default(IList <string>), long?xUIPATHOrganizationUnitId = default(long?))
 {
     return(operations.GetReleasesForPackageVersionAsync(packageIdentifier, version, mandatoryPermissions, atLeastOnePermissions, xUIPATHOrganizationUnitId).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Initializes a new <see cref="AutomatedTestSelectedEventArgs"/>.
 /// </summary>
 /// <param name="testCase">The test case associated with the automated test</param>
 /// <param name="testAutomation">The selected automated test</param>
 public AutomatedTestSelectedEventArgs(ITestCaseViewModel testCase, ITestAutomation testAutomation)
 {
     TestCase = testCase;
     TestAutomation = testAutomation;
 }
 /// <summary>
 /// This will list all the processes filtered by package identifier and version
 /// cross-folder when no current folder is sent by header.
 /// </summary>
 /// <remarks>
 /// Client Credentials Flow required permissions: Execution or Execution.Read.
 ///
 /// Required permissions: Processes.View.
 ///
 /// Responses:
 /// 200 OK
 /// 404 If there is no release for the specified package identifier
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='packageIdentifier'>
 /// </param>
 /// <param name='version'>
 /// </param>
 /// <param name='mandatoryPermissions'>
 /// If in a cross-folder scenario, these represent the additional permissions
 /// required in the folders the data is retrieved from; all permissions in this
 /// set must be met
 /// </param>
 /// <param name='atLeastOnePermissions'>
 /// If in a cross-folder scenario, these represent the additional permissions
 /// required in the folders the data is retrieved from; at least one permission
 /// in this set must be met
 /// </param>
 /// <param name='xUIPATHOrganizationUnitId'>
 /// Folder/OrganizationUnit Id
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <TestReleaseVersionDto> > GetReleasesForPackageVersionAsync(this ITestAutomation operations, string packageIdentifier = default(string), string version = default(string), IList <string> mandatoryPermissions = default(IList <string>), IList <string> atLeastOnePermissions = default(IList <string>), long?xUIPATHOrganizationUnitId = default(long?), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetReleasesForPackageVersionWithHttpMessagesAsync(packageIdentifier, version, mandatoryPermissions, atLeastOnePermissions, xUIPATHOrganizationUnitId, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }