Skip to content

test: setup component tests - #13579

Draft
odzhychko wants to merge 1 commit into
mainfrom
setup-component-tests
Draft

test: setup component tests#13579
odzhychko wants to merge 1 commit into
mainfrom
setup-component-tests

Conversation

@odzhychko

@odzhychko odzhychko commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Adapts https://playwright.dev/docs/test-components for Vue 2.

But put stories next to tests and not component sources.
This follows https://github.com/nextcloud-libraries/nextcloud-vue.

馃 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@welcome

welcome Bot commented Aug 26, 2026

Copy link
Copy Markdown

Thanks for opening your first pull request in this repository! 鉁岋笍

@nextcloud-command nextcloud-command added the AI assisted This PR contains AI-assisted commits label Aug 26, 2026
@odzhychko
odzhychko force-pushed the setup-component-tests branch from a4e0da5 to e340b07 Compare August 26, 2026 11:45
@odzhychko
odzhychko force-pushed the setup-component-tests branch 4 times, most recently from 862b127 to 4d06661 Compare August 27, 2026 07:46

@odzhychko odzhychko Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@GretaD @GVodyanov Maybe this visual regression testing setup will be useful for you during migration to Vue 3.

I suspect many components will break visually when going from @nextcloud/vue@8 (Vue 2) to @nextcloud/vue@9 (Vue3) because we often use :deep customize standard components.

@odzhychko
odzhychko force-pushed the setup-component-tests branch from 4d06661 to 968280a Compare August 27, 2026 07:53
- name: Download css
run: |
cd src/tests/component/gallery/assets/server
curl https://nextcloud.github.io/server/apps/theming/css/default.css > apps/theming/css/default.css

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My preference is to commit the server style like https://github.com/nextcloud-libraries/nextcloud-vue/blob/main/.github/workflows/server-styling-update.yml

Pros
  • It works offline
  • It's clear which styles is tested with
  • Can run npm run test:component without needing the checkout of sever
    • Simplifies CI running
    • Gives more flexibility in local development (e.g. fixing visual issue or creating mockups without server running)
Alternatives

Not sure how you develop with this repo, let me know if you want to keep it as proposed or do it differently.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@susnux I want to apply component testing including visual regression testing to a groupware apps. Do you have thoughts of a good long term solution for making server styles available for that?

I thought of creating an NPM package nextcloud/testing (repo nextcloud-libraries/nextcloud-testing that bundles styling. NPM package would automatically be published for server versions and updated through renovate in using repos.

<head>
	<link href="node_modules/nextcloud/testing/styles/server/stable35/apps/theming/css/default.css" rel="stylesheet" />
	<link href="node_modules/nextcloud/testing/styles/server/stable35/core/css/server.css" rel="stylesheet" />
</head>

It would have /server/stable35/, /server/stable34, /server/master etc. for matrix testing.

This would remove CI complexity and maintance for this from individual apps (mail, calendar, contacts) and libraries (nextcloud-vue).

@odzhychko
odzhychko marked this pull request as ready for review August 27, 2026 08:15
Adapts https://playwright.dev/docs/test-components for Vue 2.

But put stories next to tests and not component sources.
This follows https://github.com/nextcloud-libraries/nextcloud-vue.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Oleksandr Dzhychko <hey@oleks.dev>
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT

name: Playwright Tests

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Gate run only for fronted changes.
See #13586

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Maybe even wrap in to the workflow that runs the node tests. Also simplify, because we do not need parllel running.

@odzhychko
odzhychko marked this pull request as draft September 1, 2026 05:37
runs-on: ubuntu-latest
strategy:
matrix:
branch: ['main', 'stable8']

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Use correct branches

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review AI assisted This PR contains AI-assisted commits

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants