-
Notifications
You must be signed in to change notification settings - Fork 2
PR for task168 #473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
liudmylastepanets
wants to merge
3
commits into
docs
Choose a base branch
from
task168
base: docs
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
PR for task168 #473
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| title: Overview | ||
| --- | ||
|
|
||
| import DirectoryLinks from '/src/components/DirectoryLinks.astro'; | ||
|
|
||
| <DirectoryLinks directory="advanced/ai-powered-features" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,167 @@ | ||
| --- | ||
| title: API Access | ||
| description: Learn how to use Testomat.io API tokens to securely connect and interact with your test management projects. This guide covers access token types, authentication requests, suite and test retrieval, and operations with test runs for efficient integration and automation. | ||
| type: article | ||
| url: https://docs.testomat.io/advanced/api-access | ||
| head: | ||
| - tag: meta | ||
| attrs: | ||
| name: keywords | ||
| content: Testomat.io, API access, API token, test management, test automation, test documentation, test suites, test runs, REST API, automation, CI/CD integration, autotest failures, explain failures, test coverage, debugging, test design, Jira integration, traceability, software testing, generate test cases, analyze logs | ||
| --- | ||
|
|
||
| # API Access Guide | ||
|
|
||
| Testomat.io provides a robust API that allows users to integrate, automate, and extend their test management workflows. Testomat.io uses [JSON API](https://jsonapi.org) as standard for Request and Response data. | ||
| Access to the API is secured using **Access Tokens**, which ensure that only authorized systems and users can interact with your projects. | ||
|
|
||
| --- | ||
|
|
||
| ## Access Tokens Overview | ||
|
|
||
| There are two main types of access tokens in Testomat.io: | ||
|
|
||
| ### **1. General Tokens** | ||
| - Provide full API-driven access to **all projects** within your Testomat.io account. | ||
| - Ideal for administrative or automation tasks that span multiple projects. | ||
|
|
||
| ### **2. Project Tokens** | ||
| - Limit API access to a **specific project** only. | ||
| - Recommended for importing and reporting. | ||
|
|
||
| --- | ||
|
|
||
|  | ||
|
|
||
| --- | ||
|
|
||
| ## API Authentication with either General Token or Email + Password | ||
|
|
||
| Before interacting with the Testomat.io API, you must authenticate and obtain a JWT token, which is required for all subsequent requests. | ||
|
|
||
| You can authenticate in one of two ways: | ||
|
|
||
| ### Option 1 **Log In Using Your API Token** | ||
|
|
||
| **Request Example:** | ||
|
|
||
| ```bash | ||
| POST /api/login | ||
|
|
||
| { | ||
| "api_token": "testomat_EXAMPLETOKENt7dp5VFPR_h8b8SO12EXAMPLETOKEN" | ||
| }; | ||
| ``` | ||
|
|
||
| ### Option 2 **Log In Using Your Email + Password** | ||
|
|
||
| **Request Example:** | ||
|
|
||
| ```bash | ||
| POST /api/login | ||
|
|
||
| { | ||
| "email": "test.testomat@gmail.com", | ||
| "password": "Test123!" | ||
| }; | ||
| ``` | ||
|
|
||
| ### **Step 2: Receive JWT Token** | ||
|
|
||
| After sending your login request, you’ll receive a **JSON Web Token (JWT)** in the response. | ||
| This token is used to authenticate all subsequent API calls. | ||
|
|
||
| **Response Example:** | ||
| ```json | ||
| { | ||
| "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9" | ||
| } | ||
| ``` | ||
| ### **Step 3: Use the JWT for Authorization** | ||
|
|
||
| Include the received JWT in the Authorization header for all subsequent API requests. | ||
|
|
||
|
|
||
| ## Listing Suites and Tests | ||
|
|
||
| Because test suites are nested, you’ll need to fetch them in multiple requests to reconstruct the full hierarchy. | ||
|
|
||
| ### **Step 1 List Root Suites** | ||
|
|
||
| ```bash | ||
| GET /api/<project_name>/suites | ||
| ``` | ||
|
|
||
| ### **Step 2: Fetch Child Suites** | ||
|
|
||
| Iterate over each returned suite ID and retrieve its details: | ||
|
|
||
| ```bash | ||
| GET /api/<project_name>/suites/:suite_id | ||
| ``` | ||
|
|
||
| Repeat this process recursively for each child suite to build the complete suite + test tree. | ||
|
|
||
| Each suite response includes: | ||
|
|
||
| - Suite metadata (name, ID, description, etc.) | ||
|
|
||
| - Child suite IDs | ||
|
|
||
| - Tests contained within that suite | ||
|
|
||
| ## Working with Runs Results | ||
|
|
||
| You can use the API to list, create, and inspect runs within a project. | ||
|
|
||
| **Important:** In the testomat.io API, the path parameters `/run/...` and `/testrun/...` refer to **two different resources**: | ||
|
|
||
| - **`/run/...`** endpoints return information about a **Run** — the execution session itself — including the list of tests that belong to it. | ||
| - **`/testrun/...`** endpoints return **Test Run** records — the *results* of individual tests executed within a run. | ||
|
|
||
|
|
||
| ### **List Runs** | ||
|
|
||
| Retrieve all test runs associated with a project. | ||
|
|
||
| ```bash | ||
| GET /api/{project_id}/runs | ||
| ``` | ||
|
|
||
| ### **Get Run Details** | ||
|
|
||
| Retrieve details of a specific run by ID. | ||
|
|
||
| ```bash | ||
| GET /api/{project_id}/run/{id} | ||
| ``` | ||
|
|
||
|
|
||
| To get all test results from a specifc run: | ||
|
|
||
| ```bash | ||
| GET /api/{project_id}/testruns?run_id={run_id} | ||
| ``` | ||
|
|
||
|
|
||
| ## API Reference | ||
|
|
||
| For a complete list of available endpoints, request parameters, and schemas, see the official documentation: | ||
|
|
||
| [**Testomat.io API Reference**](https://app.testomat.io/docs/openapi) | ||
|
|
||
| ## Importing and Reporting with Project Token | ||
|
|
||
| **Project Tokens** are used when working with **Importing** and **Reporting APIs** in Testomat.io. | ||
| These tokens provide access specifically for operations such as importing tests or reporting test results to a given project. | ||
|
|
||
| Please check the documentation below for for details: | ||
|
|
||
| [**Importing API (1.0.0)**](https://testomatio.github.io/check-tests) | ||
|
|
||
| [**Reporting API (1.0.0)**](https://testomatio.github.io/reporter) | ||
|
|
||
| --- | ||
|
|
||
|
|
||
|
|
||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| title: Overview | ||
| --- | ||
|
|
||
| import DirectoryLinks from '/src/components/DirectoryLinks.astro'; | ||
|
|
||
| <DirectoryLinks directory="advanced/api-access"/> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To get all test results from a specifc run: