Skip to content

Replace the Selenium suite with Playwright browser tests run across all auth methods - #157

Open
mraible wants to merge 3 commits into
feature/bootstrap-5from
feature/playwright-tests
Open

Replace the Selenium suite with Playwright browser tests run across all auth methods#157
mraible wants to merge 3 commits into
feature/bootstrap-5from
feature/playwright-tests

Conversation

@mraible

@mraible mraible commented Aug 12, 2026

Copy link
Copy Markdown

Stacked on #156 (3/3 in the stack); review only the top commit.

Removed: the it-selenium module, its Jetty/Derby test harness, and its CI steps. Its user-journey coverage is ported to the new it-playwright module below, so no test scenario is lost — the journey actually grows (media upload, OIDC, login-page checks). The GitHub Actions workflow is rewritten accordingly.

it-playwright holds Java Playwright tests that point at a running Roller and adapt to how it is configured:

  • NewUserJourneyIT ports the old Selenium journey and extends it: register the first user, sign in, create a weblog, publish an entry, read it back on the blog, then enable file uploads from the server admin page (they ship disabled; the first user is the admin) and upload an image that is verified to be served back, and import an OPML file whose blogroll must appear
  • OidcLoginIT signs in through the identity provider as an administrator and a regular user, verifies only the administrator reaches server administration, and creates a weblog and publishes an entry while signed in via OIDC
  • LoginPageIT checks the login page offers exactly the sign-in mechanisms of the configured authentication method
  • WebServicesIT is the only coverage of the servlets forked from javax-only libraries during the migration: it enables the APIs from the server admin page, lists weblogs and publishes an entry over Blogger/MetaWeblog XML-RPC, verifies the entry renders, and fetches the AtomPub service document over basic auth. It immediately caught a pre-existing bug where AtomPub basic auth always returned 401 (fixed in the Jakarta PR)

Each test skips whatever its instance does not offer, which keeps casual local runs friendly but could let a misconfigured instance pass with everything skipped. Passing -Droller.expectedAuth=db|oidc|db-oidc turns mismatches and unexpected skips into failures.

CI runs the suite three ways: db on Jetty with Derby, plus oidc and db-oidc against the Docker Compose stack through an AUTHENTICATION_METHOD matrix. The compose jobs drive Roller's auto-installer on the fresh database and upload Playwright traces on failure. All three legs were verified locally against fresh databases before the workflow was wired up.

it-playwright is deliberately not a reactor module since it needs a browser and a running instance; see its README for local usage. The ldap and cma methods stay uncovered because neither stack provides a directory server or container-managed realms. Failed tests record a trace to target/playwright-traces, viewable with npx playwright show-trace.

…ll auth methods

The it-playwright directory holds Java Playwright tests that point at a running Roller and adapt to its configuration: the old Selenium journey (register, create a weblog, publish and read an entry), OIDC sign-in as administrator and regular user including publishing while signed in, and a login-page check that the offered sign-in mechanisms match the configured authentication method. Passing -Droller.expectedAuth turns mismatches and unexpected skips into failures instead. It is deliberately not a reactor module since it needs a browser and a running instance. CI runs the suite three ways: db on Jetty with Derby, and oidc plus db-oidc against the Docker Compose stack via an AUTHENTICATION_METHOD matrix, driving Roller's auto-installer on the fresh database and uploading Playwright traces on failure. Failed tests record a trace to target/playwright-traces.
The journey now enables file uploads from the server admin page (they ship disabled, and the first registered user is the admin), uploads a generated PNG, and asserts the success page appears and the stored image is served back with the right content type. This guards the Struts 7 UploadedFilesAware upload path, which broke silently during the migration until Greg Huber caught it on dev@roller.
@mraible
mraible force-pushed the feature/playwright-tests branch from eee5dbd to 3d5087a Compare August 13, 2026 06:27
…port

WebServicesIT is the only coverage of the servlets forked from javax-only libraries during the migration: it enables both APIs from the server admin page, lists the journey user's weblogs and publishes an entry over Blogger/MetaWeblog XML-RPC, verifies the entry renders on the blog, and fetches the AtomPub service document over basic auth. The new-user journey now also imports an OPML file and verifies the imported blogroll appears, guarding the second UploadedFilesAware conversion. The AtomPub check immediately caught a pre-existing bug where basic auth always returned 401, fixed in the Jakarta PR.
@mraible
mraible force-pushed the feature/playwright-tests branch from 3d5087a to 8c47722 Compare August 13, 2026 06:38
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