-
Notifications
You must be signed in to change notification settings - Fork 1
Fix Playwright tests by adding more descriptive alt text to ad images #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
packages/core/src/constants.ts
Outdated
@@ -13,7 +13,7 @@ export const IS_PRODUCTION = process.env.NODE_ENV === "production" | |||
|
|||
export const DEFAULT_SERVICE_ENDPOINT: HTTPSURLString = IS_PRODUCTION | |||
? "https://ads.mozilla.org/" // production | |||
: "https://ads.allizom.org/" // staging | |||
: "https://ads.mozilla.org/" // staging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ehhh.. can we just update playwright to set NODE_ENV=production
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, apologies for the mess, that would absolutely be the right way to do it, I will make that change. This was just me trying out a quick way to make sure this approach would work
packages/core/test/constants.test.ts
Outdated
@@ -6,7 +6,7 @@ describe("core/constants.ts", () => { | |||
}) | |||
|
|||
test("Use staging endpoint URLs when not in production", () => { | |||
expect(DEFAULT_SERVICE_ENDPOINT).toBe("https://ads.allizom.org/") | |||
expect(DEFAULT_SERVICE_ENDPOINT).toBe("https://ads.mozilla.org/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't testing the right thing anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, thank you so much. Will fix.
d5a80de
to
f30911f
Compare
…e from placement name
b213099
to
4933018
Compare
"example:iife": "npm run build && cd examples/iife && npm install && npm run dev", | ||
"example:react": "npm run build && cd examples/react && npm install && npm run dev", | ||
"example:iife": "npm run build:production && cd examples/iife && npm install && npm run dev", | ||
"example:react": "npm run build:production && cd examples/react && npm install && npm run dev", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add example:iife:staging
and example:react:staging
scripts here to be able to also explicitly run the examples against staging (not as the default)
Problem Statement
We need unique alt text on the ad images for our accessible-first Playwright tests to pass in the example apps, as that's the accessible way to select our ad elements.
Proposed Changes
We now construct alt text for the ad images on the client side in order to contextualize what kind of ad it is for users who aren't navigating visually. And we get the unique ids for the Playwright tests exactly as we need them.
Verification Steps
display.test.ts
incore
and make sure it's covering all the cases