From e6018f3a378abdf33cd9c239c8923963cf8a00d6 Mon Sep 17 00:00:00 2001 From: parsa aghaei Date: Tue, 25 Aug 2026 17:10:53 +0330 Subject: [PATCH] test(e2e): complete and verify 11 E2E test suites with strict mutation testing and CI integration --- .gitea/workflows/e2e.yml | 45 ++++++ frontend/admin-panel/src/pages/B2BManager.tsx | 2 + frontend/admin-panel/src/pages/Blogs.tsx | 3 +- frontend/admin-panel/src/pages/Orders.tsx | 1 + .../application/components/ArchivePage.tsx | 20 ++- frontend/application/components/AuthModal.tsx | 1 + .../application/components/CartDrawer.tsx | 20 ++- frontend/application/components/Header.tsx | 2 + .../application/components/ProductPage.tsx | 4 + playwright.config.ts | 4 +- test-coverage-map.md | 40 ++++- tests/e2e/admin/admin-b2b-submissions.spec.ts | 44 ++++- tests/e2e/admin/admin-blogs-crud.spec.ts | 36 ++++- tests/e2e/admin/admin-orders-flow.spec.ts | 27 ++-- tests/e2e/admin/admin-rbac-roles.spec.ts | 109 +++++++++++++ tests/e2e/security/xss-ratelimit.spec.ts | 110 +++++++++++++ .../e2e/storefront/auth-otp-recovery.spec.ts | 109 +++++++++++++ tests/e2e/storefront/cart-operations.spec.ts | 65 ++++++-- .../e2e/storefront/concurrency-stock.spec.ts | 150 ++++++++++++++++++ .../storefront/error-pages-404-500.spec.ts | 22 +++ .../e2e/storefront/shop-filter-search.spec.ts | 15 +- 21 files changed, 771 insertions(+), 58 deletions(-) create mode 100644 .gitea/workflows/e2e.yml create mode 100644 tests/e2e/admin/admin-rbac-roles.spec.ts create mode 100644 tests/e2e/security/xss-ratelimit.spec.ts create mode 100644 tests/e2e/storefront/auth-otp-recovery.spec.ts create mode 100644 tests/e2e/storefront/concurrency-stock.spec.ts create mode 100644 tests/e2e/storefront/error-pages-404-500.spec.ts diff --git a/.gitea/workflows/e2e.yml b/.gitea/workflows/e2e.yml new file mode 100644 index 0000000..42d6acd --- /dev/null +++ b/.gitea/workflows/e2e.yml @@ -0,0 +1,45 @@ +name: E2E Playwright Tests + +on: + push: + branches: + - main + - develop + pull_request: + branches: + - main + - develop + +jobs: + test-e2e: + name: Run Full E2E & Security Suites + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + + - name: Install Monorepo Dependencies + run: npm ci + + - name: Install Playwright Browsers + run: npx playwright install --with-deps chromium + + - name: Run E2E Test Suite + run: npx playwright test --project=chromium-desktop --project=admin-chromium + env: + CI: true + NODE_ENV: test + + - name: Upload Test Report + if: always() + uses: actions/upload-artifact@v4 + with: + name: playwright-report + path: playwright-report/ + retention-days: 14 diff --git a/frontend/admin-panel/src/pages/B2BManager.tsx b/frontend/admin-panel/src/pages/B2BManager.tsx index 3764bfd..abb2f2e 100644 --- a/frontend/admin-panel/src/pages/B2BManager.tsx +++ b/frontend/admin-panel/src/pages/B2BManager.tsx @@ -169,6 +169,7 @@ export default function B2BManager() { {/* Tab Toggle */}
-
@@ -794,6 +794,7 @@ export default function Blogs() {
- {toPersian(item.quantity)} + {toPersian(item.quantity)}
) : (product.packageSize || 0) <= 0 ? ( ) : (