Skip to content

fix(e2e): seed the About credits the suite can no longer find - #674

Closed
JavierRibaldelRio wants to merge 1 commit into
developfrom
e2e/about-credits-fixture
Closed

JavierRibaldelRio wants to merge 1 commit into
developfrom
e2e/about-credits-fixture

Conversation

@JavierRibaldelRio

Copy link
Copy Markdown
Member

What happens

Both About UI tests fail in CI on expect(locator('#contributors li').first()).toBeVisible() — "element(s) not found" — while passing locally.

5029cf1b stopped committing electron-app/src/about/credits.snapshot.json and electron-app/renderer/about/avatars/, since they are contributor photographs and per-person commit counts in a public repository, and made them build-time artefacts. Nothing in the E2E job builds them: e2e-tests.yaml builds the four renderers and runs Playwright, never build:credits. So a fresh clone has no snapshot, getAboutCredits() returns { contributors: [] } and About renders an empty list. It still passes on a developer's machine, where a previous packaging run left both on disk.

What this changes

pnpm --dir e2e build now seeds the credits through e2e/scripts/about-credits.mjs:

  • three members with distinct descending commit counts, a GitHub login each, and real PNG avatars encoded at seed time, so nothing binary is committed and nothing is fetched;
  • a generated snapshot already on disk is left untouched, so local runs keep exercising the real credits;
  • it is replaced only when it lists nobody, is unreadable, or references an avatar file that is gone — each of which fails the same assertions.

The suite deliberately does not call the GitHub API: the first About test asserts the screen is entirely network-free, and paging the commits API on every pull request would be slow and red for reasons unrelated to the change under test.

Validation

  • node e2e/scripts/about-credits.mjs + getAboutCredits(): 3 contributors, counts [128, 57, 9] descending, every avatarUrl matching the renderer's ./avatars/<id>.png pattern and present on disk, name === login so about:open-profile resolves to https://github.com/e2e-ada.
  • Avatars decode as real images (96×96, 8-bit RGB), which the test requires (naturalWidth > 0).
  • Seeding is idempotent, and reseeds on an empty, corrupt or image-less snapshot; a generated snapshot (including a contributor whose avatar download failed) is preserved.
  • prettier --check clean. The full Playwright run is this PR's own E2E job: it needs Electron on a display, which the environment this was written in does not have.

5029cf1 stopped committing credits.snapshot.json and the contributor
avatars, because they are personal data in a public repository, and made
them build-time artefacts instead. Nothing in the E2E job builds them: the
workflow builds the four renderers and runs Playwright, so a fresh clone
has no snapshot, getAboutCredits() returns an empty list and both About
tests fail on `#contributors li` never appearing. It still passed locally,
where a previous packaging run had left the files on disk.

The suite cannot fetch them either. The About tests assert that the screen
is entirely network-free, and making every pull request page through the
GitHub commits API would be slow and fail for reasons unrelated to the
change under test.

So the renderer build now seeds a fixed, offline fixture: three members
with distinct descending commit counts, a GitHub login each, and real PNG
avatars encoded on the spot, so nothing binary needs committing. A
generated snapshot already on disk is left untouched, so a developer's own
build stays what the About tests exercise locally; it is replaced only when
it lists nobody, is unreadable, or references an avatar that is gone, all
of which would fail the same assertions.
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.

1 participant