test: fix useless waiting for app config cache

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/61522/head
Ferdinand Thiessen 2 months ago
parent b245d2dcc9
commit b842cbb364
No known key found for this signature in database
GPG Key ID: 7E849AE05218500F
  1. 3
      tests/playwright/e2e/core/header-contacts-menu.spec.ts
  2. 10
      tests/playwright/start-nextcloud-server.js

@ -94,7 +94,6 @@ test.describe('Header: Contacts menu', () => {
test('users from other groups are not seen when user enumeration is restricted to the same group', async ({ page, contactUser }) => {
// Enable restriction first, then open the menu.
await runOcc(['config:app:set', '--value', 'yes', 'core', 'shareapi_restrict_user_enumeration_to_group'])
await new Promise((resolve) => globalThis.setTimeout(resolve, 3000)) // wait for app config cache to expire
try {
await page.goto('/')
const contactsMenu = new ContactsMenuPage(page)
@ -106,9 +105,7 @@ test.describe('Header: Contacts menu', () => {
// Close, lift the restriction, reopen — the contact should reappear.
await runOcc(['config:app:set', '--value', 'no', 'core', 'shareapi_restrict_user_enumeration_to_group'])
const waitForAppConfigCacheTTL = new Promise((resolve) => globalThis.setTimeout(resolve, 3000)) // wait for app config cache to expire
await contactsMenu.close()
await waitForAppConfigCacheTTL
await page.reload()
await contactsMenu.open()

@ -49,13 +49,19 @@ async function start() {
await configureNextcloud()
process.stdout.write('\nApply custom configuration for Playwright tests\n')
await runExec(['php', '-r', '$db = new SQLite3("data/owncloud.db");$db->busyTimeout(5000);$db->exec("PRAGMA journal_mode = wal;");'])
process.stdout.write('├─ Enabled SQLite WAL mode for better performance\n')
await runOcc(['config:system:set', 'cache_app_config', '--value', 'false', '--type', 'boolean'])
process.stdout.write('├─ Disabled caching AppConfig\n') // otherwise test setup using OCC will need to wait 3s so that web cache TTL expires
await runOcc(['config:system:set', 'appstoreenabled', '--value', 'false', '--type', 'boolean'])
process.stdout.write('├─ Disabled app store\n')
// createRandomUser() generates short passwords that the policy would reject
await runOcc(['app:disable', 'password_policy'])
process.stdout.write('├─ Disabled password policy for random test users\n')
await runExec(['php', '-r', '$db = new SQLite3("data/owncloud.db");$db->busyTimeout(5000);$db->exec("PRAGMA journal_mode = wal;");'])
process.stdout.write('├─ Enabled SQLite WAL mode for better performance\n')
process.stdout.write('├─ Initialize cron job...\n')
await runExec(['php', 'cron.php'])
process.stdout.write('│ └─ OK !\n')

Loading…
Cancel
Save