Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ packages/design-system/docs/public/*
!/packages/web-runtime/themes/opencloud/

# Report for tests
tests/report/cucumber_report.json
tests/report/cucumber_report.html
.vscode/settings.json

# third party licenses
Expand Down
80 changes: 40 additions & 40 deletions .woodpecker.star
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ config = {
"earlyFail": True,
"skip": False,
"suites": [
"journeys",
"smoke",
"journeys/",
"smoke/",
],
"browsers": [
"chromium",
Expand All @@ -68,8 +68,8 @@ config = {
"earlyFail": True,
"skip": False,
"suites": [
"admin-settings",
"spaces",
"admin-settings/",
"spaces/",
],
},
"3": {
Expand All @@ -91,10 +91,10 @@ config = {
"earlyFail": True,
"skip": False,
"suites": [
"navigation",
"user-settings",
"file-action",
"app-store",
"navigation/",
"user-settings/",
"file-action/",
"app-store/",
],
},
"a11y": {
Expand All @@ -112,7 +112,7 @@ config = {
"app-provider": {
"skip": False,
"suites": [
"app-provider",
"app-provider/",
],
"extraServerEnvironment": {
"GATEWAY_GRPC_ADDR": "0.0.0.0:9142",
Expand All @@ -127,7 +127,7 @@ config = {
"app-provider-onlyOffice": {
"skip": False,
"suites": [
"app-provider-onlyOffice",
"app-provider-onlyOffice/",
],
"extraServerEnvironment": {
"GATEWAY_GRPC_ADDR": "0.0.0.0:9142",
Expand All @@ -141,8 +141,8 @@ config = {
},
"oidc-refresh-token": {
"skip": False,
"features": [
"cucumber/features/oidc/refreshToken.feature",
"suites": [
"oidc/refreshToken",
],
"extraServerEnvironment": {
"IDP_ACCESS_TOKEN_EXPIRATION": 30,
Expand All @@ -151,8 +151,8 @@ config = {
},
"oidc-iframe": {
"skip": False,
"features": [
"cucumber/features/oidc/iframeTokenRenewal.feature",
"suites": [
"oidc/iframeTokenRenewal",
],
"extraServerEnvironment": {
"IDP_ACCESS_TOKEN_EXPIRATION": 30,
Expand All @@ -178,13 +178,13 @@ config = {
"mobile-view": {
"skip": False,
"suites": [
"mobile-view",
"mobile-view/",
],
},
"localization-de": {
"skip": False,
"features": [
"cucumber/features/a11y/smoke.feature",
"suites": [
"a11y/smoke",
],
"extraServerEnvironment": {
"OC_DEFAULT_LANGUAGE": "de",
Expand Down Expand Up @@ -596,8 +596,7 @@ def e2eTests(ctx):
"OC_BASE_URL": "opencloud:9200",
"OC_SHOW_USER_EMAIL_IN_RESULTS": True,
"FAIL_ON_UNCAUGHT_CONSOLE_ERR": True,
"PLAYWRIGHT_BROWSERS_PATH": ".playwright",
"BROWSER": browser_name,
"PLAYWRIGHT_BROWSERS_PATH": "tests/e2e/.playwright",
"TERM": "xterm-256color",
"FORCE_COLOR": "1",
}
Expand Down Expand Up @@ -635,24 +634,24 @@ def e2eTests(ctx):
if browser_name == "firefox" or browser_name == "webkit":
environment["FAIL_ON_UNCAUGHT_CONSOLE_ERR"] = "False"

command = "cd tests/e2e && bash run-e2e.sh "
command = "cd tests/e2e && pnpm bddgen && pnpm playwright install '%s' --with-deps && pnpm playwright test --reporter=list --project='%s' " % (browser_name, browser_name)

if "suites" in matrix:
command += "--suites %s" % ",".join(params["suites"])
command += "%s" % " ".join(params["suites"])
elif "features" in matrix:
command += "%s" % " ".join(params["features"])
else:
print("Error: No suites or features defined for e2e test suite '%s'" % suite)
return []

if "mobile-view" in suite:
command = "pnpm test:e2e:mobile-parallel"
command = "cd tests/e2e && pnpm bddgen && pnpm playwright test '%s' --reporter=list --project=mobile-chromium --project=mobile-webkit --project=ipad-chromium --project=ipad-landscape-webkit" % suite
pipeline_name = "e2e-tests-%s" % suite
else:
pipeline_name = "e2e-tests-%s-%s" % (suite, browser_name)

if "localization-de" in suite:
command = "RUN_LOCALIZATION_TEST_FOR_LANG=de pnpm test:e2e:cucumber tests/e2e/cucumber/features/a11y/smoke.feature"
command = "pnpm playwright install chromium --with-deps && cd tests/e2e && pnpm bddgen && RUN_LOCALIZATION_TEST_FOR_LANG=de playwright test a11y --project=chromium"

steps += [{
"name": "e2e-tests",
Expand All @@ -662,7 +661,7 @@ def e2eTests(ctx):
command,
],
}] + \
uploadTracingResult(ctx)
uploadTestArtifacts()

pipelines.append({
"name": pipeline_name,
Expand Down Expand Up @@ -746,7 +745,7 @@ def installBrowsers():
"name": "install-browsers",
"image": OC_CI_NODEJS,
"environment": {
"PLAYWRIGHT_BROWSERS_PATH": ".playwright",
"PLAYWRIGHT_BROWSERS_PATH": "tests/e2e/.playwright",
},
"commands": [
". ./.woodpecker.env",
Expand Down Expand Up @@ -1372,24 +1371,24 @@ def pipelineSanityChecks(pipelines):
for image in images.keys():
print(" %sx\t%s" % (images[image], image))

def uploadTracingResult(ctx):
status = ["failure"]
if "with-tracing" in ctx.build.title.lower():
status = ["failure", "success"]

def uploadTestArtifacts():
return [{
"name": "upload-tracing-result",
"name": "upload-tests-artifacts",
"image": MINIO_MC,
"environment": minio_mc_environment,
"commands": [
"mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY",
"mc cp -a %s/reports/e2e/playwright/tracing/* s3/$PUBLIC_BUCKET/web/tracing/$CI_REPO_NAME/$CI_PIPELINE_NUMBER/" % dir["web"],
"cd %s/reports/e2e/playwright/tracing/" % dir["web"],
'echo "To see the trace, please open the following link in the console"',
'for f in *.zip; do echo "npx playwright show-trace $MC_HOST/$PUBLIC_BUCKET/web/tracing/$CI_REPO_NAME/$CI_PIPELINE_NUMBER/$f \n"; done',
# upload report and tracing
"ls -la %s/tests/e2e/test-results/" % dir["web"],
"mc cp -a --recursive %s/tests/e2e/test-results/ s3/$PUBLIC_BUCKET/web/artifacts/$CI_REPO_NAME/$CI_PIPELINE_NUMBER/test-results/" % dir["web"],
# print links
'echo "HTML Report:"',
'echo "$MC_HOST/$PUBLIC_BUCKET/web/artifacts/$CI_REPO_NAME/$CI_PIPELINE_NUMBER/test-results/index.html"',
'echo "Traces:"',
'mc find s3/$PUBLIC_BUCKET/web/artifacts/$CI_REPO_NAME/$CI_PIPELINE_NUMBER/test-results/ --name "trace.zip" | sed "s|s3/$PUBLIC_BUCKET/||" | while read f; do echo "npx playwright show-trace $MC_HOST/$PUBLIC_BUCKET/$f"; done',
],
"when": {
"status": status,
"status": ["failure", "success"],
},
}]

Expand Down Expand Up @@ -1627,18 +1626,19 @@ def e2eTestsOnKeycloak(ctx):
"REPORT_TRACING": "with-tracing" in ctx.build.title.lower(),
"KEYCLOAK": True,
"KEYCLOAK_HOST": "keycloak:8443",
"PLAYWRIGHT_BROWSERS_PATH": ".playwright",
"BROWSER": "chromium",
"PLAYWRIGHT_BROWSERS_PATH": "tests/e2e/.playwright",
"TERM": "xterm-256color",
"FORCE_COLOR": "1",
},
"commands": [
"cd tests/e2e",
"bash run-e2e.sh cucumber/features/keycloak",
"pnpm playwright install chromium && pnpm bddgen && pnpm playwright test keycloak --project=chromium --reporter=list",
"pwd && ls -la test-results/",
"ls -la playwright-report/",
],
},
] + \
uploadTracingResult(ctx)
uploadTestArtifacts()

return [{
"name": "e2e-test-on-keycloak",
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ OpenCloud Web is a TypeScript/Vue 3 single-page application that serves as the b
│ ├── extension-sdk/ # Utilities for custom extensions
│ └── web-app-*/ # Standalone apps/extensions (files, search, preview, …)
├── tests/
│ └── e2e/ # End-to-end tests (Playwright + Cucumber)
│ └── e2e/ # End-to-end tests (Playwright + Playwright BDD)
├── dev/ # Docker/infrastructure config for local development
├── docker-compose.yml
├── vite.config.ts # Root Vite config
Expand Down Expand Up @@ -100,7 +100,7 @@ Enforced via ESLint (`packages/eslint-config`). Run `pnpm lint` to check.

### End-to-End Tests

- **Framework:** [Playwright](https://playwright.dev/) + [Cucumber](https://cucumber.io/)
- **Framework:** [Playwright](https://playwright.dev/) + [Playwright BDD](https://vitalets.github.io/playwright-bdd/)
- **Location:** `tests/e2e/` (outside of `packages/`)
- **Prerequisites:** Run `pnpm build` before executing e2e tests. A running OpenCloud backend is also required — use `docker-compose up -d` to start one locally.
- **Run:** `pnpm test:e2e:cucumber`
Expand Down
25 changes: 0 additions & 25 deletions cucumber.mjs

This file was deleted.

17 changes: 3 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,13 @@
"lint": "eslint vite.config.ts '{packages,tests}/**/*.{js,ts,vue}' --color",
"format:check": "prettier . --config packages/prettier-config/index.js --check",
"format:write": "prettier . --config packages/prettier-config/index.js --write",
"serve": "SERVER=true pnpm build:w",
"test:e2e:cucumber": "NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e --parallel ${PARALLEL:-1}",
"test:e2e:cucumber:chromium": "BROWSER=chromium NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e --parallel ${PARALLEL:-1}",
"test:e2e:cucumber:firefox": "BROWSER=firefox NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e --parallel ${PARALLEL:-1}",
"test:e2e:cucumber:webkit": "BROWSER=webkit NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e --parallel ${PARALLEL:-1} --tags 'not @webkit-skip'",
"test:e2e:mobile-parallel": "bash -c 'FORCE_COLOR=1 pnpm run test:e2e:mobile-chromium > mobile-chromium.log 2>&1 & pid1=$!; FORCE_COLOR=1 pnpm run test:e2e:mobile-webkit > mobile-webkit.log 2>&1 & pid2=$!; FORCE_COLOR=1 pnpm run test:e2e:ipad-chromium > ipad-chromium.log 2>&1 & pid3=$!; FORCE_COLOR=1 pnpm run test:e2e:ipad-safari > ipad-safari.log 2>&1 & pid4=$!; wait $pid1; ec1=$?; wait $pid2; ec2=$?; wait $pid3; ec3=$?; wait $pid4; ec4=$?; echo \"=== LOG FILES ===\"; for log in *.log; do echo \"--- $log ---\"; cat $log; echo; done; echo \"=== RESULTS ===\"; echo \"Mobile Chromium: $([ $ec1 -eq 0 ] && echo ✅ PASSED || echo ❌ FAILED)\"; echo \"Mobile WebKit: $([ $ec2 -eq 0 ] && echo ✅ PASSED || echo ❌ FAILED)\"; echo \"iPad Chromium: $([ $ec3 -eq 0 ] && echo ✅ PASSED || echo ❌ FAILED)\"; echo \"iPad Safari: $([ $ec4 -eq 0 ] && echo ✅ PASSED || echo ❌ FAILED)\"; if [ $ec1 -ne 0 ] || [ $ec2 -ne 0 ] || [ $ec3 -ne 0 ] || [ $ec4 -ne 0 ]; then exit 1; fi'",
"test:e2e:mobile-chromium": "BROWSER=mobile-chromium NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e ./tests/e2e/cucumber/features/mobile-view",
"test:e2e:mobile-webkit": "FAIL_ON_UNCAUGHT_CONSOLE_ERR=false BROWSER=mobile-webkit NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e ./tests/e2e/cucumber/features/mobile-view",
"test:e2e:ipad-chromium": "BROWSER=ipad-chromium NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e ./tests/e2e/cucumber/features/mobile-view",
"test:e2e:ipad-safari": "BROWSER=ipad-landscape-webkit NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e ./tests/e2e/cucumber/features/mobile-view",
"test:unit": "NODE_OPTIONS=--unhandled-rejections=throw vitest --config ./tests/unit/config/vitest.config.ts",
"licenses:check": "license-checker-rseidelsohn --summary --relativeLicensePath --onlyAllow 'Python-2.0;Apache*;Apache License, Version 2.0;Apache-2.0;Apache 2.0;Artistic-2.0;BSD;BSD-3-Clause;CC-BY-3.0;CC-BY-4.0;CC0-1.0;ISC;MIT;MPL-2.0;Public Domain;Unicode-TOU;Unlicense;WTFPL;BlueOak-1.0.0' --excludePackages '@opencloud-eu/eslint-config;@opencloud-eu/prettier-config;@opencloud-eu/tsconfig;@opencloud-eu/web-client;@opencloud-eu/web-pkg;external;web-app-files;text-editor;preview;web-app-ocm;@opencloud-eu/design-system;pdf-viewer;web-app-search;admin-settings;webfinger;web-runtime;@opencloud-eu/web-test-helpers'",
"licenses:csv": "license-checker-rseidelsohn --relativeLicensePath --csv --out ./third-party-licenses/third-party-licenses.csv",
"licenses:save": "license-checker-rseidelsohn --relativeLicensePath --out /dev/null --files ./third-party-licenses/third-party-licenses",
"vite": "vite",
"check:types": "vue-tsc --noEmit && pnpm -r --parallel check:types",
"check:all": "pnpm check:types && pnpm lint --fix && pnpm format:write && pnpm test:unit",
"check:unused-steps": "TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e --format usage --dry-run tests/e2e/cucumber/features/*/*.feature"
"check:all": "pnpm check:types && pnpm lint --fix && pnpm format:write && pnpm test:unit"
},
"browserslist": [
"last 1 year",
Expand All @@ -42,8 +31,6 @@
],
"devDependencies": {
"@axe-core/playwright": "^4.11.1",
"@cucumber/cucumber": "12.8.2",
"@cucumber/messages": "32.3.1",
"@cucumber/pretty-formatter": "3.3.0",
"@module-federation/runtime": "2.4.0",
"@module-federation/vite": "1.15.4",
Expand Down Expand Up @@ -72,6 +59,8 @@
"node-fetch": "3.3.2",
"pino": "10.3.1",
"pino-pretty": "13.1.3",
"playwright": "1.59.1",
"playwright-bdd": "8.5.1",
"qs": "^6.15.0",
"tailwindcss": "^4.2.2",
"ts-node": "10.9.2",
Expand Down
Loading