aboutsummaryrefslogtreecommitdiffstats
path: root/cypress/dockerNode.ts
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-09-05 11:28:17 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-09-06 03:38:48 +0200
commit4a90d5328cae20e913612eec447346b55c2c12ae (patch)
treed032100b7860378c1567bc7dc3f93394c1e8d344 /cypress/dockerNode.ts
parentbe884eeaec0de15211ca6318f68bdd7a714f3baa (diff)
downloadnextcloud-server-4a90d5328cae20e913612eec447346b55c2c12ae.tar.gz
nextcloud-server-4a90d5328cae20e913612eec447346b55c2c12ae.zip
test: Add end-to-end tests for new public share Vue UI
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'cypress/dockerNode.ts')
-rw-r--r--cypress/dockerNode.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/cypress/dockerNode.ts b/cypress/dockerNode.ts
index a9e8c7c6c45..71644ae7399 100644
--- a/cypress/dockerNode.ts
+++ b/cypress/dockerNode.ts
@@ -147,6 +147,8 @@ export const configureNextcloud = async function() {
// Saving DB state
console.log('├─ Creating init DB snapshot...')
await runExec(container, ['cp', '/var/www/html/data/owncloud.db', '/var/www/html/data/owncloud.db-init'], true)
+ console.log('├─ Creating init data backup...')
+ await runExec(container, ['tar', 'cf', 'data-init.tar', 'admin'], true, undefined, '/var/www/html/data')
console.log('└─ Nextcloud is now ready to use 🎉')
}
@@ -277,9 +279,11 @@ const runExec = async function(
command: string[],
verbose = false,
user = 'www-data',
+ workdir?: string,
): Promise<string> {
const exec = await container.exec({
Cmd: command,
+ WorkingDir: workdir,
AttachStdout: true,
AttachStderr: true,
User: user,
@@ -296,7 +300,7 @@ const runExec = async function(
stream.on('data', str => {
str = str.trim()
// Remove non printable characters
- .replace(/[^\x20-\x7E]+/g, '')
+ .replace(/[^\x0A\x0D\x20-\x7E]+/g, '')
// Remove non alphanumeric leading characters
.replace(/^[^a-z]/gi, '')
output += str