GitLab Issues Integration
Enable the GitLab Issues integration to report bugs straight from your tests: create a new issue in a GitLab project or comment on an existing one, with test metadata, the test's last screenshot and a link back to the test included automatically.
It works with GitLab.com and with self-managed GitLab instances. A Report a bug button appears on the test detail pages of automated tests, Maestro flows, Espresso and XCUITest runs.
Looking to run TestingBot tests from GitLab CI/CD pipelines instead? See GitLab CI/CD.
Create an access token
TestingBot connects to GitLab with an access token, which works the same way on GitLab.com and on self-managed GitLab. You can use a:
- Personal access token: issues are created as you, in every project you can report issues in.
- Group access token: issues are created by the group's bot user, in the group's projects.
- Project access token: issues are created by the project's bot user, in that one project.
The token needs the api scope, and its user needs at least the Reporter role on the projects you want to file issues in. Choose an expiry date that suits your policy; when the token expires, reconnect with a new one.
Connect GitLab
Go to Members > Integrations and click GitLab Issues. Enter:
-
GitLab URL:
https://gitlab.com, or thehttps://address of your self-managed GitLab (the address you open GitLab on, for examplehttps://gitlab.example.com). - Access token: the token you created above.
Click Connect GitLab. TestingBot checks the token with GitLab and shows which GitLab user it belongs to. The token is stored encrypted.
The connection is shared by your whole TestingBot team. Only account owners and admins can connect or disconnect it; every team member can report bugs with it.
A self-managed GitLab must be reachable from the internet over https, because TestingBot talks to its API from our servers. Instances that are only reachable inside a private network, or only over plain http, cannot be connected.
Report a bug
Open a test and click Report a bug in the header, then choose GitLab. Once issues are linked to the test, the button shows how many.
In the dialog, pick a Group to narrow the list and choose the Project. The list shows the projects the token can report issues in (Reporter role or higher, issues enabled). Fill in the Title and Description; the description is pre-filled with the test metadata.
You can optionally choose an Assignee and one or more Labels from the project. Click Create issue: TestingBot creates the issue, shows a link to it and links it to the test, so teammates opening the same test can see which issues were already reported.
Update an existing issue
Already have an issue for this bug? Switch to the Update existing issue tab, pick one of the project's open issues and write a comment. The comment is pre-filled with the test metadata and is added to the issue in GitLab. The issue is linked to the test as well.
What gets included
The pre-filled description (or comment) contains a metadata block with:
- The test name, linked to a shareable test page with the video, screenshots and logs
- The test result (passed or failed)
- The browser or device and operating system the test ran on
- The error message, when the test failed with one
When the test has screenshots, the dialog offers Attach the test's last screenshot (on by default). TestingBot uploads that screenshot to the GitLab project and shows it inline at the top of the issue or comment. If the upload fails, the issue is still created, without the screenshot.
You can edit or remove any of this before submitting. Whoever opens the issue in GitLab can follow the test link to watch the video and read the logs, without needing a TestingBot account.
Troubleshooting
- "GitLab rejected the access token": the token expired or was revoked. Create a new one and connect again.
-
"The access token is not allowed to do this": the token is missing the
apiscope, or its user does not have at least the Reporter role on the project. -
"This GitLab URL is not reachable from TestingBot": the address is not
https, or it resolves to a private network address. - "GitLab redirected the request": enter the base address of your GitLab, not the address of a group or project page.
- No projects found: the token's user is not a member of a project with issues enabled, with at least the Reporter role.
Disconnect
To disconnect GitLab, go to the GitLab integration page and click Disconnect, then type Disconnect to confirm. TestingBot deletes the stored token; revoke the token in GitLab as well if you no longer need it.
Issues that were already linked to your tests stay linked and are not removed.