Skip to content

feat(e2e): add Playwright e2e tests for first-run wizard and settings page#2017

Open
Copilot wants to merge 3 commits intomasterfrom
copilot/setup-e2e-tests-for-firstrunwizard
Open

feat(e2e): add Playwright e2e tests for first-run wizard and settings page#2017
Copilot wants to merge 3 commits intomasterfrom
copilot/setup-e2e-tests-for-firstrunwizard

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 23, 2026

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


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

  • 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.

Agent-Logs-Url: https://github.com/nextcloud/firstrunwizard/sessions/1c61fbba-9f10-42ec-9b79-764cf5c34c8c

@szaimen szaimen added this to the Nextcloud 34 milestone Mar 23, 2026
Copilot AI requested a review from szaimen March 23, 2026 11:20
… 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>
@szaimen szaimen force-pushed the copilot/setup-e2e-tests-for-firstrunwizard branch from 7744d01 to 185870a Compare March 23, 2026 17:23
@szaimen szaimen removed their request for review March 23, 2026 17:34
@szaimen szaimen marked this pull request as ready for review March 23, 2026 17:34
@szaimen szaimen dismissed their stale review March 23, 2026 17:34

resolved

@szaimen
Copy link
Copy Markdown
Collaborator

szaimen commented Mar 23, 2026

This is ready for review :)

*/
export async function createRandomUser(): Promise<User> {
return createRandomUserNC()
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be done now. Please have another look :)

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants