From c805655cc419ccd3e222ecfb93df99b28ae9136e Mon Sep 17 00:00:00 2001 From: spivakov83 Date: Thu, 9 Oct 2025 20:56:07 +0300 Subject: [PATCH 1/5] feat: add Playwright e2e tests and update CI workflow - Introduced a new job in the CI workflow for running Playwright end-to-end tests. - Added Playwright as a dependency in package.json and package-lock.json. - Created Playwright configuration file for test setup. - Implemented multiple e2e tests covering existing repo entry, landing page interactions, repo scan functionality, stack navigation, and summary generation. - Enhanced various components with data-testid attributes for better test targeting. - Updated existing components to improve accessibility and maintainability. --- .github/workflows/ci-tests.yml | 24 ++++++ app/existing/[repoUrl]/repo-scan-client.tsx | 34 ++++++-- app/existing/existing-repo-entry-client.tsx | 25 +++++- app/new/stack/stack-summary-page.tsx | 15 +++- app/stacks/[stack]/page.tsx | 5 +- app/stacks/page.tsx | 6 +- components/Hero.tsx | 12 ++- components/final-output-view.tsx | 2 + components/instructions-answer-card.tsx | 3 + components/instructions-wizard.tsx | 21 ++++- components/repo-scan-loader.tsx | 1 + components/wizard-answer-grid.tsx | 9 +- components/wizard-completion-summary.tsx | 11 ++- components/wizard-confirmation-dialog.tsx | 11 ++- components/wizard-edit-answer-dialog.tsx | 12 ++- package-lock.json | 64 ++++++++++++++ package.json | 4 +- playwright.config.ts | 35 ++++++++ playwright/tests/existing.spec.ts | 18 ++++ playwright/tests/landing.spec.ts | 22 +++++ playwright/tests/repo-scan.spec.ts | 93 +++++++++++++++++++++ playwright/tests/stacks.spec.ts | 17 ++++ playwright/tests/summary.spec.ts | 26 ++++++ playwright/tests/wizard.spec.ts | 28 +++++++ 24 files changed, 466 insertions(+), 32 deletions(-) create mode 100644 playwright.config.ts create mode 100644 playwright/tests/existing.spec.ts create mode 100644 playwright/tests/landing.spec.ts create mode 100644 playwright/tests/repo-scan.spec.ts create mode 100644 playwright/tests/stacks.spec.ts create mode 100644 playwright/tests/summary.spec.ts create mode 100644 playwright/tests/wizard.spec.ts diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 22030b3..fa12dff 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -26,3 +26,27 @@ jobs: - name: Run unit tests run: npm run test:run + + e2e-tests: + name: Run Playwright e2e tests + runs-on: ubuntu-latest + needs: unit-tests + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Install Playwright browsers + run: npx playwright install --with-deps + + - name: Run e2e tests + run: npm run test:e2e + env: + CI: true diff --git a/app/existing/[repoUrl]/repo-scan-client.tsx b/app/existing/[repoUrl]/repo-scan-client.tsx index 649cdf7..726b22b 100644 --- a/app/existing/[repoUrl]/repo-scan-client.tsx +++ b/app/existing/[repoUrl]/repo-scan-client.tsx @@ -148,7 +148,10 @@ export default function RepoScanClient({ initialRepoUrl }: RepoScanClientProps) }, [scanResult]) return ( -
+
) : promptVisible ? ( -
+

Scan {repoSlug ?? repoUrlForScan}?

We will detect languages, frameworks, tooling, and testing info.

- +
) : isLoading ? (
) : error ? ( -
+
) : scanResult ? ( -
+

Detected snapshot

@@ -291,7 +308,10 @@ export default function RepoScanClient({ initialRepoUrl }: RepoScanClientProps)

) : null} -
+

Raw response

                                         {JSON.stringify(scanResult, null, 2)}
diff --git a/app/existing/existing-repo-entry-client.tsx b/app/existing/existing-repo-entry-client.tsx
index 9aac144..ec785ca 100644
--- a/app/existing/existing-repo-entry-client.tsx
+++ b/app/existing/existing-repo-entry-client.tsx
@@ -34,7 +34,10 @@ export function ExistingRepoEntryClient() {
   }
 
   return (
-    
+