Skip to content

Commit

Permalink
E2e tests reviews (#257)
Browse files Browse the repository at this point in the history
* add publish

* set up for publishing reviews to github pages from github action

* use this branch

* use this branch

* add continue on error

* cd to test directory for adding reviews to git

* don't ignore reviews

* add link to reviews in README

* add badge

* update to 1.35

* assert all haibun deps to 1.35

* sync package-lock

* use BOT_ACCESS_TOKEN

* update out-reviews

* 1.35.5

* e2e on commits to main
  • Loading branch information
vid authored Feb 26, 2024
1 parent 32c0b87 commit bc87e0a
Show file tree
Hide file tree
Showing 7 changed files with 22,462 additions and 3,559 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/e2e-tests-reviews.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: "Haibun e2e tests"

on:
workflow_dispatch:
push:
branches:
- main
pull_request:

permissions:
contents: read
pull-requests: read

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true

jobs:
e2e_test_and_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/checkout@v4
# - uses: fregante/setup-git-user@v2
with:
repository: gctools-outilsgc/gccollab-frontend
token: ${{ secrets.BOT_ACCESS_TOKEN }}
node-version: 18
ref: gh-pages

- name: Set up GitHub Actions bot identity
run: |
git config user.name "github-actions[pat]"
git config user.email "[email protected]"
- name: Merge base branch
run: |
git fetch origin e2e-tests-reviews
git merge --allow-unrelated-histories -X theirs origin/e2e-tests-reviews
- name: Install frontend dependencies
run: npm ci

- name: ng build
run: |
npm start &
sleep 30
- name: wait for it to start (not sure this helps since it fails with a too-short delay)
run: |
npx -y wait-on --log --timeout 30000 http-get://localhost:4200
- name: playwright install
run: |
npx playwright install-deps
npx playwright install
- name: Run tests
continue-on-error: true
run: |
cd haibun-e2e-tests
npm ci
HAIBUN_O_WEBPLAYWRIGHT_HEADLESS=true npm run test
- name: Publish
run: |
cd haibun-e2e-tests
npm run publish
- name: Add reviews
run: |
cd haibun-e2e-tests
git add ./reviews/
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "update e2e test reviews"

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,8 @@ The following describes the testing procedure:
3. Ensure `http://localhost:4200/` is running.
4. Run the tests:
`npm run test`

[![Haibun e2e tests](https://github.com/gctools-outilsgc/gccollab-frontend/actions/workflows/e2e-tests-reviews.yml/badge.svg)](https://github.com/gctools-outilsgc/gccollab-frontend/actions/workflows/e2e-tests-reviews.yml)

E2E test reviews are available [here](https://gctools-outilsgc.github.io/gccollab-frontend/haibun-e2e-tests/reviews/dashboard.html)

5 changes: 3 additions & 2 deletions haibun-e2e-tests/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
"~@haibun/domain-webpage/build/domain-webpage",
"~@haibun/web-playwright/build/web-playwright",
"~@haibun/domain-storage/build/domain-storage",
"~@haibun/web-accessibility-axe/build/a11y-axe-stepper",
"~@haibun/out-review/build/out-reviews-stepper",
"~@haibun/storage-fs/build/storage-fs",
"vars",
"credentials",
"haibun",
"~@haibun/web-accessibility-axe/build/a11y-axe-stepper"
"haibun"
],
"features": {}
}
Loading

0 comments on commit bc87e0a

Please sign in to comment.