Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
npm run build --if-present

- name: Install Playwright browsers
run: npx playwright install --with-deps
run: npm run playwright:install-ci --if-present

- name: Run Playwright tests
run: npm run playwright -- --shard='${{ matrix.shardIndex }}/${{ matrix.shardTotal }}'
Expand Down Expand Up @@ -230,7 +230,7 @@ jobs:
npm run build --if-present

- name: Install Playwright browsers
run: npx playwright install --with-deps
run: npm run playwright:install-ci --if-present

- name: Run Playwright setup tests
run: npm run playwright:setup
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"postlint": "build/demi.sh lint",
"lint:fix": "build/demi.sh lint:fix",
"playwright": "playwright test --project=default --project=admin-settings",
"playwright:install": "playwright install chromium-headless-shell",
"playwright:install": "playwright install chromium",
"playwright:setup": "playwright test --project=setup",
"sass": "sass --style compressed --load-path core/css core/css/ $(for cssdir in $(find apps -mindepth 2 -maxdepth 2 -name \"css\"); do if ! $(git check-ignore -q $cssdir); then printf \"$cssdir \"; fi; done)",
"sass:icons": "node build/icons.mjs",
Expand Down
16 changes: 13 additions & 3 deletions playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
/// <reference types="@types/node" />

import { defineConfig, devices } from '@playwright/test'

type DeviceDescriptor = typeof devices[string]
const BROWSWER_CONFIG_CHROME: DeviceDescriptor & { channel: string } = {
...devices['Desktop Chrome'],
channel: process.env.CI
? 'chrome' // on CI use the chrome browser provided by the GitHub Actions runner
: 'chromium', // locally use the default playwright chromium browser
}

export default defineConfig({
testDir: './tests/playwright/e2e',
fullyParallel: true,
Expand All @@ -26,7 +35,7 @@ export default defineConfig({
workers: 1,
grep: /@setup/,
use: {
...devices['Desktop Chrome'],
...BROWSWER_CONFIG_CHROME,

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.

Uh, second time looking at this I see it :-S But just typo.

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.

I will fix it in both (do a new PR and backport)

},
},

Expand All @@ -36,7 +45,7 @@ export default defineConfig({
workers: 1, // only one admin setting test can run at a time due to shared state
testMatch: '**/admin-settings*.spec.ts',
use: {
...devices['Desktop Chrome'],
...BROWSWER_CONFIG_CHROME,
},
},

Expand All @@ -45,10 +54,11 @@ export default defineConfig({
testMatch: /\/(?!admin-settings)[^/]*\.spec\.ts$/,
grepInvert: /@setup/,
use: {
...devices['Desktop Chrome'],
...BROWSWER_CONFIG_CHROME,
},
},
],

webServer: {
command: 'node tests/playwright/start-nextcloud-server.js',
env: {
Expand Down
Loading