Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

test: sort broken assets in the audit golden normalizer

Luigi Agostidcbbd9634327
diff --git a/tests/e2e/fixtures/audit-site/golden-report.json b/tests/e2e/fixtures/audit-site/golden-report.json
index 29fc422f..a8ccd0b2 100644
--- a/tests/e2e/fixtures/audit-site/golden-report.json
+++ b/tests/e2e/fixtures/audit-site/golden-report.json
@@ -9,6 +9,7 @@
{
"browser": {
"accessibilityScore": 100,
+ "brokenAssets": [],
"consoleLogs": [],
"interactiveElements": [
{
@@ -115,14 +116,14 @@
"url": "http://fixtures/audit-site/assets/missing.js"
},
{
- "resourceType": "image",
+ "resourceType": "fetch",
"status": 404,
- "url": "http://fixtures/audit-site/assets/missing.png"
+ "url": "http://fixtures/audit-site/assets/missing.json"
},
{
- "resourceType": "fetch",
+ "resourceType": "image",
"status": 404,
- "url": "http://fixtures/audit-site/assets/missing.json"
+ "url": "http://fixtures/audit-site/assets/missing.png"
}
],
"consoleLogs": [],
@@ -175,6 +176,7 @@
{
"browser": {
"accessibilityScore": 100,
+ "brokenAssets": [],
"consoleLogs": [
{
"level": "log",
@@ -214,6 +216,7 @@
{
"browser": {
"accessibilityScore": 70,
+ "brokenAssets": [],
"consoleLogs": [],
"interactiveElements": [
{
@@ -261,6 +264,7 @@
{
"browser": {
"accessibilityScore": 100,
+ "brokenAssets": [],
"consoleLogs": [],
"interactiveElements": [
{
@@ -299,6 +303,7 @@
{
"browser": {
"accessibilityScore": 100,
+ "brokenAssets": [],
"consoleLogs": [],
"interactiveElements": [
{
@@ -351,6 +356,7 @@
{
"browser": {
"accessibilityScore": 100,
+ "brokenAssets": [],
"consoleLogs": [
{
"level": "log",
@@ -382,6 +388,7 @@
{
"browser": {
"accessibilityScore": 100,
+ "brokenAssets": [],
"consoleLogs": [],
"interactiveElements": [
{
@@ -408,6 +415,7 @@
{
"browser": {
"accessibilityScore": 100,
+ "brokenAssets": [],
"consoleLogs": [],
"interactiveElements": [
{
@@ -434,6 +442,7 @@
{
"browser": {
"accessibilityScore": 100,
+ "brokenAssets": [],
"consoleLogs": [],
"interactiveElements": [
{
@@ -460,6 +469,7 @@
{
"browser": {
"accessibilityScore": 100,
+ "brokenAssets": [],
"consoleLogs": [],
"interactiveElements": [
{
@@ -486,6 +496,7 @@
{
"browser": {
"accessibilityScore": 100,
+ "brokenAssets": [],
"consoleLogs": [],
"interactiveElements": [
{
diff --git a/tests/e2e/fixtures/audit-site/normalize-report.jq b/tests/e2e/fixtures/audit-site/normalize-report.jq
index 0be066c5..77f71cc5 100644
--- a/tests/e2e/fixtures/audit-site/normalize-report.jq
+++ b/tests/e2e/fixtures/audit-site/normalize-report.jq
@@ -4,8 +4,8 @@
# Normalized away: the run timestamp, the run input (carries the caller's
# FIXTURES_URL host), all timing metrics, screenshot payloads/paths, console
# timestamps/sources, and network entry fields that vary per run (timings,
-# sizes, request ids); network entries are sorted by URL because subresource
-# completion order is nondeterministic.
+# sizes, request ids); network entries and broken assets are sorted by URL
+# because subresource completion order is nondeterministic (more so under load).
#
# Regenerate the golden report (from a runner shell against the e2e stack):
# curl -s -H "Authorization: Bearer $E2E_SERVER_TOKEN" -X POST "$E2E_SERVER/audit" \
@@ -22,4 +22,5 @@
| .browser.networkRequests = ((.browser.networkRequests // [])
| map({url: .url, method: .method, status: .status, resourceType: .resourceType})
| sort_by(.url))
+ | .browser.brokenAssets = ((.browser.brokenAssets // []) | sort_by(.url))
)