diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b8fbec4..17d891d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ name: Test webapps on: push: branches: - - 2023.9.x + - 2023.9.x-feature-e2e schedule: - cron: "30 9 * * *" @@ -34,6 +34,12 @@ jobs: FEDERATION_LABEL: 'Corteza e2e federation host' steps: + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + with: + limit-access-to-actor: true + detached: true + - name: Checkout uses: actions/checkout@v3 diff --git a/.gitignore b/.gitignore index c3164b4..7439c7c 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,8 @@ coverage /workflow /cypress-docker-images /cypress/videos/* +/cypress/reports-build +/cypress/screenshots /cypress/reports cypress.env.json .env diff --git a/GETTINGSTARTED.adoc b/GETTINGSTARTED.adoc index 74504f8..16d510b 100644 --- a/GETTINGSTARTED.adoc +++ b/GETTINGSTARTED.adoc @@ -97,6 +97,13 @@ The host configuration should be specified either via `cypress.env.json` or by e Refer to the `.env.example` file for an idea. ==== +=== Pull Images + +[source,bash] +---- +$ docker-compose pull +---- + === Run headless [source,bash] diff --git a/cypress/e2e/basic-functionalities/admin/user/Create.cy.js b/cypress/e2e/basic-functionalities/admin/user/Create.cy.js index 72813ed..f1eb771 100644 --- a/cypress/e2e/basic-functionalities/admin/user/Create.cy.js +++ b/cypress/e2e/basic-functionalities/admin/user/Create.cy.js @@ -1,7 +1,15 @@ /// const adminURL = Cypress.env('ADMIN_URL') +const email = Cypress.env('USER_EMAIL') +const password = Cypress.env('USER_PASSWORD') describe('Test for creating a user', () => { + before(() => { + if (!window.sessionStorage.getItem('auth.refresh-token')) { + cy.login({ email, password, url: adminURL }) + } + }) + context('Test for creating a user without any data entered or misconfigured field', () => { it('should not be able to create a user without any info entered', () => { cy.visit(adminURL + '/') diff --git a/docker-compose.yaml b/docker-compose.yaml index 8fb4ead..519a882 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,21 +1,37 @@ -version: '3.2' +version: "3.2" services: corteza: - image: cortezaproject/corteza:${CORTEZA_VERSION} + image: cortezaproject/corteza:2023.3.4 environment: DOMAIN: corteza cypress: - image: cypress/included:${CYPRESS_VERSION} - depends_on: [ corteza ] + image: cypress/included:13.5.0 + environment: + - CYPRESS_HOST=${CYPRESS_HOST} + - CYPRESS_BASE_URL=${CYPRESS_BASE_URL} + - CYPRESS_ADMIN_URL=${CYPRESS_ADMIN_URL} + - CYPRESS_COMPOSE_URL=${CYPRESS_COMPOSE_URL} + - CYPRESS_WORKFLOW_URL=${CYPRESS_WORKFLOW_URL} + - CYPRESS_REPORTER_URL=${CYPRESS_REPORTER_URL} + - CYPRESS_ONE_URL=${CYPRESS_ONE_URL} + - CYPRESS_PRIVACY_URL=${CYPRESS_PRIVACY_URL} + - CYPRESS_USER_EMAIL=${CYPRESS_USER_EMAIL} + - CYPRESS_USER_EMAIL_NEW=${CYPRESS_USER_EMAIL_NEW} + - CYPRESS_USER_PASSWORD=${CYPRESS_USER_PASSWORD} + - CYPRESS_USER_PASSWORD_NEW=${CYPRESS_USER_PASSWORD_NEW} + - CYPRESS_USER_DPO=${CYPRESS_USER_DPO} + - CYPRESS_USER_DPO_PASSWORD=${CYPRESS_USER_DPO_PASSWORD} + # depends_on: [ corteza ] + network_mode: host ipc: host # does not work in docker without it - working_dir: /e2e + working_dir: /e2e #entrypoint: "cypress run --spec cypress/integration/basic-functionalities/admin/user/index.js" volumes: - ./:/e2e mailhog: - image: mailhog/mailhog:latest - ports: - - 8025:8025 - - 1025:1025 + image: mailhog/mailhog:latest + ports: + - 8025:8025 + - 1025:1025