test(geolocation): pass country code instead of IP in test helpers by stephenliang · Pull Request #73481 · code-dot-org/code-dot-org · GitHub
Skip to content

test(geolocation): pass country code instead of IP in test helpers#73481

Open
stephenliang wants to merge 2 commits into
stagingfrom
stephen/fix-gdpr-dialog-test
Open

test(geolocation): pass country code instead of IP in test helpers#73481
stephenliang wants to merge 2 commits into
stagingfrom
stephen/fix-gdpr-dialog-test

Conversation

@stephenliang

Copy link
Copy Markdown
Member

Summary

  • Update Cucumber step "I am in Europe" to pass 'ES' (country code) instead of '150.214.39.255' (IP address).
  • Update Playwright setCountryOverride() helper to accept a required {countryCode} named arg (no default), setting the cookie directly.
  • All 6 Playwright GDPR specs updated to call setCountryOverride(page, {countryCode: 'ES'}).

Depends on

#73478 (backend: accept country code directly in GeolocationOverride cookie) — must merge first.

Test plan

🤖 Generated with Claude Code

stephenliang and others added 2 commits June 25, 2026 09:11
… cookie

If the cookie value is a 2-letter uppercase ISO 3166-1 alpha-2 code
(e.g. 'ES'), set HTTP_CLOUDFRONT_VIEWER_COUNTRY directly and skip
Geocoder entirely. This eliminates intermittent failures when
ipinfo.io's unauthenticated free tier returns empty results.

IP-address values still route through the existing Geocoder path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update Cucumber and Playwright geolocation helpers to pass 'ES'
(country code) instead of '150.214.39.255' (IP address), using the
country-code fast path added in the parent commit. This eliminates
the Geocoder.search() call that intermittently fails in CI.

Depends on: #73478

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@artem-vavilov artem-vavilov requested a review from wilkie June 25, 2026 16:25
Base automatically changed from stephen/geolocation-country-code-fast-path to staging June 25, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants