forked from sigstore/rekor-search-ui
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(e2e): enable running e2e tests with docker
fix: update rekor endpoint string fix(ci): error about deprecated husky install command ci(e2e): add headless configuration in docker compose test(e2e): include volumes for test artifacts ci(e2e): add e2e github workflow
- Loading branch information
Showing
7 changed files
with
177 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: cross browser end-to-end testing 🚀 | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
pull_request: | ||
types: [opened, reopened] | ||
schedule: | ||
- cron: '0 2 * * FRI' | ||
|
||
jobs: | ||
cypress-run: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- name: Checkout 🛎 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run docker-compose 🐳 | ||
run: docker-compose up -d e2e-electron | ||
|
||
- name: Wait for services to start ⏱️ | ||
run: docker-compose logs -f | ||
|
||
- name: Upload Electron artifacts 📸 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: electron-artifacts | ||
path: | | ||
./artifacts/electron/videos | ||
./artifacts/electron/screenshots | ||
if-no-files-found: ignore | ||
retention-days: 5 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM cypress/browsers:node-20.13.0-chrome-124.0.6367.155-1-ff-125.0.3-edge-124.0.2478.80-1 | ||
ARG NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN | ||
ENV NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN=${NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN} | ||
|
||
WORKDIR /e2e | ||
|
||
COPY ./package.json . | ||
COPY ./package-lock.json . | ||
COPY ./cypress.config.ts . | ||
COPY ./cypress ./cypress | ||
|
||
RUN npm install | ||
|
||
RUN npx cypress install | ||
|
||
ENTRYPOINT ["npx", "cypress", "run"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": "./", | ||
"target": "es5", | ||
"lib": ["es5", "dom"], | ||
"types": ["cypress", "node"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
services: | ||
nextjs: | ||
build: . | ||
ports: | ||
- "3000:3000" | ||
volumes: | ||
- .:/app | ||
- /app/node_modules | ||
command: npm start | ||
environment: | ||
- NODE_ENV=production | ||
- NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN=https://rekor.sigstore.dev | ||
|
||
cypress: | ||
build: | ||
context: . | ||
dockerfile: cypress.Dockerfile | ||
args: | ||
NEXT_PUBLIC_REKOR_DEFAULT_DOMAIN: https://rekor.sigstore.dev | ||
depends_on: | ||
- nextjs | ||
volumes: | ||
# set mappings to access artifacts outside of containers | ||
- ./artifacts/electron/videos:/e2e/cypress/videos | ||
- ./artifacts/electron/screenshots:/e2e/cypress/screenshots | ||
environment: | ||
- CYPRESS_BASE_URL=http://nextjs:3000 | ||
# run electron in headless mode | ||
command: npx cypress run |
Oops, something went wrong.