test(e2e): port OneTrust integration to Playwright#73350
Draft
stephenliang wants to merge 3 commits into
Draft
Conversation
Port 8 scenarios from dashboard/test/ui/features/platform/one_trust.feature. Green under the 5x/all-browser stress gate; original Cucumber feature tagged @playwright so the Cucumber suite skips it. Source: dashboard/test/ui/features/platform/one_trust.feature
The port modeled OneTrust as `OneTrustPage extends BasePage` with the assertions baked into the page object. OneTrust is injected into every page rather than being a page of its own, so model it as a component (mirroring AuthoredHints) and keep assertions in the spec, per the e2e-tests convention. - add OneTrustComponent owning a named locator per emitted OT script (sdkStub, selfHostedSdkStub, autoBlock, prod/testAutoBlock), so the script paths live in one place instead of repeated across tests - move every expect() out of the page object into the spec - name and justify the OT timeouts; drop comments that narrate the next line Verified: typecheck, eslint, prettier, and 15 passed / 1 skipped on chromium against test-studio. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4358697 to
9fffe86
Compare
The @eyes scenario is a visual (Applitools) test with no equivalent in the Playwright suite, so it is not migrated. Tagging the whole feature @playwright wrongly claimed it was done and, once the Cucumber<->Playwright dedup activates, would drop the eyes coverage with no replacement. - feature: drop feature-level @playwright; tag the 7 migrated scenarios individually; leave the @eyes scenario untagged so the Cucumber eyes run keeps covering it - spec: the @eyes stub is now Migration status: PENDING and test.fixme, documenting it stays in Cucumber until Playwright visual diff exists Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports
dashboard/test/ui/features/platform/one_trust.feature(the OneTrust cookie-consent integration suite) from Cucumber/Selenium to Playwright infrontend/packages/e2e-tests. OneTrust is injected into every studio page rather than being a page of its own, so it is modeled as a reusable component (mirroringAuthoredHints). No product code changes — test-only.The original Cucumber feature is tagged
@playwrightso the legacy Selenium suite skips the now-ported scenarios.What changed
tests/components/one-trust.ts— newOneTrustComponent. Owns a named locator per OneTrust-emitted<script>(sdkStub,selfHostedSdkStub,autoBlock,prodAutoBlock,testAutoBlock) plus the consentbanner, acategorizedScript()helper for theoptanon-category-*tagging convention, and awaitForSdkSettled()readiness wait. Locators and waits only; assertions live in the spec.tests/platform/one-trust.spec.ts— the 8 ported scenarios: banner display under European geo, the fouronetrust_cookie_scriptsmodes (self-hosted / prod / test / off), critical-script categorization, and the 9-project-type embedded-view check. The@eyesscenario istest.skip'd (Applitools visual diff has no equivalent here; the functional flow is covered by the adjacent scenario).tests/shared/dcdo.ts,tests/shared/geolocation.ts— shared helpers that set theDCDOandGeolocationOverridecookies, mirroring the RailsRack::CookieDCDO/Rack::GeolocationOverridemiddleware and themock_dcdo/ "I am in Europe" Cucumber steps.one_trust.feature— tagged@playwrightso the Cucumber run skips the now-ported scenarios.Test structure
Links
dashboard/test/ui/features/platform/one_trust.featureTesting story
yarn typecheck— cleaneslintandprettier --checkon the changed files — cleannpx playwright test tests/platform/one-trust.spec.ts --project=chromiumagainsttest-studio.code.org— 15 passed, 1 skipped (the@eyesscenario)Full cross-browser (firefox/webkit) coverage runs in CI.
Deployment notes
Standard merge — test-only change, no migrations or flags.
Privacy and security
None — test-only. No product code, PII, or auth surface changes.