|
| 1 | +Feature: DAP redacts PII |
| 2 | + |
| 3 | + Background: |
| 4 | + Given I load an empty browser |
| 5 | + And DAP is configured for agency "GSA" |
| 6 | + |
| 7 | + Scenario: Email addresses are redacted from event parameters |
| 8 | + When I load the test site |
| 9 | + And I execute script "window.gas4('error', {type: 'form', url: 'user@example.com'})" |
| 10 | + Then a "error" event is sent to DAP with parameters |
| 11 | + | type | form | |
| 12 | + | url | [REDACTED_EMAIL] | |
| 13 | + |
| 14 | + Scenario: SSNs are redacted from event parameters |
| 15 | + When I load the test site |
| 16 | + And I execute script "window.gas4('error', {type: 'form', url: '123-45-6789'})" |
| 17 | + Then a "error" event is sent to DAP with parameters |
| 18 | + | type | form | |
| 19 | + | url | [REDACTED_SSN] | |
| 20 | + |
| 21 | + Scenario: Phone numbers are redacted from event parameters |
| 22 | + When I load the test site |
| 23 | + And I execute script "window.gas4('error', {type: 'form', url: '202-555-1234'})" |
| 24 | + Then a "error" event is sent to DAP with parameters |
| 25 | + | type | form | |
| 26 | + | url | [REDACTED_TEL] | |
| 27 | + |
| 28 | + Scenario: Dates of birth are redacted from event parameters when labeled with dob= |
| 29 | + When I load the test site |
| 30 | + And I execute script "window.gas4('error', {type: 'form', url: 'dob=1990-01-15'})" |
| 31 | + Then a "error" event is sent to DAP with parameters |
| 32 | + | type | form | |
| 33 | + | url | [REDACTED_DOB] | |
| 34 | + |
| 35 | + Scenario: Passwords are redacted from event parameters when labeled with password= |
| 36 | + When I load the test site |
| 37 | + And I execute script "window.gas4('error', {type: 'form', url: 'password=mysecret123'})" |
| 38 | + Then a "error" event is sent to DAP with parameters |
| 39 | + | type | form | |
| 40 | + | url | [REDACTED_PASSWORD] | |
| 41 | + |
| 42 | + Scenario: ZIP codes are redacted from event parameters when labeled with zip= |
| 43 | + When I load the test site |
| 44 | + And I execute script "window.gas4('error', {type: 'form', url: 'zip=20001'})" |
| 45 | + Then a "error" event is sent to DAP with parameters |
| 46 | + | type | form | |
| 47 | + | url | [REDACTED_ZIP] | |
| 48 | + |
| 49 | + Scenario: Non-PII data is not redacted from event parameters |
| 50 | + When I load the test site |
| 51 | + And I execute script "window.gas4('error', {type: 'validation', url: '/contact/submit'})" |
| 52 | + Then a "error" event is sent to DAP with parameters |
| 53 | + | type | validation | |
| 54 | + | url | /contact/submit | |
| 55 | + |
| 56 | + Scenario: PII redaction applies to parameters in config calls |
| 57 | + Given the page URL has query parameter "search" set to "user@example.com" |
| 58 | + When I load the test site |
| 59 | + Then the config call for the DAP property has "page_location" containing "[REDACTED_EMAIL]" |
| 60 | + |
| 61 | + Scenario: PII redaction applies to automatically collected events |
| 62 | + Given the page URL has query parameter "search" set to "user@example.com" |
| 63 | + And I set the browser to intercept outbound requests |
| 64 | + When I load the test site |
| 65 | + And I wait 5 seconds |
| 66 | + Then there is a GA4 request reporting event "page_view" with parameter "dl" containing "[REDACTED_EMAIL]" |
0 commit comments