Repository navigation
Add remote Playwright projects and browser session tests - #11
Merged
Merged
Conversation
The remote projects run against any deployment named by PULP_UI_E2E_BASE_URL with the accounts listed in the JSON file named by PULP_UI_E2E_ACCOUNTS. A setup project signs each account in once with the UTF-8 Basic login call and saves the session as a storage state file with owner-only access under the ignored playwright/.auth directory; a teardown project ends those sessions and deletes the files. A first test opens a list page on the shared session and reloads it.
Against a deployment, in a context of its own so the shared sessions stay valid: form sign-in keeps the session cookie HttpOnly and Secure and stores no credential, legacy stored credentials are removed unread, a refused sign-in with Polish letters shows the server message without a script error, a next address pointing at another site is not followed, logout answers 204 and ends the session, and logout after the session ended shows no error. A second tab that was open when the first one logged out is refused with 401 without crashing and shows the login page after a reload. A small test opens the application as the limited account.
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.
Adds Playwright projects that run the end-to-end suite against any deployment, plus the first browser tests that use them.
Remote projects
remote-setupsigns each account in once through the login API (UTF-8 Basic header,X-Requested-With) and saves the session as a storage state file, mode 0600, under the git-ignoredplaywright/.auth/.remote-adminandremote-viewerreuse the saved session of their account.remote-teardownends those sessions and deletes the files.The target comes from
PULP_UI_E2E_BASE_URL(UI root, ending in/ui/) and the accounts from the JSON file named byPULP_UI_E2E_ACCOUNTS({"admin": {...}, "viewer": {...}}). Without them a remote project fails with a message naming the missing variable. The smoke project is unchanged and needs neither. The remote projects are meant to be run from a terminal; no workflow runs them, because their output holds session data.What the tests check
nextaddress pointing at another site is not followed after signing in.Tests that sign in or out start from a context of their own with a fresh sign-in, so ending a session never affects the shared one.