summaryrefslogtreecommitdiffstats
path: root/cypress/support
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2023-11-10 21:28:56 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2023-11-12 01:13:21 +0100
commitb2d999fd6835e5c59b6086c658330ce7360a780f (patch)
tree0850dcfce7194176c7537ae0b00fa69a617dbf8d /cypress/support
parent3ce31fc1bff99af87f6b9bd3ce74bd41011ce768 (diff)
downloadnextcloud-server-b2d999fd6835e5c59b6086c658330ce7360a780f.tar.gz
nextcloud-server-b2d999fd6835e5c59b6086c658330ce7360a780f.zip
fix(cypress): Do not install calendar app from app store for testing but use locally provided test app
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'cypress/support')
-rw-r--r--cypress/support/commonUtils.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/cypress/support/commonUtils.ts b/cypress/support/commonUtils.ts
index 5f0feae4824..580e9b23428 100644
--- a/cypress/support/commonUtils.ts
+++ b/cypress/support/commonUtils.ts
@@ -35,3 +35,25 @@ export function clearState() {
users.forEach((userID) => cy.runOccCommand(`user:delete '${userID}'`))
})
}
+
+/**
+ * Install the test app
+ */
+export function installTestApp() {
+ const testAppPath = 'cypress/fixtures/testapp'
+ cy.runOccCommand('-V').then((output) => {
+ const version = output.stdout.match(/(\d\d+)\.\d+\.\d+/)?.[1]
+ cy.wrap(version).should('not.be.undefined')
+ cy.exec(`docker cp '${testAppPath}' nextcloud-cypress-tests-server:/var/www/html/apps`, { log: true })
+ cy.exec(`docker exec nextcloud-cypress-tests-server sed -i 's|version="[0-9]+|version="${version}|' apps/testapp/appinfo/info.xml`)
+ cy.runOccCommand('app:enable testapp')
+ })
+}
+
+/**
+ * Remove the test app
+ */
+export function uninstallTestApp() {
+ cy.runOccCommand('app:remove testapp', { failOnNonZeroExit: false })
+ cy.exec('docker exec nextcloud-cypress-tests-server rm -fr apps/testapp/appinfo/info.xml')
+}