Hello Testiny team,
We’re using the Testiny Automation API (POST /v1/automation) to create test runs from our Playwright automation framework. Currently, we can successfully create test runs with test results, but we need the ability to attach videos and screenshots directly during the creation process, especially for failed tests.
Current Implementation:
We’re using the Automation API with the following payload structure:
{
“projectId”: 123,
“source”: “playwright-smoke-tests”,
“runTitlePattern”: “Automation Test Run US-Staging 2025-01-15”,
“runGroupBy”: ,
“results”: [
{
"ts": 1705315200000,
"title": "@testiny:857 | @smoke Verify Login Works",
"key": "TC-857",
"path": \["Smoke Tests", "Verify Home Elements"\],
"duration": 15,
"status": "failed",
"error": "Element not found: button\[data-testid='login'\]",
"detailMessage": "Element not found: button\[data-testid='login'\]",
"attachments": \[\], // Currently empty - we need to add videos/screenshots here
"fields": \[857, "@testiny:857 | @smoke Verify Login Works"\],
"steps": \[
{ "id": "step1", "title": "Navigate to login page" },
{ "id": "step2", "title": "Enter credentials" },
{ "id": "step3", "title": "Click login button" }
\]
}
],
“fieldNames”: [“test_case_id”, “test_title”],
“noFieldCreate”: false,
“noSourceCreate”: false,
“useServerTime”: false
}
Current Workaround:
Right now, we have to:
-
Create the test run via Automation API (with empty attachments: )
-
Extract the created test run ID from the response
-
Make separate API calls to POST /v1/testrun/upload-attachment/{testrunId}/{testcaseId} for each attachment
This requires multiple API calls and adds complexity to our automation framework.
What We Need:
We would like to be able to include attachments (videos and screenshots) directly in the Automation API payload. For example:
{
“results”: [
{
"ts": 1705315200000,
"title": "@testiny:857 | @smoke Verify Login Works",
"status": "failed",
"attachments": \[
{
"type": "video",
"filename": "test-video.mp4",
"content": "base64-encoded-video-data",
"mime_type": "video/mp4",
"title": "Test execution video"
},
{
"type": "screenshot",
"filename": "error-screenshot.png",
"content": "base64-encoded-image-data",
"mime_type": "image/png",
"title": "Error screenshot"
}
\]
}
]
}
Questions:
-
Is there a way to include attachments (videos/screenshots) directly in the Automation API payload when creating test runs?
-
If not, is this feature planned for future releases?
-
What would be the recommended format for attachments in the Automation API? (base64 encoding, file URLs, multipart form-data, etc.)
-
Are there any size limits for attachments when using the Automation API?
Use Case:
We run hundreds of automated tests daily, and for failed tests, we need to attach execution videos and error screenshots. Currently, this requires a two-step process (create run, then upload attachments), which is inefficient and adds latency.
Note: We’re aware that the REST API endpoint /v1/testrun/upload-attachment/{testrunId}/{testcaseId} works well for UPDATE mode, but we need this functionality in CREATE mode (Automation API) as well.
Thank you for your time and consideration!
Best regards,
Petro Kudriashov