diff --git a/pagy-on-docker/README.md b/pagy-on-docker/README.md index 9e7577a28..9a80a64f0 100644 --- a/pagy-on-docker/README.md +++ b/pagy-on-docker/README.md @@ -106,13 +106,14 @@ If you determine that you need to run the E2E tests, you can choose different wa 1. Remotely in Github Actions CI: - Just create a PR and all the tests (including the cypress tests) will run on GitHub. Use this option if you don't need to write any js code or tests interactively and the ruby tests pass. 2. Locally on your system: - - With a cypress desktop app that you can [download](https://download.cypress.io/desktop) and manually run from your system. The doc is available on the cypress site and it requires some basic knowledge of cypress to run the tests. - - Or with a full cypress install with all its dependencies that you may or may not have already (e.g. node modules). The doc is available on the cypress site and it requires some basic knowledge of cypress to run the tests. + - With a full cypress install with all its dependencies that you may or may not have already (e.g. node modules). The doc is available on the cypress site and it requires some basic knowledge of cypress to run the tests. 3. Inside docker: - With fully automated testing running the E2E tests in headless mode. It requires building only one container and requires no other knowledge about cypress - Or opening a cypress desktop session from inside the container. It requires a bit of docker setup, but it is a complete installation that avoid polluting your system. -If you need to edit/develop new the E2E tests, you can use one of the previous points #2 or #3. +If you need to edit/develop new E2E tests, you can use one of the previous points: +- the #2 is the easiest to work with but it adds an app and dependencies to your system +- the #3 is a big download, but it is contained in the docker space (i.e. you can remove it completely when you finished without any left-over in your system), but it may miss a few minor features ### Build Pagy Cypress diff --git a/pagy-on-docker/pagy-cypress-uid1000.dockerfile b/pagy-on-docker/pagy-cypress-uid1000.dockerfile index 30cc02d5c..1015ac835 100644 --- a/pagy-on-docker/pagy-cypress-uid1000.dockerfile +++ b/pagy-on-docker/pagy-cypress-uid1000.dockerfile @@ -2,7 +2,8 @@ FROM cypress/included:7.2.0 # the upstram dockerfile already provides a node user with UID 1000 # so we configure the image to run as that user -RUN rm -rf /opt/firefox /usr/bin/firefox \ +RUN apt-get update && apt-get install -y libcanberra-gtk* \ + && rm -rf /opt/firefox /usr/bin/firefox \ && ln -s /root/.cache /home/node/.cache \ && npm install cypress-plugin-snapshots diff --git a/pagy-on-docker/pagy-cypress.dockerfile b/pagy-on-docker/pagy-cypress.dockerfile index a44484d94..2c600f688 100644 --- a/pagy-on-docker/pagy-cypress.dockerfile +++ b/pagy-on-docker/pagy-cypress.dockerfile @@ -7,7 +7,8 @@ ARG gid # configure this image to run as a user identical to your host USER # move test runner binary folder to the user home directory -RUN groupadd -g $gid $user \ +RUN apt-get update && apt-get install -y libcanberra-gtk* \ + && groupadd -g $gid $user \ && useradd -r --no-log-init -u $uid -g $user $group \ && install -d -m 0755 -o $user -g $user /home/$user \ && rm -rf /opt/firefox /usr/bin/firefox \ diff --git a/test/e2e/cypress.json b/test/e2e/cypress.json index 31ae49e25..bb770e181 100644 --- a/test/e2e/cypress.json +++ b/test/e2e/cypress.json @@ -1,4 +1,5 @@ { + "experimentalStudio": true, "ignoreTestFiles": [ "**/__snapshots__/*", "**/__image_snapshots__/*" diff --git a/test/e2e/cypress/integration/__snapshots__/dummy.spec.js.snap b/test/e2e/cypress/integration/__snapshots__/dummy.spec.js.snap index 95ebf62dc..362e939ee 100644 --- a/test/e2e/cypress/integration/__snapshots__/dummy.spec.js.snap +++ b/test/e2e/cypress/integration/__snapshots__/dummy.spec.js.snap @@ -6,3 +6,12 @@ exports[`Dummy Test > toMatchSnapshot - HTML #0`] = ` semantic uikit `; + +exports[`Test Bootstrap > toMatchSnapshot - HTML #0`] = ` +
+`; diff --git a/test/e2e/cypress/integration/__snapshots__/dummy2.spec.js.snap b/test/e2e/cypress/integration/__snapshots__/dummy2.spec.js.snap new file mode 100644 index 000000000..0843ae51e --- /dev/null +++ b/test/e2e/cypress/integration/__snapshots__/dummy2.spec.js.snap @@ -0,0 +1,17 @@ +exports[`Dummy Test > toMatchSnapshot - HTML #0`] = ` + +`; + +exports[`Dummy Test > toMatchSnapshot - HTML #1`] = ` + +`; diff --git a/test/e2e/cypress/integration/bootstrap.spec.js b/test/e2e/cypress/integration/bootstrap.spec.js new file mode 100644 index 000000000..1a60ccd94 --- /dev/null +++ b/test/e2e/cypress/integration/bootstrap.spec.js @@ -0,0 +1,26 @@ +///