feat(e2e): add Playwright e2e tests for first-run wizard and settings page#2017
Open
feat(e2e): add Playwright e2e tests for first-run wizard and settings page#2017
Conversation
Copilot created this pull request from a session on behalf of
szaimen
March 23, 2026 11:11
View session
Copilot stopped work on behalf of
szaimen due to an error
March 23, 2026 11:38
Copilot stopped work on behalf of
szaimen due to an error
March 23, 2026 11:48
Copilot stopped work on behalf of
szaimen due to an error
March 23, 2026 15:37
szaimen
previously requested changes
Mar 23, 2026
… page Agent-Logs-Url: https://github.com/nextcloud/firstrunwizard/sessions/fead3c70-8ae9-4d07-9ab7-4a42f2bbeb6d fix(e2e): use nextcloud-version-matrix to determine correct server branch Agent-Logs-Url: https://github.com/nextcloud/firstrunwizard/sessions/c1e9236f-f665-4945-980b-77e53a8f025a refactor: use @nextcloud/e2e-test-server for Docker-based e2e testing Agent-Logs-Url: https://github.com/nextcloud/firstrunwizard/sessions/4928786f-c755-4bea-8c14-e5e1ae087ec3 fix(e2e): fix 3 failing test cases - Fix App.vue to skip intro animation in changelog-only mode - Fix 'can be navigated' test: NcButton primary variant has no CSS class - Fix settings test: duplicate ID selector + add Skip button click - Use --with-deps for Playwright install in CI Agent-Logs-Url: https://github.com/nextcloud/firstrunwizard/sessions/57316464-f4c4-4f0c-85e3-87160d3bcd03 fix(e2e): revert App.vue changes, fix tests without app-level workarounds - Revert src/views/App.vue to original state (always start at intro animation) - Fix 'opens when a new major version' test: click Skip to advance past intro - Move 'About & What's new' wizard test from settings.spec.ts to firstrunwizard.spec.ts - Remove 'About & What's new' describe block from settings.spec.ts Agent-Logs-Url: https://github.com/nextcloud/firstrunwizard/sessions/46619e35-ecf5-4089-a682-8830bd9abfe6 fix(e2e): fix setUserPreference to pass value as positional arg to occ user:setting occ user:setting takes the value as a positional argument, not --value=VALUE. The --value flag was silently ignored, so setUserPreference never actually set the 'show' preference, causing the 'opens when a new major version was shipped' test to always fail with the wizard landing on page 0 instead of the whats-new page. Agent-Logs-Url: https://github.com/nextcloud/firstrunwizard/sessions/784a92c7-5c87-4afc-b355-9a4633cbe01d Co-Authored-By: szaimen <42591237+szaimen@users.noreply.github.com>
7744d01 to
185870a
Compare
Collaborator
|
This is ready for review :) |
susnux
reviewed
Mar 24, 2026
susnux
reviewed
Mar 24, 2026
susnux
reviewed
Mar 24, 2026
e2e/support/utils.ts
Outdated
| */ | ||
| export async function createRandomUser(): Promise<User> { | ||
| return createRandomUserNC() | ||
| } |
Contributor
There was a problem hiding this comment.
why re-export? Probably better to just directly import this or even better do it the playwright way and use POM / fixtures.
Then you can also drop the login method and deleteUser.
Basically all whats needed:
/*
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { runOcc } from '@nextcloud/e2e-test-server/docker'
import { createRandomUser, login } from '@nextcloud/e2e-test-server/playwright'
import { test as baseTest } from '@playwright/test'
export const test = baseTest.extend({
page: async ({ page, context }, use) => {
const user = await createRandomUser()
await login(context.request, user)
await use(page)
await runOcc(['user:delete', user.userId])
},
})and then one can use random users like:
import { expect } from '@playwright/test'
import { test } from '../../support/fixtures/random-user-session.ts'
test('My test case', async ({ page }) => {
// ....
})(copilot also created that in other repos with prompts like "Create Playwright e2e tests using page object models. Use the @nextcloud/e2e-test-server npm package as a helper.
You can take the nextcloud/end_to_end_encryption github repository as an inspiration on how to do so")
Collaborator
There was a problem hiding this comment.
should be done now. Please have another look :)
…cture issues Co-authored-by: szaimen <42591237+szaimen@users.noreply.github.com> Agent-Logs-Url: https://github.com/nextcloud/firstrunwizard/sessions/d25ff6bc-e079-4e27-b832-5e2301f569ff
…copyright year
- Remove generateSslCertificate(); add makeHttpOnly() that patches the
container's run.sh to strip the SSL directives (a2enmod ssl, a2ensite
default-ssl, a2enconf ssl-params, apache2ctl configtest) so Apache
starts on plain HTTP. Import getContainerName from the package instead
of recomputing it with basename(process.cwd()).
- Rewrite fixtures.ts following susnux's suggestion: extend the test
base with a `user` fixture (auto: true) that creates a random user,
logs in via the Nextcloud login form, and deletes the user after the
test. auto:true ensures every test gets a fresh authenticated session
without having to explicitly request the fixture.
- Remove all try/finally blocks and manual user management from the spec
files; tests that need user.userId declare { page, user }, others only
{ page }.
- Fix copyright year 2024 → 2026 in all new/modified e2e files.
- Remove unused basename import from start-nextcloud-server.mjs.
Co-authored-by: szaimen <42591237+szaimen@users.noreply.github.com>
Agent-Logs-Url: https://github.com/nextcloud/firstrunwizard/sessions/1c61fbba-9f10-42ec-9b79-764cf5c34c8c
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.
Agent-Logs-Url: https://github.com/nextcloud/firstrunwizard/sessions/fead3c70-8ae9-4d07-9ab7-4a42f2bbeb6d
fix(e2e): use nextcloud-version-matrix to determine correct server branch
Agent-Logs-Url: https://github.com/nextcloud/firstrunwizard/sessions/c1e9236f-f665-4945-980b-77e53a8f025a
refactor: use @nextcloud/e2e-test-server for Docker-based e2e testing
Agent-Logs-Url: https://github.com/nextcloud/firstrunwizard/sessions/4928786f-c755-4bea-8c14-e5e1ae087ec3
fix(e2e): fix 3 failing test cases
Agent-Logs-Url: https://github.com/nextcloud/firstrunwizard/sessions/57316464-f4c4-4f0c-85e3-87160d3bcd03
fix(e2e): revert App.vue changes, fix tests without app-level workarounds
Agent-Logs-Url: https://github.com/nextcloud/firstrunwizard/sessions/46619e35-ecf5-4089-a682-8830bd9abfe6
fix(e2e): fix setUserPreference to pass value as positional arg to occ user:setting
occ user:setting takes the value as a positional argument, not --value=VALUE.
The --value flag was silently ignored, so setUserPreference never actually set
the 'show' preference, causing the 'opens when a new major version was shipped'
test to always fail with the wizard landing on page 0 instead of the whats-new page.
Agent-Logs-Url: https://github.com/nextcloud/firstrunwizard/sessions/784a92c7-5c87-4afc-b355-9a4633cbe01d
fix(e2e): refactor tests to use Playwright fixtures and fix infrastructure issues
Agent-Logs-Url: https://github.com/nextcloud/firstrunwizard/sessions/d25ff6bc-e079-4e27-b832-5e2301f569ff
fix(e2e): use HTTP-only server, fixture-based random user login, fix copyright year
container's run.sh to strip the SSL directives (a2enmod ssl, a2ensite
default-ssl, a2enconf ssl-params, apache2ctl configtest) so Apache
starts on plain HTTP. Import getContainerName from the package instead
of recomputing it with basename(process.cwd()).
base with a
userfixture (auto: true) that creates a random user,logs in via the Nextcloud login form, and deletes the user after the
test. auto:true ensures every test gets a fresh authenticated session
without having to explicitly request the fixture.
files; tests that need user.userId declare { page, user }, others only
{ page }.
Agent-Logs-Url: https://github.com/nextcloud/firstrunwizard/sessions/1c61fbba-9f10-42ec-9b79-764cf5c34c8c