mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
test: Add BDD UI tests using Playwright (#911)
This commit is contained in:
parent
4efc3be8d5
commit
096feb35bb
17 changed files with 1260 additions and 120 deletions
73
.github/workflows/build-and-test.yml
vendored
Normal file
73
.github/workflows/build-and-test.yml
vendored
Normal file
|
@ -0,0 +1,73 @@
|
|||
name: Build and test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
POSTGRES_DB: planka_db
|
||||
POSTGRES_USER: user
|
||||
POSTGRES_PASSWORD: password
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 18
|
||||
cache: 'npm'
|
||||
|
||||
- name: Setup PostgreSQL
|
||||
uses: ikalnytskyi/action-setup-postgres@v5
|
||||
with:
|
||||
database: ${{ env.POSTGRES_DB }}
|
||||
username: ${{ env.POSTGRES_USER }}
|
||||
password: ${{ env.POSTGRES_PASSWORD }}
|
||||
|
||||
- name: Cache Node.js modules
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: client/node_modules
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm install
|
||||
cd client
|
||||
npm run build
|
||||
|
||||
- name: Setup server
|
||||
env:
|
||||
DEFAULT_ADMIN_EMAIL: demo@demo.demo
|
||||
DEFAULT_ADMIN_PASSWORD: demo
|
||||
DEFAULT_ADMIN_NAME: Demo Demo
|
||||
DEFAULT_ADMIN_USERNAME: demo
|
||||
run: |
|
||||
client/tests/setup-symlinks.sh
|
||||
cd server
|
||||
cp .env.sample .env
|
||||
sed -i "s|^DATABASE_URL=.*|DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost/${POSTGRES_DB}|" .env
|
||||
npm run db:init
|
||||
npm start --prod &
|
||||
|
||||
- name: Wait for development server
|
||||
run: |
|
||||
sudo apt-get install wait-for-it -y
|
||||
wait-for-it -h localhost -p 1337 -t 10
|
||||
|
||||
- name: Run UI tests
|
||||
run: |
|
||||
cd client
|
||||
npm install
|
||||
npx playwright install chromium
|
||||
npm run test:acceptance tests
|
Loading…
Add table
Add a link
Reference in a new issue