diff options
author | Ferdinand Thiessen <rpm@fthiessen.de> | 2022-06-01 22:58:06 +0300 |
---|---|---|
committer | Ferdinand Thiessen <rpm@fthiessen.de> | 2022-06-05 13:39:56 +0300 |
commit | 324ebe92f8c52d1ac2fe584f1f2fdacae0fcc42d (patch) | |
tree | 978e6bfef26529ccd672a7c91c57ad9d37ae52db /cypress | |
parent | b9fc925f45f9c66cbe408ecb774215d9745e61f4 (diff) |
Fix cypress scripts for local run + Add documentation
Fix the scripts for local cypress runs,
they need to be run within the `npm run` environment,
as the nextcloud webpack config requires the `npm_package_name`
variable to be set.
Also a up-to-date nextcloud instance is required for testing
text at the current git head, so updated the dockerfile
and docker-compose files to create a nextcloud image from current git head.
Additionally updated the tests to use cypress 10.x and
added missing documentation on how to run the cypress tests.
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
Diffstat (limited to 'cypress')
-rw-r--r-- | cypress/Dockerfile | 27 | ||||
-rw-r--r-- | cypress/docker-compose.yml | 15 | ||||
-rw-r--r-- | cypress/e2e/ListItem.spec.js (renamed from cypress/integration/ListItem.spec.js) | 0 | ||||
-rw-r--r-- | cypress/e2e/Table.spec.js (renamed from cypress/integration/Table.spec.js) | 0 | ||||
-rw-r--r-- | cypress/e2e/files.spec.js (renamed from cypress/integration/files.spec.js) | 0 | ||||
-rw-r--r-- | cypress/e2e/images.spec.js (renamed from cypress/integration/images.spec.js) | 0 | ||||
-rw-r--r-- | cypress/e2e/links.spec.js (renamed from cypress/integration/links.spec.js) | 0 | ||||
-rw-r--r-- | cypress/e2e/share.spec.js (renamed from cypress/integration/share.spec.js) | 0 | ||||
-rw-r--r-- | cypress/e2e/viewer.spec.js (renamed from cypress/integration/viewer.spec.js) | 0 | ||||
-rw-r--r-- | cypress/e2e/workspace.spec.js (renamed from cypress/integration/workspace.spec.js) | 0 | ||||
-rwxr-xr-x | cypress/runLocal.sh | 2 | ||||
-rw-r--r-- | cypress/server.sh | 8 | ||||
-rw-r--r-- | cypress/support/e2e.js (renamed from cypress/support/index.js) | 0 |
13 files changed, 34 insertions, 18 deletions
diff --git a/cypress/Dockerfile b/cypress/Dockerfile index 4f2fc4495..d095ecd53 100644 --- a/cypress/Dockerfile +++ b/cypress/Dockerfile @@ -1,12 +1,17 @@ -FROM nextcloudci/server:server-17 +FROM nextcloud:latest -RUN mkdir /var/www/html/data -RUN chown -R www-data:www-data /var/www/html/data - -ENTRYPOINT /usr/local/bin/initAndRun.sh - -# FROM nextcloud:18-rc-apache - - -#ENTRYPOINT [] -#CMD ["apache2-foreground"] +RUN set -ex; \ + apt-get update; \ + apt-get install -y --no-install-recommends git; \ + git clone https://github.com/nextcloud/server.git ; \ + git clone https://github.com/nextcloud/viewer server/apps/viewer; \ + cd server; \ + git submodule update --init; \ + mkdir data; \ + chown -R www-data:www-data config data apps custom_apps; \ + cd ..; \ + cp -R /usr/src/nextcloud/config server/ ; \ + rm -rf /usr/src/nextcloud; \ + mv server /usr/src/nextcloud; \ + apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false git; \ + rm -rf /var/lib/apt/lists/* diff --git a/cypress/docker-compose.yml b/cypress/docker-compose.yml index 9e9eaddff..dc37d403d 100644 --- a/cypress/docker-compose.yml +++ b/cypress/docker-compose.yml @@ -1,14 +1,21 @@ version: '3' services: - nextcloud: + nextcloud_cypress: build: context: . + network: host restart: always ports: - 8081:80 environment: - CYPRESS_baseUrl: - APP_SOURCE: + - NEXTCLOUD_ADMIN_PASSWORD=admin + - NEXTCLOUD_ADMIN_USER=admin + - SQLITE_DATABASE=sqlite_db + - CYPRESS_baseUrl + - APP_SOURCE volumes: - - ${APP_SOURCE}:/var/www/html/apps/text + - type: bind + read_only: true + source: ${APP_SOURCE} + target: /var/www/html/custom_apps/text diff --git a/cypress/integration/ListItem.spec.js b/cypress/e2e/ListItem.spec.js index c45a8b2cc..c45a8b2cc 100644 --- a/cypress/integration/ListItem.spec.js +++ b/cypress/e2e/ListItem.spec.js diff --git a/cypress/integration/Table.spec.js b/cypress/e2e/Table.spec.js index cbf38f86d..cbf38f86d 100644 --- a/cypress/integration/Table.spec.js +++ b/cypress/e2e/Table.spec.js diff --git a/cypress/integration/files.spec.js b/cypress/e2e/files.spec.js index 3b5b8d470..3b5b8d470 100644 --- a/cypress/integration/files.spec.js +++ b/cypress/e2e/files.spec.js diff --git a/cypress/integration/images.spec.js b/cypress/e2e/images.spec.js index 0926dd6d1..0926dd6d1 100644 --- a/cypress/integration/images.spec.js +++ b/cypress/e2e/images.spec.js diff --git a/cypress/integration/links.spec.js b/cypress/e2e/links.spec.js index 6c9d759aa..6c9d759aa 100644 --- a/cypress/integration/links.spec.js +++ b/cypress/e2e/links.spec.js diff --git a/cypress/integration/share.spec.js b/cypress/e2e/share.spec.js index ad1ccb31c..ad1ccb31c 100644 --- a/cypress/integration/share.spec.js +++ b/cypress/e2e/share.spec.js diff --git a/cypress/integration/viewer.spec.js b/cypress/e2e/viewer.spec.js index ca5bc4a3f..ca5bc4a3f 100644 --- a/cypress/integration/viewer.spec.js +++ b/cypress/e2e/viewer.spec.js diff --git a/cypress/integration/workspace.spec.js b/cypress/e2e/workspace.spec.js index 1983b7b93..1983b7b93 100644 --- a/cypress/integration/workspace.spec.js +++ b/cypress/e2e/workspace.spec.js diff --git a/cypress/runLocal.sh b/cypress/runLocal.sh index 4150389cc..86dc89b8e 100755 --- a/cypress/runLocal.sh +++ b/cypress/runLocal.sh @@ -24,7 +24,7 @@ else docker-compose up -d if $(npm bin)/wait-on -i 500 -t 240000 $CYPRESS_baseUrl 2> /dev/null then - docker-compose exec -T nextcloud bash /var/www/html/apps/text/cypress/server.sh + docker-compose exec -T nextcloud_cypress bash /var/www/html/custom_apps/text/cypress/server.sh else echo Waiting for $CYPRESS_baseUrl timed out. echo Container logs: diff --git a/cypress/server.sh b/cypress/server.sh index a50a2c5f0..83fcec453 100644 --- a/cypress/server.sh +++ b/cypress/server.sh @@ -1,6 +1,10 @@ #!/bin/bash -git clone https://github.com/nextcloud/viewer /var/www/html/apps/viewer -su www-data -c " +su -s /bin/bash www-data -c " +php /var/www/html/occ maintenance:install --database \ + 'sqlite' --admin-user 'admin' --admin-pass 'admin' +export OC_PASS=1234561 +php /var/www/html/occ user:add --password-from-env user1 +php /var/www/html/occ user:add --password-from-env user2 php /var/www/html/occ app:enable viewer php /var/www/html/occ app:enable text php /var/www/html/occ app:list diff --git a/cypress/support/index.js b/cypress/support/e2e.js index d68db96df..d68db96df 100644 --- a/cypress/support/index.js +++ b/cypress/support/e2e.js |