How to automate a manual test?
Question: We have created a manual test in Allure TestOps, and we have created an automated test that is to replace the manual one. How do we tell the system to replace manual test by the created automated test?
How to
This article only describes the case when there is a manual test case that is to be automated by an automated test. If you are working with automated tests only please refer to this section of the documentation.
Get the AllureID attribute for the manual test case
To tell Allure TestOps that a certain manual test is to be replaced (automated) by a newly created automated test or by an existing automated test, you need to provide the information about the AllureID.
AllureID is a unique identifier of a test case in the Allure TestOps database, this parameter is automatically assigned to a test case by the application at the moment of test case creation, and it cannot be selected by an end user.
You can find the AllureID of a test case int the UI of Allure TestOps as shown below.
For a test case selected in the test cases tree, there are 3 places, where AllureID can be found.
- The web-page address field of your browser
- The id substring in the test cases tree
- The AllureId attribute in the test case form located before the test case name.
Alter the code of automated test
The integration with Allure Framework with testing frameworks allows passing the information about the corresponding AllureID to the code of an automated test.
The description of how to provide the required information in the code can be found in the Reference section for each framework integrated with Allure Report.
Examples
Here are three examples for the most popular integrations with automated test frameworks.
This will work with all Java based test frameworks like JUnit, TestNG.
import io.qameta.allure.AllureId;
import org.junit.jupiter.api.Test;
class TestMyWebsite {
@Test
@AllureId("123")
void testAuthentication() {
// ...
}
}
import allure
@allure.id("123")
def test_authentication():
...
An example for TypeScript and PlayWright
import { test } from "@playwright/test";
test("Test Authentication @allure.id:123", async () => {
// do some useful stuff...
});
How to check?
How to check the information on AllureId is indeed passed to the test result and will be successfully processed by Allure TestOps?
The information on the metadata or attributes of the automated tests is collected by the integration with Allure Framework under the section of a test result file called Labels.
All the integrated test framework will have labels AS_ID
or ALLURE_ID
added under the labels section of a test result file.
Example
"labels": [
{
"name": "msrv",
"value": "Billing"
},
{
"name": "AS_ID",
"value": "12345"
},
{
"name": "story",
"value": "Create new issue"
},
{
"name": "jira",
"value": "AE-1"
},
// some other data
],
"labels": [
{
"name": "Feature",
"value": "Billing"
},
{
"name": "story",
"value": "Create new client"
},
{
"name": "ALLURE_ID",
"value": "54321"
},
{
"name": "jira",
"value": "BLNG-1234"
},
// some other data
],