-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (57 loc) · 1.92 KB
/
Playwright.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Playwright Tests for Digital Research Books
on:
workflow_call:
inputs:
base_url:
description: "Base URL for environment"
default: "http://local.nypl.org:3000/"
required: false
type: string
pull_request:
jobs:
tests:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Set environment for branch
run: |
if [[ github.event.inputs.base_url != '' ]]; then
echo "BASE_URL=${{ github.event.inputs.base_url }}" >> "$GITHUB_ENV"
else
echo "BASE_URL=http://local.nypl.org:3000/" >> "$GITHUB_ENV"
fi
- name: Add hosts to /etc/hosts
if: github.event_name == 'pull_request'
run: |
sudo echo "127.0.0.1 local.nypl.org" | sudo tee -a /etc/hosts
- name: Install Test Dependencies
run: npm i @playwright/test@1.49.1
- name: Install Playwright
run: npx playwright install --with-deps
- name: Build app
run: NODE_ENV=test npm run build
- name: Start the app
if: github.event_name == 'pull_request'
run: |
NODE_ENV=test npm start &
sleep 5
shell: bash
- name: Run your tests
run: npm run playwright
env:
CATALOG_USERNAME: ${{ secrets.CATALOG_USERNAME }}
CATALOG_USER_PIN: ${{ secrets.CATALOG_USER_PIN }}
- name: Slack Notification
if: ${{ always() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: test_reports
SLACK_MESSAGE: https://reports.cucumber.io/report-collections/01dbd6e8-653b-4597-b901-6caf2e653b07
SLACK_TITLE: DRB Cucumber/Playwright Test Results
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: nyplorgBot