After you complete the prerequisite tasks to run tests in a GitHub Actions Workflow,
you can configure the test run in a GitHub Actions Workflow.
Procedure
-
Perform the following steps to open the Git repository that you use or created,
which has the GitHub Actions option enabled:
-
Open the Git repository on your GitHub Enterprise server.
-
Create a folder with the name as .github/workflows
in the root folder of the repository.
-
Create an empty YAML file in the .github/workflows
folder.
The YAML file is used to define the GitHub Action in the Actions
Workflow.
-
Perform the following steps to define the YAML file for the GitHub
Action:
-
Open the GitHub Marketplace
(https://github.com/marketplace?type=) in a web browser.
-
Search for the HCL OneTest API GitHub
Action.
-
Open the GitHub Action.
-
Read through the information provided.
-
Copy the contents of the YAML file that is provided in the example by
clicking the copy icon .
-
Open the YAML file that is in the
.github/workflows folder of your repository,
and then paste the copied contents.
-
Enter the valid details as values for the required attributes in the
YAML file by following the action in the following table:
Attribute |
Action |
Required attributes |
projectDir |
Specify the path to the location on your
computer where the HCL OneTest™ API project resides. |
projectName |
Specify the name of the HCL OneTest™ API project. |
environment |
Specify the name of the environment
configured in your HCL OneTest™ API project. |
tests |
Specify the name of the test in your HCL OneTest™ API project. |
Optional attributes |
parameterFile |
Specify the path to a parameter file that
contains the details of the project and
environment, and the run arguments for one or more
tests. |
junitDir |
Specify the path to a folder on your computer
in which the JUnit Report is to be saved for the
tests. |
-
Save the YAML file.
-
Perform the following steps to set up a Runner for the GitHub Action in
GitHub:
-
Click the Settings icon .
-
Click .
-
Follow the on-screen instructions to set up a self-hosted runner on
your computer.
After the runner is installed on your computer, you must verify that
the runner is ready to take up jobs in the GitHub Actions Workflow
and is in the Active state. The runner is listed
in the Runners pane in the Git repository.
-
Perform the following steps to start the GitHub Action in the Workflow:
-
Click the Actions option in the Git
repository.
The GitHub Action that you configured in the YAML file for HCL OneTest™ API is
displayed as an Action under
Workflows.
-
Click the HCL OneTest API Action,
and then click Run workflow.
Results
You have configured and run a resource that is in your project
on HCL OneTest™ API in a GitHub Action
Workflow.
What to do next
You can perform any of the following tasks on the Git repository page by clicking the
job that was completed:
- View the status of the test run by expanding the Execute
test section.
- View the links to the test results and reports listed in the
Execute test section.