Skip to content
Draft
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
7 changes: 5 additions & 2 deletions broken-site-reporting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Test suite specific fields:
- `jsPerformance` - string - optional field containing the js performance value measured on the page
- `locale` - string - optional field containing the locale of the application (e.g. 'en')
- `userRefreshCount` - string - optional field containing the number of times the user refreshed the current page
- `breakageData` - string - optional field containing pre-encoded breakage data from content scripts (already encoded, platforms MUST NOT re-encode and MUST pass this value AS-IS to the report URL)
- `expectReportURLPrefix` - string - resulting report URL should be prefixed with this string
- `expectReportURLParams` - Array of `{name: '', value: ''}` objects - resulting report URL should have the following set of URL parameters with matching values
- `value` is an optional check for an exact value match.
Expand Down Expand Up @@ -64,7 +65,8 @@ for $testSet in test.json
manufacturer=$test.manufacturer,
model=$test.model,
os=$test.os,
gpcEnabled=$test.gpcEnabled
gpcEnabled=$test.gpcEnabled,
breakageData=$test.breakageData
)

if $test.expectReportURLPrefix
Expand Down Expand Up @@ -105,7 +107,8 @@ for $testSet in test.json
manufacturer=$report.manufacturer,
model=$report.model,
os=$report.os,
gpcEnabled=$report.gpcEnabled
gpcEnabled=$report.gpcEnabled,
breakageData=$report.breakageData
)

if $report.expectReportURLPrefix
Expand Down
48 changes: 48 additions & 0 deletions broken-site-reporting/tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,54 @@
"safari-extension",
"windows-browser"
]
},
{
"name": "Test breakageData is passed as-is without double-encoding (simple)",
"siteURL": "https://example.test/",
"wasUpgraded": false,
"category": "content",
"blockedTrackers": [],
"surrogates": [],
"atb": "v123-456g",
"blocklistVersion": "abc123",
"protectionsEnabled": true,
"breakageData": "%7B%22test%22%3A%22value%22%7D",
"expectReportURLPrefix": "https://improving.duckduckgo.com/t/epbf",
"expectReportURLParams": [
{"name": "category", "value": "content"},
{"name": "siteUrl", "value": "https%3A%2F%2Fexample.test%2F"},
{"name": "upgradedHttps", "value": "false"},
{"name": "tds", "value": "abc123"},
{"name": "blockedTrackers", "value": ""},
{"name": "surrogates", "value": ""},
{"name": "protectionsState", "value": "true"},
{"name": "breakageData", "value": "%7B%22test%22%3A%22value%22%7D"}
],
"exceptPlatforms": []
},
{
"name": "Test breakageData is passed as-is without double-encoding (complex with special chars and URL-like value)",
"siteURL": "https://example.test/",
"wasUpgraded": false,
"category": "content",
"blockedTrackers": [],
"surrogates": [],
"atb": "v123-456g",
"blocklistVersion": "abc123",
"protectionsEnabled": true,
"breakageData": "%7B%22data%22%3A%7B%22nested%22%3A%7B%22value1-hyphens%22%3Atrue%2C%22value2Array%7B%7D%22%3A%5B%22.a-value%22%5D%7D%7D%2C%20%22urlLike%22%3A%20%22https%3A%2F%2Fexample.com%2Fpath%3Fquery%3Dvalue%26other%3D123%22%7D",
"expectReportURLPrefix": "https://improving.duckduckgo.com/t/epbf",
"expectReportURLParams": [
{"name": "category", "value": "content"},
{"name": "siteUrl", "value": "https%3A%2F%2Fexample.test%2F"},
{"name": "upgradedHttps", "value": "false"},
{"name": "tds", "value": "abc123"},
{"name": "blockedTrackers", "value": ""},
{"name": "surrogates", "value": ""},
{"name": "protectionsState", "value": "true"},
{"name": "breakageData", "value": "%7B%22data%22%3A%7B%22nested%22%3A%7B%22value1-hyphens%22%3Atrue%2C%22value2Array%7B%7D%22%3A%5B%22.a-value%22%5D%7D%7D%2C%20%22urlLike%22%3A%20%22https%3A%2F%2Fexample.com%2Fpath%3Fquery%3Dvalue%26other%3D123%22%7D"}
],
"exceptPlatforms": []
}
]
}
Expand Down
Loading