test: add Playwright smoke tests for the settings pages and the dashboard widgets - #214
Merged
Merged
Conversation
…oard widgets CI builds the frontend but never runs it, so a change that breaks a page at runtime, like a dependency update or a global Nextcloud no longer provides, passes with every check green. The suite runs the built app in the Nextcloud test container of @nextcloud/e2e-test-server, checks that the admin and personal settings sections render and that the link preview switch round-trips through the API, and that both dashboard widgets ask users without a Jira account to connect one and list issues once notifications arrive. It fails on any uncaught exception or unexpected failing request of the app. CI runs it against the oldest and the newest server the app supports. Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
The endpoint has to answer 400 for a user who has connected no account, because that is how the dashboard widgets learn to show their connect prompt. Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
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.
CI builds the frontend but never runs it, so a change that breaks a page at runtime, such as a dependency update or a global that Nextcloud no longer provides, goes through with every check green. The empty dashboard widgets fixed in #212 passed CI for exactly that reason. This adds a Playwright suite that runs the built app in a real Nextcloud, and a unit test for the endpoint behind the widgets.
The suite runs the app in a real Nextcloud
playwright/start-server.mjsstarts the Nextcloud test container of@nextcloud/e2e-test-serverwith this app mounted and enabled, the same setup the activity app uses.PLAYWRIGHT_BASE_URLpoints the suite at an existing instance instead.The settings pages and both dashboard widgets are covered
The tests check that the admin section renders its fields and that the link preview switch round-trips through
/sensitive-admin-config, that the personal section offers both ways to connect an account, that both widgets ask a user without a Jira account to connect one, and that the notifications widget lists an issue once the API answers with one. Every test also fails on an uncaught exception and on a failing request to one of the app's own routes, so a component that throws while loading turns the suite red.A unit test covers the endpoint the widgets ask
JiraAPIControllerTestpins the two answers ofgetNotifications(): 400 for a user who has connected no account, which is how the widgets learn to show their connect prompt, and the issue list for a user who has.CI runs it against the oldest and the newest supported server
The workflow takes both ends of the version range from
info.xmlthrough the version matrix action, currently stable33 and master. It also runs on pushes to main, so the combined result of several merged pull requests is tested as well.🤖 AI (if applicable)