Skip to content

Commit

Permalink
updated frontend-tests.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammedMaaz committed Nov 1, 2023
1 parent 83eaa48 commit 58a6d14
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 20 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/frontend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
run: sudo apt install curl -y

- name: Wait for Backend Service
run: sudo bash ./wait_on_api.sh "openapi.json" "{\"openapi\"" 3
run: sudo bash ./wait_on_api.sh "organizations/" "[{\"id\":\"" 3

- name: Set Node.js 18
uses: actions/setup-node@v3
Expand All @@ -28,13 +28,14 @@ jobs:
- name: Cypress run
uses: cypress-io/github-action@v6
with:
browser: firefox
headed: false
wait-on: "http://localhost/apps"
config-file: ${{ github.workspace }}/agenta-web/cypress.config.ts
working-directory: agenta-web
browser: chrome
# working-directory: agenta-web
env:
NEXT_PUBLIC_OPENAI_API_KEY: ${{ secrets.NEXT_PUBLIC_OPENAI_API_KEY }}
DEBUG: "@cypress/github-action"
# DEBUG: cypress:*

- name: Stop Docker Compose
run: docker-compose down
33 changes: 18 additions & 15 deletions agenta-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agenta-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
},
"devDependencies": {
"@types/node": "^20.8.10",
"cypress": "^12.11.0",
"cypress": "^13.4.0",
"node-mocks-http": "^1.12.2",
"prettier": "^3.0.0"
}
Expand Down
2 changes: 2 additions & 0 deletions wait_on_api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ while true; do
startsWith="$2*"

echo "Check if response starts with: $2"
echo "Response is: $response"

if [[ $response == $startsWith ]]; then
echo "API is up!"
break
Expand Down

0 comments on commit 58a6d14

Please sign in to comment.