Skip to content

Commit 503f43f

Browse files
committed
test(cypress): clear cache after running OCC commands
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 866ccae commit 503f43f

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

cypress/support/commands.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,3 +246,16 @@ Cypress.Commands.add('userFileExists', (user: string, path: string) => {
246246
return cy.runCommand(`stat --printf="%s" "data/${user}/files/${path}"`, { failOnNonZeroExit: true })
247247
.then((exec) => Number.parseInt(exec.stdout || '0'))
248248
})
249+
250+
Cypress.Commands.add('runOccCommand', (command: string, options?: Partial<Cypress.ExecOptions>) => {
251+
return cy.runCommand(`php ./occ ${command}`, options)
252+
.then((context) =>
253+
// OCC cannot clear the APCu cache
254+
// eslint-disable-next-line cypress/no-unnecessary-waiting
255+
cy.wait(
256+
command.startsWith('app:') || command.startsWith('config:')
257+
? 3000 // clear APCu cache
258+
: 0,
259+
).then(() => context),
260+
)
261+
})

0 commit comments

Comments
 (0)