Skip to content

Commit 16fd3e6

Browse files
committed
fixup! fixup! test(installer): migrate end-to-end tests to PlayWright
1 parent e2aa3df commit 16fd3e6

3 files changed

Lines changed: 11 additions & 24 deletions

File tree

.github/workflows/playwright.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,20 +164,20 @@ jobs:
164164
- '3306/tcp'
165165
env:
166166
MYSQL_ROOT_PASSWORD: rootpassword
167-
MYSQL_USER: oc_autotest
167+
MYSQL_USER: nextcloud
168168
MYSQL_PASSWORD: nextcloud
169-
MYSQL_DATABASE: oc_autotest
169+
MYSQL_DATABASE: nextcloud
170170
options: --health-cmd="mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 10
171171

172172
mariadb:
173173
image: mariadb:12.3 # zizmor: ignore[unpinned-images]
174174
ports:
175175
- '3306/tcp'
176176
env:
177-
MYSQL_ROOT_PASSWORD: rootpassword
178-
MYSQL_USER: oc_autotest
179-
MYSQL_PASSWORD: nextcloud
180-
MYSQL_DATABASE: oc_autotest
177+
MARIADB_ROOT_PASSWORD: rootpassword
178+
MARIADB_USER: nextcloud
179+
MARIADB_PASSWORD: nextcloud
180+
MARIADB_DATABASE: nextcloud
181181
options: --health-cmd="mariadb-admin ping" --health-interval 5s --health-timeout 2s --health-retries 5
182182

183183
postgres:
@@ -238,8 +238,6 @@ jobs:
238238

239239
- name: Run Playwright setup tests
240240
run: npm run playwright:setup
241-
env:
242-
PLAYWRIGHT_SETUP: 'true'
243241

244242
- name: Show logs
245243
if: failure()

tests/playwright/e2e/core/setup.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import { SetupPage } from '../../support/sections/SetupPage.ts'
1313
/**
1414
* Installation-wizard tests. They repeatedly UN-INSTALL the shared server (so it
1515
* can be set up again from scratch) and the non-SQLite cases need reachable
16-
* database containers, so they run only in the dedicated setup job — gated on
17-
* PLAYWRIGHT_SETUP and isolated in the `setup` Playwright project (see
18-
* playwright.config.ts). They are tagged `@setup` for selective runs.
16+
* database containers, so they run only in the dedicated setup job —
17+
* isolated in the `setup` Playwright project.
18+
* They are tagged `@setup` for selective runs.
1919
*/
2020
const test = base.extend<{ setupPage: SetupPage }>({
2121
setupPage: async ({ page }, use) => {
@@ -42,8 +42,8 @@ const RECOMMENDED_APP_COUNT = APPSTORE_APPS.ocs.data.length
4242
const ENABLE_SUCCESS = { ocs: { meta: { status: 'ok', statuscode: 200, message: 'OK' }, data: { update_required: false } } }
4343
const ENABLE_FAILURE = { ocs: { meta: { status: 'failure', statuscode: 500, message: 'Forced failure' }, data: [] } }
4444

45-
const MYSQL: DatabaseConnection = { user: 'oc_autotest', password: 'nextcloud', name: 'oc_autotest', host: 'mysql:3306' }
46-
const MARIADB: DatabaseConnection = { user: 'oc_autotest', password: 'nextcloud', name: 'oc_autotest', host: 'mariadb:3306' }
45+
const MYSQL: DatabaseConnection = { user: 'root', password: 'rootpassword', name: 'nextcloud', host: 'mysql:3306' }
46+
const MARIADB: DatabaseConnection = { user: 'root', password: 'rootpassword', name: 'nextcloud', host: 'mariadb:3306' }
4747
const POSTGRES: DatabaseConnection = { user: 'root', password: 'rootpassword', name: 'nextcloud', host: 'postgres:5432' }
4848
const ORACLE: DatabaseConnection = { user: 'system', password: 'oracle', name: 'FREE', host: 'oracle:1521' }
4949

tests/playwright/start-nextcloud-server.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,7 @@ async function start() {
4747
// when present; a no-op locally and in the normal test job where it is absent.
4848
await connectToActionsNetwork()
4949

50-
await runExec(['mkdir', '-p', 'apps-cypress'])
51-
await runExec(['cp', 'cypress/fixtures/app.config.php', 'config'])
52-
5350
await waitOnNextcloud(ip)
54-
// The installer (setup) tests immediately un-install and re-install the
55-
// instance from scratch, so this initial app set is discarded — skip cloning
56-
// the bundled apps (avoids a needless network dependency and is faster). The
57-
// mounted `apps_writable` folder is normally created as a side effect of that
58-
// clone, so create it explicitly or Nextcloud reports it missing.
59-
if (process.env.PLAYWRIGHT_SETUP) {
60-
await runExec(['mkdir', '-p', 'apps_writable'])
61-
}
6251
await configureNextcloud(process.env.PLAYWRIGHT_SETUP ? [] : ['viewer'])
6352

6453
process.stdout.write('\nApply custom configuration for Playwright tests\n')

0 commit comments

Comments
 (0)