Skip to content

Commit

Permalink
feat(functional): Move functional tests to apps/core
Browse files Browse the repository at this point in the history
  • Loading branch information
avattipalli committed Apr 25, 2024
1 parent 984c30c commit 5d1e48e
Show file tree
Hide file tree
Showing 225 changed files with 29 additions and 116 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/playwright-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: Install Playwright Browsers
run: |
cd packages/functional
cd apps/core/tests
npx playwright install --with-deps
- name: Run Playwright tests
Expand All @@ -38,12 +38,12 @@ jobs:
TEST_ACCOUNT_EMAIL: ${{ secrets.TEST_ACCOUNT_EMAIL }}
TEST_ACCOUNT_PASSWORD: ${{ secrets.TEST_ACCOUNT_PASSWORD }}
run: |
cd packages/functional
npx playwright test tests/ui/ --project=tests-chromium
cd apps/core/tests
npx playwright test ui/ --project=tests-chromium
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: packages/functional/playwright-report/
path: apps/core/playwright-report/
retention-days: 30
8 changes: 4 additions & 4 deletions .github/workflows/playwright-visual-regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ jobs:

- name: Install Playwright Browsers
run: |
cd packages/functional
cd apps/core/tests
npx playwright install chromium
- name: Run Playwright tests
env:
PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }}
VERCEL_PROTECTION_BYPASS: ${{ secrets.VERCEL_PROTECTION_BYPASS_STORYBOOK }}
run: |
cd packages/functional
npx playwright test tests/visual-regression/reactant/components/ --project=tests-chromium
cd apps/core/tests
npx playwright test visual-regression/reactant/components/ --project=tests-chromium
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: packages/functional/playwright-report/
path: apps/core/playwright-report/
retention-days: 30
2 changes: 1 addition & 1 deletion apps/core/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const config = {
},
],
},
ignorePatterns: ['client/generated/**/*.ts'],
ignorePatterns: ['client/generated/**/*.ts', 'playwright-report/**', 'test-results/**'],
};

module.exports = config;
3 changes: 3 additions & 0 deletions apps/core/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

# testing
/coverage
/test-results/
/playwright-report/
/playwright/.cache/

# next.js
/.next/
Expand Down
5 changes: 4 additions & 1 deletion apps/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.14",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.5"
"typescript": "^5.4.5",
"@faker-js/faker": "^8.4.1",
"@playwright/test": "^1.43.1",
"dotenv": "^16.4.5"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { config } from 'dotenv';
config();

export default defineConfig({
testDir: './tests',
testDir: './',
expect: {
toHaveScreenshot: { maxDiffPixels: 100 },
},
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion apps/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"**/*.mjs",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
".next/types/**/*.ts",
"tests/**/*"
],
"exclude": [
"node_modules",
Expand Down
2 changes: 1 addition & 1 deletion docs/monorepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ PLAYWRIGHT_TEST_BASE_URL='https://catalyst-demo.site' || 'http://localhost:3000'
2. Navigate to the test directory:

```shell copy
cd packages/functional
cd apps/core
```

3. Run all UI tests in Chromium:
Expand Down
2 changes: 0 additions & 2 deletions packages/functional/.env.example

This file was deleted.

10 changes: 0 additions & 10 deletions packages/functional/.eslintrc.cjs

This file was deleted.

7 changes: 0 additions & 7 deletions packages/functional/CHANGELOG.md

This file was deleted.

21 changes: 0 additions & 21 deletions packages/functional/package.json

This file was deleted.

10 changes: 0 additions & 10 deletions packages/functional/prettier.config.js

This file was deleted.

23 changes: 0 additions & 23 deletions packages/functional/tsconfig.json

This file was deleted.

39 changes: 9 additions & 30 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5d1e48e

Please sign in to comment.