Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Optional `assertionFailures` on final test results and retry history, with producer-formatted comparisons, individual diagnostics and `extra` metadata.

- Optional Test `description` in specification 0.3.0 for human-readable case context, separate from its name, suite and attempt diagnostics.

- Optional `threadId` on attempt history entries, using the same contract as Test
Expand Down
20 changes: 17 additions & 3 deletions examples/comprehensive.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,23 @@
"line": 42,
"browser": "chromium",
"threadId": "worker-1",
"message": "Element not found: .dashboard-metrics",
"trace": "Error: Element not found: .dashboard-metrics\n at waitForElement (test.js:45:10)\n at Object.<anonymous> (dashboard.test.js:42:5)",
"snippet": "const metrics = await page.locator('.dashboard-metrics');\nawait expect(metrics).toBeVisible();",
"message": "Two dashboard assertions failed",
"trace": "Error: Two dashboard assertions failed\n at Object.<anonymous> (dashboard.test.js:42:5)",
"assertionFailures": [
{
"message": "Metrics should be visible",
"trace": "Error: Metrics should be visible\n at dashboard.test.js:42:5",
"expected": "visible",
"actual": "hidden"
},
{
"message": "Dashboard title should match",
"trace": "Error: Dashboard title should match\n at dashboard.test.js:43:5",
"expected": "Dashboard",
"actual": "Loading"
}
],
"snippet": "await expect.soft(page.locator('.dashboard-metrics')).toBeVisible();\nawait expect.soft(page.locator('.dashboard-title')).toHaveText('Dashboard');",
"screenshot": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"stdout": [
"Loading admin dashboard",
Expand Down
6 changes: 6 additions & 0 deletions examples/with-diagnostics.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
"duration": 5000,
"message": "Expected element to be visible",
"trace": "Error: Expected element to be visible\n at checkVisibility (test.js:45:10)\n at Object.<anonymous> (test.js:12:5)",
"assertionFailures": [
{
"expected": "visible",
"actual": "hidden"
}
],
"screenshot": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
"stdout": [
"Starting test execution",
Expand Down
8 changes: 7 additions & 1 deletion examples/with-retries.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@
"attempt": 1,
"status": "failed",
"duration": 120,
"message": "Connection timeout"
"message": "Service should be ready",
"assertionFailures": [
{
"expected": "ready",
"actual": "starting"
}
]
},
{
"attempt": 2,
Expand Down
66 changes: 66 additions & 0 deletions schema/ctrf.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,39 @@
"description": "Stack trace or failure trace information",
"type": "string"
},
"assertionFailures": {
"description": "Assertion failures attributable to this attempt",
"type": "array",
"minItems": 1,
"items": {
"description": "Details of an individual assertion failure",
"type": "object",
"minProperties": 1,
"properties": {
"message": {
"description": "Message associated with this assertion failure",
"type": "string"
},
"trace": {
"description": "Stack trace associated with this assertion failure",
"type": "string"
},
"expected": {
"description": "String representation of the expected value",
"type": "string"
},
"actual": {
"description": "String representation of the actual value",
"type": "string"
},
"extra": {
"description": "Extension point for arbitrary metadata",
"type": "object"
}
},
"additionalProperties": false
}
},
"snippet": {
"description": "Code snippet associated with the failure",
"type": "string"
Expand Down Expand Up @@ -311,6 +344,39 @@
"description": "Stack trace for this attempt",
"type": "string"
},
"assertionFailures": {
"description": "Assertion failures attributable to this attempt",
"type": "array",
"minItems": 1,
"items": {
"description": "Details of an individual assertion failure",
"type": "object",
"minProperties": 1,
"properties": {
"message": {
"description": "Message associated with this assertion failure",
"type": "string"
},
"trace": {
"description": "Stack trace associated with this assertion failure",
"type": "string"
},
"expected": {
"description": "String representation of the expected value",
"type": "string"
},
"actual": {
"description": "String representation of the actual value",
"type": "string"
},
"extra": {
"description": "Extension point for arbitrary metadata",
"type": "object"
}
},
"additionalProperties": false
}
},
"line": {
"description": "Line number associated with failure",
"type": "integer"
Expand Down
Loading
Loading