Skip to content

Commit 5b5044d

Browse files
authored
Merge pull request #190 from asidelnik/32-e2e-testing-setup
32 - Playwright testing setup
2 parents 3169fcb + 881a28f commit 5b5044d

26 files changed

Lines changed: 2371 additions & 103 deletions

File tree

.eslintrc.cjs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ module.exports = {
55
'eslint:recommended',
66
'plugin:@typescript-eslint/recommended',
77
'plugin:react-hooks/recommended',
8-
"plugin:@tanstack/query/recommended"
8+
"plugin:@tanstack/query/recommended",
9+
"plugin:react/recommended",
910
],
1011
ignorePatterns: ['dist', '.eslintrc.cjs'],
1112
parser: '@typescript-eslint/parser',
@@ -15,6 +16,16 @@ module.exports = {
1516
'warn',
1617
{ allowConstantExport: true },
1718
],
18-
'no-console': 'warn'
19+
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
20+
'@typescript-eslint/no-explicit-any': 'warn',
21+
'@typescript-eslint/no-unused-vars': 'warn',
22+
'react/react-in-jsx-scope': 'off',
23+
'react/prop-types': 'off',
1924
},
25+
"overrides": [
26+
{
27+
"files": "tests/**",
28+
"extends": "plugin:playwright/recommended"
29+
}
30+
]
2031
}

.githooks/pre-commit

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
#!/bin/sh
1+
# #!/bin/sh
22

3-
# Run linting
4-
npm run lint
3+
# # Run linting
4+
# npm run lint
55

6-
# Check if linting passed
7-
if [ $? -ne 0 ]; then
8-
echo "Linting failed. Please fix the issues before committing."
9-
exit 1
10-
fi
6+
# # Check if linting passed
7+
# if [ $? -ne 0 ]; then
8+
# echo "Linting failed. Please fix the issues before committing."
9+
# exit 1
10+
# fi
1111

12-
# Run build
13-
npm run build
12+
# # Run build
13+
# npm run build
1414

15-
# Check if build passed
16-
if [ $? -ne 0 ]; then
17-
echo "Build failed. Please fix the issues before committing."
18-
exit 1
19-
fi
15+
# # Check if build passed
16+
# if [ $? -ne 0 ]; then
17+
# echo "Build failed. Please fix the issues before committing."
18+
# exit 1
19+
# fi

.githooks/pre-push

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
3+
# Run linting
4+
npm run lint
5+
6+
# Check if linting passed
7+
if [ $? -ne 0 ]; then
8+
echo "Linting failed. Please fix the issues before pushing."
9+
exit 1
10+
fi
11+
12+
# Run build
13+
npm run build
14+
15+
# Check if build passed
16+
if [ $? -ne 0 ]; then
17+
echo "Build failed. Please fix the issues before pushing."
18+
exit 1
19+
fi

.github/workflows/playwright.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Playwright Tests
2+
on:
3+
push:
4+
branches: [ main, master ]
5+
pull_request:
6+
branches: [ main, master ]
7+
jobs:
8+
test:
9+
timeout-minutes: 60
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: lts/*
16+
- name: Install dependencies
17+
run: npm ci
18+
- name: Install Playwright Browsers
19+
run: npx playwright install --with-deps
20+
- name: Run Playwright tests
21+
run: npx playwright test
22+
- uses: actions/upload-artifact@v4
23+
if: ${{ !cancelled() }}
24+
with:
25+
name: playwright-report
26+
path: playwright-report/
27+
retention-days: 30

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,8 @@ src/**/*.css
3232
!src/**/index.css
3333
src/**/*.css.map
3434

35+
# Playwright
36+
/test-results/
37+
/playwright-report/
38+
/blob-report/
39+
/playwright/.cache/

0 commit comments

Comments
 (0)