Merge pull request #6599 from duplicati/feature/add-playwright-tests
Initial version of a PlayWright test using ngclient
This commit is contained in:
@@ -77,10 +77,64 @@ jobs:
|
||||
files: ${{ github.workspace }}/TestResults/integration/**/coverage.cobertura.xml
|
||||
flags: integration,${{ matrix.os }}
|
||||
|
||||
# Disabled, as a new test needs to be written for the new UI
|
||||
# selenium:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - name: Selenium
|
||||
# run: pipeline/selenium/test.sh
|
||||
playwright_tests:
|
||||
name: Playwright UI tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 8.x
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install NPM dependencies
|
||||
run: npm ci
|
||||
- name: Install Playwright browsers
|
||||
run: npx playwright install --with-deps
|
||||
- name: Publish Duplicati server
|
||||
run: dotnet publish -c Debug -o published Duplicati.sln
|
||||
- name: Start server
|
||||
run: |
|
||||
./published/Duplicati.Server --disable-database-encryption --webservice-password=easy1234 > server.log 2>&1 &
|
||||
SERVER_PID=$!
|
||||
echo "SERVER_PID=$SERVER_PID" >> $GITHUB_ENV
|
||||
timeout 30 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/127.0.0.1/8200; do sleep 1; echo waiting; done'
|
||||
echo "Server started with PID: $SERVER_PID"
|
||||
- name: Load web UI
|
||||
run: |
|
||||
curl -f http://localhost:8200/ngclient/index.html
|
||||
echo "Web UI loaded successfully"
|
||||
- name: Check server status
|
||||
run: |
|
||||
echo "Server process status:"
|
||||
ps aux | grep Duplicati.Server || true
|
||||
echo "Server log (last 50 lines):"
|
||||
tail -n 50 server.log || true
|
||||
- name: Run Playwright tests
|
||||
run: npx playwright test --reporter=list,html,github
|
||||
|
||||
- name: Capture server logs on failure
|
||||
if: failure()
|
||||
run: |
|
||||
echo "=== Full Server Log ==="
|
||||
cat server.log || echo "No server log found"
|
||||
|
||||
- name: Upload Playwright test results on failure
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: playwright-test-results
|
||||
path: |
|
||||
test-results/
|
||||
playwright-report/
|
||||
server.log
|
||||
retention-days: 7
|
||||
|
||||
- name: Upload Playwright HTML report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: playwright-html-report
|
||||
path: playwright-report/
|
||||
retention-days: 7
|
||||
|
||||
Reference in New Issue
Block a user