diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml new file mode 100644 index 00000000..e72c072f --- /dev/null +++ b/.github/workflows/playwright.yml @@ -0,0 +1,25 @@ +name: Playwright Tests +on: + pull_request: + branches: [ develop] +jobs: + playwright-test: + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Install dependencies + run: npm ci #equivalent to npm ci + - name: Install Playwright Browsers #install browsers + run: pnpm playwright install --with-deps + - name: Run Playwright tests + run: pnpm playwright test + - uses: actions/upload-artifact@v4 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 diff --git a/.gitignore b/.gitignore index a112a9b0..788ff8b0 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,8 @@ yarn-error.log* *.tsbuildinfo next-env.d.ts -*storybook.log \ No newline at end of file +*storybook.log + +#playwright +/blob-report/ +/playwright/.cache/ diff --git a/README.md b/README.md index 4ad8f520..0a8386c1 100644 --- a/README.md +++ b/README.md @@ -103,3 +103,25 @@ Run Storybook in the project root ``` npm run storybook ``` + +## React Testing Library (RTL) && Jest + +Run RTL && Jest in the project root + +``` +pnpm test +``` + +## Playwright Testing + + +Run all Playwright tests + +``` +pnpm playwright test +``` + +Run single Playwright tests + +``` +pnpm playwright test (name of file) \ No newline at end of file diff --git a/package.json b/package.json index da9c88f2..ff4eba84 100644 --- a/package.json +++ b/package.json @@ -1,57 +1,58 @@ { - "private": true, - "version": "0.1.0", - "scripts": { - "dev": "next dev", - "build": "next build", - "start": "next start", - "test": "jest --passWithNoTests", - "test:watch": "jest --watchAll --passWithNoTests", - "storybook-docs": "storybook dev --docs", - "storybook": "storybook dev -p 6006", - "build-storybook": "storybook build" - }, - "dependencies": { - "@radix-ui/react-slot": "^1.0.2", - "@supabase/ssr": "latest", - "@supabase/supabase-js": "latest", - "autoprefixer": "10.4.15", - "class-variance-authority": "^0.7.0", - "clsx": "^2.1.0", - "geist": "^1.2.2", - "lucide-react": "^0.312.0", - "next": "latest", - "postcss": "8.4.29", - "react": "18.2.0", - "react-dom": "18.2.0", - "tailwind-merge": "^2.2.2", - "tailwindcss": "3.3.3", - "tailwindcss-animate": "^1.0.7", - "typescript": "5.1.3" - }, - "devDependencies": { - "@chromatic-com/storybook": "^1.2.25", - "@storybook/addon-essentials": "^8.0.4", - "@storybook/addon-interactions": "^8.0.4", - "@storybook/addon-links": "^8.0.4", - "@storybook/addon-onboarding": "^8.0.4", - "@storybook/blocks": "^8.0.4", - "@storybook/nextjs": "^8.0.4", - "@storybook/react": "^8.0.4", - "@storybook/test": "^8.0.4", - "@testing-library/jest-dom": "^6.4.2", - "@testing-library/react": "^14.2.2", - "@testing-library/user-event": "^14.5.2", - "@types/jest": "^29.5.12", - "@types/node": "20.3.1", - "@types/react": "18.2.8", - "@types/react-dom": "18.2.5", - "encoding": "^0.1.13", - "jest": "^29.7.0", - "jest-environment-jsdom": "^29.7.0", - "storybook": "^8.0.4", - "ts-jest": "^29.1.2", - "ts-node": "^10.9.2", - "typescript": "5.1.3" - } + "private": true, + "version": "0.1.0", + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "test": "jest --passWithNoTests", + "test:watch": "jest --watchAll --passWithNoTests", + "storybook-docs": "storybook dev --docs", + "storybook": "storybook dev -p 6006", + "build-storybook": "storybook build" + }, + "dependencies": { + "@radix-ui/react-slot": "^1.0.2", + "@supabase/ssr": "latest", + "@supabase/supabase-js": "latest", + "autoprefixer": "10.4.15", + "class-variance-authority": "^0.7.0", + "clsx": "^2.1.0", + "geist": "^1.2.2", + "lucide-react": "^0.312.0", + "next": "latest", + "postcss": "8.4.29", + "react": "18.2.0", + "react-dom": "18.2.0", + "tailwind-merge": "^2.2.2", + "tailwindcss": "3.3.3", + "tailwindcss-animate": "^1.0.7", + "typescript": "5.1.3" + }, + "devDependencies": { + "@chromatic-com/storybook": "^1.2.25", + "@playwright/test": "^1.42.1", + "@storybook/addon-essentials": "^8.0.4", + "@storybook/addon-interactions": "^8.0.4", + "@storybook/addon-links": "^8.0.4", + "@storybook/addon-onboarding": "^8.0.4", + "@storybook/blocks": "^8.0.4", + "@storybook/nextjs": "^8.0.4", + "@storybook/react": "^8.0.4", + "@storybook/test": "^8.0.4", + "@testing-library/jest-dom": "^6.4.2", + "@testing-library/react": "^14.2.2", + "@testing-library/user-event": "^14.5.2", + "@types/jest": "^29.5.12", + "@types/node": "20.3.1", + "@types/react": "18.2.8", + "@types/react-dom": "18.2.5", + "encoding": "^0.1.13", + "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", + "storybook": "^8.0.4", + "ts-jest": "^29.1.2", + "ts-node": "^10.9.2", + "typescript": "5.1.3" + } } diff --git a/playwright-report/index.html b/playwright-report/index.html new file mode 100644 index 00000000..c3ea64de --- /dev/null +++ b/playwright-report/index.html @@ -0,0 +1,68 @@ + + + + +
+ + + +