Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(core): set up playwright component tests #4128

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {

Check warning on line 1 in .eslintrc.js

View workflow job for this annotation

GitHub Actions / lint

Expected "export" or "export default"
extends: '@digabi/eslint-config',
parserOptions: {
project: ['./packages/*/tsconfig.json', './packages/*/__tests__/tsconfig.json']
project: ['./packages/*/tsconfig.json', './packages/*/__tests__/tsconfig.json', 'tsconfig.eslint.json']
},
ignorePatterns: ['packages/*/dist', '**/node_modules', '**/main-bundle.js']
}
17 changes: 17 additions & 0 deletions .github/actions/node-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Node.js Setup
description: Sets up Node.js and installs dependencies.

runs:
using: composite
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install Dependencies
shell: bash
run: npm ci
40 changes: 24 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,53 @@ on:
- feature/*

jobs:
test:
jest-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install nodejs
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Node.js Setup
uses: ./.github/actions/node-setup

- name: Restore puppeteer cache
uses: actions/cache@v4
with:
path: ~/.cache/puppeteer
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}

- run: npm ci
- run: npm rebuild full-icu
- run: npm run test --ci --runInBand

- name: Run Jest Tests
run: npm run test-jest -- --ci

lint:
playwright-component-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Node.js Setup
uses: ./.github/actions/node-setup

- name: Install nodejs
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install Playwright Browsers
run: npx playwright install --with-deps

- name: Run Playwright Component Tests
run: CI=true npm run test-ct

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Node.js Setup
uses: ./.github/actions/node-setup

- name: Restore puppeteer cache
uses: actions/cache@v4
with:
path: ~/.cache/puppeteer
key: ${{ runner.os }}-${{ hashFiles('package-lock.json') }}

- run: npm ci
- name: "run linter"
env:
NODE_OPTIONS: "--max_old_space_size=4096"
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,9 @@ eslint3.xml

# Webpack bundle stats
packages/core/stats.json

# Playwright
**/test-results/
**/playwright-report/
**/blob-report/
**/playwright/**/.cache/
1 change: 1 addition & 0 deletions jest.base.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {

Check warning on line 1 in jest.base.config.js

View workflow job for this annotation

GitHub Actions / lint

Expected "export" or "export default"
reporters: ['default', ['jest-junit', { outputName: 'jest-report.xml' }]],
snapshotSerializers: ['jest-snapshot-serializer-raw'],
testPathIgnorePatterns: ['<rootDir>/__tests__/playwright/'],
testMatch: ['<rootDir>/__tests__/**/test*.ts?(x)', '<rootDir>/__tests__/**/*.test.ts?(x)'],
transform: {
'^.+\\.(ts|tsx)$': ['@swc-node/jest'],
Expand Down
Loading
Loading