Skip to content

Commit

Permalink
feat(functional): Move functional tests to apps/core (#816)
Browse files Browse the repository at this point in the history
* feat(functional): Move functional tests to apps/core

* chore: add changeset

* fix: Address review comments
  • Loading branch information
avattipalli committed Apr 25, 2024
1 parent 984c30c commit 7115843
Show file tree
Hide file tree
Showing 226 changed files with 32 additions and 113 deletions.
5 changes: 5 additions & 0 deletions .changeset/big-houses-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bigcommerce/catalyst-core": patch
---

Move functional tests to apps/core
6 changes: 3 additions & 3 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
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
cd apps/core
npx playwright test tests/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
6 changes: 3 additions & 3 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
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
cd apps/core
npx playwright test tests/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
3 changes: 3 additions & 0 deletions apps/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
"devDependencies": {
"@0no-co/graphqlsp": "^1.11.0",
"@bigcommerce/eslint-config-catalyst": "workspace:^",
"@faker-js/faker": "^8.4.1",
"@gql.tada/cli-utils": "^1.2.0",
"@playwright/test": "^1.43.1",
"@tailwindcss/container-queries": "^0.1.1",
"@testing-library/react": "^15.0.2",
"@types/lodash.debounce": "^4.0.7",
Expand All @@ -52,6 +54,7 @@
"@types/react-google-recaptcha": "^2.1.9",
"autoprefixer": "^10.4.19",
"concurrently": "^8.2.2",
"dotenv": "^16.4.5",
"dotenv-cli": "^7.4.1",
"eslint": "^8.57.0",
"eslint-config-next": "14.1.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default defineConfig({
video: 'retain-on-failure',
trace: 'retain-on-failure',
extraHTTPHeaders: {
'x-vercel-protection-bypass': process.env.VERCEL_PROTECTION_BYPASS,
'x-vercel-protection-bypass': process.env.VERCEL_PROTECTION_BYPASS || '',
'x-vercel-set-bypass-cookie': process.env.CI ? 'true' : 'false',
},
},
Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion apps/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@
},
"include": [
"next-env.d.ts",
"playwright.config.ts",
"**/*.cjs",
"**/*.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 7115843

Please sign in to comment.