Skip to content

Commit 0c19ce7

Browse files
Copilotrenemadsen
andcommitted
Add application readiness check before WDIO tests
Co-authored-by: renemadsen <[email protected]>
1 parent 83ffd68 commit 0c19ce7

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

.github/workflows/dotnet-core-master.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,22 @@ jobs:
9595
config-file: cypress.config.ts
9696
working-directory: eform-client
9797
command-prefix: "--"
98+
- name: Wait for application to be ready
99+
run: |
100+
echo "Waiting for application at http://localhost:4200 to be ready..."
101+
for i in {1..60}; do
102+
if curl -f -s http://localhost:4200 >/dev/null; then
103+
echo "Application is ready!"
104+
break
105+
fi
106+
echo "Waiting for application... ($i/60)"
107+
sleep 2
108+
done
109+
# Final check
110+
if ! curl -f -s http://localhost:4200 >/dev/null; then
111+
echo "Application failed to start within 120 seconds"
112+
exit 1
113+
fi
98114
- name: testheadless2${{matrix.test}}
99115
run: cd eform-client && npm run testheadless2${{matrix.test}}
100116
- name: Stop the newly build Docker container

.github/workflows/dotnet-core-pr.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,22 @@ jobs:
9696
config-file: cypress.config.ts
9797
working-directory: eform-client
9898
command-prefix: "--"
99+
- name: Wait for application to be ready
100+
run: |
101+
echo "Waiting for application at http://localhost:4200 to be ready..."
102+
for i in {1..60}; do
103+
if curl -f -s http://localhost:4200 >/dev/null; then
104+
echo "Application is ready!"
105+
break
106+
fi
107+
echo "Waiting for application... ($i/60)"
108+
sleep 2
109+
done
110+
# Final check
111+
if ! curl -f -s http://localhost:4200 >/dev/null; then
112+
echo "Application failed to start within 120 seconds"
113+
exit 1
114+
fi
99115
- name: testheadless2${{matrix.test}}
100116
run: cd eform-client && npm run testheadless2${{matrix.test}}
101117
- name: Stop the newly build Docker container

0 commit comments

Comments
 (0)