Skip to content

Commit

Permalink
use script for chrome headless
Browse files Browse the repository at this point in the history
  • Loading branch information
dlachaume committed Jan 30, 2024
1 parent 6b54328 commit 749b9ff
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions .github/workflows/test-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,27 +222,21 @@ jobs:
- name: Run Chrome headless
working-directory: mithril-client-wasm
shell: bash
run: |
/usr/bin/google-chrome --headless --virtual-time-budget=120000 --dump-dom http://localhost:8080 > chrome-results.html
# Handle tests results
if grep -q 'title="FAILED"' chrome-results.html; then
failed_info=$(grep -oE '<div id="[^"]+" title="FAILED">([^<]+)' chrome-results.html | awk 'NR==1 {print substr($0, index($0,$4))}')
echo $failed_info
exit 1
elif grep -q 'title="OK"' chrome-results.html; then
grep -oE '<div id="[^"]+" title="OK">([^<]+)' chrome-results.html | awk '{print substr($0, index($0,$4))}'
echo "Success: all tests passed."
else
cat chrome-results.html
echo "No test results found. Check chrome-results.html output."
exit 1
fi
run: /usr/bin/google-chrome --headless --virtual-time-budget=120000 --dump-dom http://localhost:8080 > chrome-results.html

- name: Analyze Chrome headless test results
working-directory: mithril-client-wasm
shell: bash
run: ./analyze-headless-tests-results.sh chrome-results.html

- name: Run Firefox headless
working-directory: mithril-client-wasm
shell: bash
run: |
pip install selenium
python3 run-firefox-headless.py
./analyze-headless-tests-results.sh firefox-results.html
- name: Analyze Firefox headless test results
working-directory: mithril-client-wasm
shell: bash
run: ./analyze-headless-tests-results.sh firefox-results.html

0 comments on commit 749b9ff

Please sign in to comment.