- Introduction
- Services as Code (SaC)
- CXTM Basics
- CXTM Projects
- CXTM Test Cases
- CXTM Test Automation
- CXTM Batches
- Setup GitLab CI/CD
- Configure L3Out
- Test Results
- CXTM Reporting
- Continue your Education
Add CXTM API Env Variable to GitLab
In this section of the lab, you will generate your own CXTM API token. This token will then be used as a secret environment variable
in GitLab that you will access in the pipeline. This is a best practice as to not expose your API token.
Step 1 - In CXTM, navigate to Your User Profile
-
In the top-right, click on your user icon
-
Click Manage Profile
Step 2 - Generate API Token Key
On the right-side of your screen:
-
Click REQUEST API KEY
Step 3 - Copy CXTM API Token
After generating your CXTM API token:
-
With your mouse, click and highlight the generated API key
- Copy the API key you have selected and highlighted with the keyboard shortcut Ctrl+c or right-click, then click Copy
Step 4 - Navigate to CI/CD Settings in Your GitLab Project
In preparation to store your CXTM API token as an environment variable in GitLab, navigate to CI/CD settings in your GitLab project:
- Click Settings
- Click CI/CD
Step 5 - Navigate to CI/CD Variables
In the center of your screen:
-
Locate Variables
-
Click Expand
Step 6 - Launch Edit Variable Pop-UP
Most of the variables you need to execute the pipeline have already been created for you.
-
Scroll down until you can see the TM2_API_KEY variable
-
Click the pencil icon associated with this varilable to open the Edit variable popup
Step 7 - Fillout Edit variable Pop-Up
In the Edit variable pop-up:
- Paste the CXTM API Key you generated above into the Value field
- Click Save changes
Continue to the next section to edit the .gitlab-ci.yml file to run these CXTM test cases in the pipeline