Skip to content

Commit

Permalink
Update CY scripts to run on docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
kelanik8 committed Dec 22, 2023
1 parent 7a5714a commit dac4fb1
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 10 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Test webapps
on:
push:
branches:
- 2023.9.x
- 2023.9.x-feature-e2e
schedule:
- cron: "30 9 * * *"

Expand Down Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ coverage
/workflow
/cypress-docker-images
/cypress/videos/*
/cypress/reports-build
/cypress/screenshots
/cypress/reports
cypress.env.json
.env
7 changes: 7 additions & 0 deletions GETTINGSTARTED.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
8 changes: 8 additions & 0 deletions cypress/e2e/basic-functionalities/admin/user/Create.cy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
/// <reference types="cypress" />
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 + '/')
Expand Down
34 changes: 25 additions & 9 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit dac4fb1

Please sign in to comment.