test: implement screen-shooter integration tests#1241
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b59ef68b70
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const actualImagePath = path.join(__dirname, "screens", "dynamic-sticky-menu-safe-area.png"); | ||
| await image.save(actualImagePath); | ||
|
|
||
| const expectedImagePath = path.join(SCREENSHOTS_PATH, "dynamic-sticky-menu-safe-area.png"); |
There was a problem hiding this comment.
Save actual screenshots outside reference snapshots
actualImagePath is set to __dirname/screens/...png, which is the same file later used as expectedImagePath; this makes looksSame(actualImagePath, expectedImagePath) a self-compare that will always pass and silently overwrites the checked-in baseline on every run. The same pattern appears in other cases in this file, so these tests cannot catch regressions in screenshot output.
Useful? React with 👍 / 👎.
| _.set(browserConfig.desiredCapabilities, "goog:chromeOptions", { | ||
| args: [ | ||
| "--force-device-scale-factor=3", | ||
| "--high-dpi-support=1", |
There was a problem hiding this comment.
Restrict Chrome-specific capabilities to Chrome runs
This test unconditionally injects goog:chromeOptions into browserConfig, but the integration workflow runs with BROWSER=firefox too; in firefox jobs this either causes session-creation errors or runs without applying the intended fractional-scroll emulation, so the test becomes unreliable/non-representative across the matrix. Guard this setup by browser name (or skip the case for non-Chrome browsers).
Useful? React with 👍 / 👎.
What's done?