Skip to content

Commit

Permalink
Setup zango project for e2e testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
DevilsAutumn committed Jul 31, 2024
1 parent eec1d87 commit 50d3cac
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 14 deletions.
46 changes: 33 additions & 13 deletions .github/workflows/e2e-cypress-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: End to End Cypress Test
on:
push:
branches:
- test/cypress
paths:
- "frontend/**"
- zango_setup_for_cypress
# paths:
# - "frontend/**"

jobs:
cypress-run:
Expand All @@ -16,18 +16,38 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

# Step 2: Set up Node.js environment
# Step 2: Set up python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

# Step 3: Set up Zango
- name: Set up Zango project
run: |
python3 setup_project.py
# Step 4: Start up Zango project server
- name: Start Zango project server
run: |
cd zproject
export UID=$(id -u)
export GID=$(id -g)
DOCKER_BUILDKIT=0 docker-compose build
docker-compose up
# Step 5: Set up Node.js environment
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "18"

# Step 3: Install dependencies
- name: Install dependencies
# Step 6: Install dependencies
- name: Install cypress dependencies
run: npm install
working-directory: e2e-tests

# Step 4: Run Cypress tests and record results
# Step 7: Run Cypress tests and record results
- name: Run Cypress tests
uses: cypress-io/[email protected]
with:
Expand All @@ -36,12 +56,12 @@ jobs:
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}

# Step 5: Generate Cucumber HTML Report
# Step 8: Generate Cucumber HTML Report
- name: Generate Cucumber HTML Report
run: node cucumber-html-report.js
working-directory: e2e-tests

# Step 6: Upload Cypress screenshots on failure
# Step 9: Upload Cypress screenshots on failure
- name: Upload Cypress screenshots
uses: actions/upload-artifact@v3
if: failure()
Expand All @@ -50,18 +70,18 @@ jobs:
path: e2e-tests/cypress/screenshots
if-no-files-found: ignore

# Step 7: Upload Cypress videos
# Step 10: Upload Cypress videos
- name: Upload Cypress videos
uses: actions/upload-artifact@v3
with:
name: cypress-videos
path: e2e-tests/cypress/videos
if-no-files-found: ignore

# Step 8: Upload Cucumber HTML Report
# Step 11: Upload Cucumber HTML Report
- name: Upload Cucumber HTML Report
uses: actions/upload-artifact@v3
with:
name: cucumber-html-report
path: e2e-tests/cucumber-html-report.html
if-no-files-found: ignore
if-no-files-found: ignore
2 changes: 1 addition & 1 deletion deploy/dev.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ARG GID
# Update the package list, install sudo, create a non-root user, and grant password-less sudo permissions
RUN apt update && \
apt install -y sudo && \
groupadd -o -g ${GID} -r zango_user && \
groupadd -o -g $GID -r zango_user && \
adduser --uid $UID --gid $GID --disabled-password --gecos "" zango_user && \
echo 'zango_user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers

Expand Down

0 comments on commit 50d3cac

Please sign in to comment.