|
|
|
|
@ -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<Cypress.ExecOptions>) => {
|
|
|
|
|
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),
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
|