From 503f43f655ed0bf95714c77829c0a0ccb994b105 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Fri, 15 Aug 2025 15:59:05 +0200 Subject: [PATCH] test(cypress): clear cache after running OCC commands Signed-off-by: Ferdinand Thiessen --- cypress/support/commands.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index ad486a8a8f7..b09a165451f 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -246,3 +246,16 @@ Cypress.Commands.add('userFileExists', (user: string, path: string) => { return cy.runCommand(`stat --printf="%s" "data/${user}/files/${path}"`, { failOnNonZeroExit: true }) .then((exec) => Number.parseInt(exec.stdout || '0')) }) + +Cypress.Commands.add('runOccCommand', (command: string, options?: Partial) => { + return cy.runCommand(`php ./occ ${command}`, options) + .then((context) => + // OCC cannot clear the APCu cache + // eslint-disable-next-line cypress/no-unnecessary-waiting + cy.wait( + command.startsWith('app:') || command.startsWith('config:') + ? 3000 // clear APCu cache + : 0, + ).then(() => context), + ) +})