Skip to content

🧪 E2E#817

Open
Corantin wants to merge 42 commits intodevfrom
e2e
Open

🧪 E2E#817
Corantin wants to merge 42 commits intodevfrom
e2e

Conversation

@Corantin
Copy link
Contributor

No description provided.

Corantin and others added 14 commits July 31, 2025 02:09
Improves end-to-end testing coverage by adding tests for community features:

- Adds a new E2E test case to simulate joining and leaving a community.
- Introduces helper functions for Metamask interactions, such as approving token allowances and confirming transactions.
- Adds test IDs to modal components for easier selection in tests.
- Updates Synpress cache building.
Adds an end-to-end test to verify the community join and leave flow.

- Tests user's ability to join a community.
- Tests user's ability to leave a community.
- Improves reliability by retrying network requests.
Stake in pool done
Split scripts to join, stake, create et leave
Copilot AI review requested due to automatic review settings February 20, 2026 04:13
@vercel
Copy link

vercel bot commented Feb 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gardens-v2 Ready Ready Preview, Comment Mar 5, 2026 8:14am

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds E2E-focused changes to improve Playwright setup and testability, primarily by installing Chromium automatically and adding stable data-testid hooks across UI components.

Changes:

  • Adds postinstall to install Playwright Chromium for the e2e package and updates workspace/submodule configuration.
  • Introduces testId / data-testid props across core UI primitives (Button, Modal, Card, inputs) and key flows.
  • Disables Divvi tracking during E2E runs via env flag gating.

Reviewed changes

Copilot reviewed 55 out of 1370 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/trusted_vault.pb Adds cached Chromium profile artifact (appears auto-generated).
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/shared_proto_db/metadata/LOG Adds auto-generated LevelDB log for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/shared_proto_db/metadata/CURRENT Adds auto-generated LevelDB pointer file for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/shared_proto_db/LOG Adds auto-generated LevelDB log for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/shared_proto_db/CURRENT Adds auto-generated LevelDB pointer file for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/TransportSecurity Adds Chromium transport security state (auto-generated/user-specific).
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Sync Data/LevelDB/LOG Adds auto-generated sync LevelDB log for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Sync Data/LevelDB/CURRENT Adds auto-generated sync LevelDB pointer for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Site Characteristics Database/LOG Adds auto-generated site DB log for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Site Characteristics Database/CURRENT Adds auto-generated site DB pointer for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Session Storage/LOG Adds auto-generated session storage DB log for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Session Storage/CURRENT Adds auto-generated session storage DB pointer for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Service Worker/Database/LOG Adds auto-generated service worker DB log for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Service Worker/Database/CURRENT Adds auto-generated service worker DB pointer for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Secure Preferences Adds Chromium secure prefs store (auto-generated; may contain sensitive material).
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/SCT Auditing Pending Reports Adds Chromium SCT reports state (auto-generated).
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/README Adds Chromium warning README (auto-generated).
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/PreferredApps Adds Chromium preferred apps state (auto-generated).
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Preferences Adds Chromium preferences blob (auto-generated/user-specific).
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Network Persistent State Adds Chromium network state (auto-generated; contains hosts).
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Local Storage/leveldb/LOG Adds auto-generated local storage LevelDB log for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Local Storage/leveldb/CURRENT Adds auto-generated local storage LevelDB pointer for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Local Extension Settings/aamooionifmiheekljcigeanlapnjfle/LOG Adds auto-generated extension settings LevelDB log for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Local Extension Settings/aamooionifmiheekljcigeanlapnjfle/CURRENT Adds auto-generated extension settings LevelDB pointer for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/IndexedDB/chrome-extension_aamooionifmiheekljcigeanlapnjfle_0.indexeddb.leveldb/LOG Adds auto-generated extension IndexedDB LevelDB log for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/IndexedDB/chrome-extension_aamooionifmiheekljcigeanlapnjfle_0.indexeddb.leveldb/CURRENT Adds auto-generated extension IndexedDB LevelDB pointer for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/GCM Store/Encryption/LOG Adds auto-generated GCM encryption store LevelDB log for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/GCM Store/Encryption/CURRENT Adds auto-generated GCM encryption store LevelDB pointer for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Extension State/LOG Adds auto-generated extension state LevelDB log for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Extension State/CURRENT Adds auto-generated extension state LevelDB pointer for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Extension Scripts/LOG Adds auto-generated extension scripts LevelDB log for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Extension Scripts/CURRENT Adds auto-generated extension scripts LevelDB pointer for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Extension Rules/LOG Adds auto-generated extension rules LevelDB log for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/Extension Rules/CURRENT Adds auto-generated extension rules LevelDB pointer for Chromium profile cache.
pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/BrowsingTopicsState Adds Chromium browsing topics state (auto-generated/user-specific).
package.json Adds postinstall to install Playwright Chromium in the e2e package.
lib/allo-v2 Updates the allo-v2 git submodule pointer.
gardens-v2.code-workspace Adds Services and E2E folders to the VS Code workspace.
apps/web/hooks/useTransactionNotification.tsx Removes trailing whitespace line at file end.
apps/web/hooks/useContractWriteWithConfirmations.ts Gates Divvi tracking during E2E and adjusts dataSuffix typing/construction.
apps/web/components/TransactionStatusNotification.tsx Adds data-testid to the notification root to aid E2E selection.
apps/web/components/TransactionModal.tsx Adds testId passthrough into Modal for test selectors.
apps/web/components/RegisterMember.tsx Adds stable testId hooks for modal and action button.
apps/web/components/Modal.tsx Adds testId support and uses it to set close/backdrop data-testids.
apps/web/components/MarkdownEditor.tsx Adds testId prop and sets data-testid on editor shell.
apps/web/components/IncreasePower.tsx Adds test selectors for stake input and stake/unstake button.
apps/web/components/Forms/PoolForm.tsx Adds test selectors for pool form inputs and submit/preview buttons.
apps/web/components/Forms/FormInput.tsx Adds testId prop and forwards to input/textarea/MarkdownEditor.
apps/web/components/Forms/FormAddressInput.tsx Adds testId prop and forwards into the underlying input component.
apps/web/components/ConnectWalletButton.tsx Adds test selectors for connect/account/wrong-network and switch button.
apps/web/components/CommunityCard.tsx Adds a deterministic testId to each community card.
apps/web/components/Card.tsx Adds testId prop and forwards to data-testid.
apps/web/components/Button.tsx Adds testId prop and sets data-testid on the <button>.
apps/web/app/(app)/gardens/[chain]/[garden]/[community]/client-page.tsx Adds a test selector for create button; removes RegisterMember rendering block.
apps/web/.vscode/launch.json Adds an absolute local runtimeExecutable path to Node.
Comments suppressed due to low confidence (7)

apps/web/components/Modal.tsx:94

  • Because testId is optional, these interpolations can render data-testid=\"modal-close-button-undefined\" / modal-close-backdrop-undefined and create collisions across different modals. Prefer only setting these data-testid attributes when testId is provided (or provide a safe default like omitting the suffix entirely).
            <button
              onClick={handleClose}
              className="h-7 w-7 cursor-pointer"
              data-testid={`modal-close-button-${testId}`}
            >

apps/web/components/Modal.tsx:110

  • Because testId is optional, these interpolations can render data-testid=\"modal-close-button-undefined\" / modal-close-backdrop-undefined and create collisions across different modals. Prefer only setting these data-testid attributes when testId is provided (or provide a safe default like omitting the suffix entirely).
        <button data-testid={`modal-close-backdrop-${testId}`}>close</button>

apps/web/components/Button.tsx:143

  • Defaulting every button to data-testid=\"button\" will produce many duplicate test IDs on a page, which makes selectors brittle and can break E2E tests. Prefer omitting data-testid when testId is not provided (or use another strategy that doesn't create duplicates by default).
      data-testid={testId ?? "button"}

apps/web/.vscode/launch.json:3

  • This is a machine-specific absolute path that will not work for other developers/CI. Recommend removing it from the committed config, or replacing it with a portable setting (e.g., rely on PATH, or use a workspace-relative variable) and/or documenting local overrides in an untracked file.
  "runtimeExecutable": "/home/corantin/.nvm/versions/node/v18.20.4/bin/node",

package.json:16

  • Running playwright install chromium on every root postinstall can significantly slow installs for contributors/CI that don't need E2E, and may cause unexpected network/dependency behavior. Consider making this opt-in (e.g., a dedicated script), or moving it into the pkg/e2e package lifecycle so it only runs when that package is installed/used.
    "build:docs": "turbo run build --filter=docs...",
    "postinstall": "pnpm --filter e2e exec playwright install chromium"

apps/web/hooks/useContractWriteWithConfirmations.ts:40

  • In client-side code, process.env.E2E won’t be available unless explicitly inlined by the build system, which can make the flag confusing; prefer relying only on a NEXT_PUBLIC_* variable for browser bundles. Also, the template-literal cast can mask runtime formatting issues (e.g., if getDataSuffix() already includes 0x); consider updating getDataSuffix to return a 0x${string}-typed value directly and avoid string-prefixing/casting here.
const IS_E2E =
  process.env.NEXT_PUBLIC_E2E === "true" || process.env.E2E === "true";

apps/web/hooks/useContractWriteWithConfirmations.ts:108

  • In client-side code, process.env.E2E won’t be available unless explicitly inlined by the build system, which can make the flag confusing; prefer relying only on a NEXT_PUBLIC_* variable for browser bundles. Also, the template-literal cast can mask runtime formatting issues (e.g., if getDataSuffix() already includes 0x); consider updating getDataSuffix to return a 0x${string}-typed value directly and avoid string-prefixing/casting here.
      shouldDivviTrack
        ? (`0x${getDataSuffix({
            consumer: DIVVI_CONSUMER as Address,
            providers: DIVVI_PROVIDERS as Address[],
          })}` as `0x${string}`)
        : undefined,

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1 @@
{"protection":{"super_mac":"B613679A0814D9EC772F95D778C35FC5FF1697C493715653C6C712144292C5AD"}} No newline at end of file
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (and the other committed pkg/e2e/.cache-synpress/** Chromium profile/cache files) appears to be auto-generated, user/machine-specific browser state and may contain sensitive material (keys/identifiers, network state, extension data). Recommend removing these artifacts from version control and adding pkg/e2e/.cache-synpress/ (or the specific cache directory used by synpress) to .gitignore; generate or download any needed Playwright/Synpress state during CI or test setup instead.

Suggested change
{"protection":{"super_mac":"B613679A0814D9EC772F95D778C35FC5FF1697C493715653C6C712144292C5AD"}}
{}

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +2
2025/07/30-22:54:39.055 40b18 Creating DB /home/corantin/Documents/GitHub/gardens-v2/main/pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/shared_proto_db since it was missing.
2025/07/30-22:54:39.060 40b18 Reusing MANIFEST /home/corantin/Documents/GitHub/gardens-v2/main/pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/shared_proto_db/MANIFEST-000001
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These committed LevelDB LOG/CURRENT files are generated runtime artifacts and also leak absolute local filesystem paths. They will create noisy diffs and are unlikely to be portable across machines/CI. Recommend deleting them from the repo and ignoring the entire generated DB/cache tree.

Suggested change
2025/07/30-22:54:39.055 40b18 Creating DB /home/corantin/Documents/GitHub/gardens-v2/main/pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/shared_proto_db since it was missing.
2025/07/30-22:54:39.060 40b18 Reusing MANIFEST /home/corantin/Documents/GitHub/gardens-v2/main/pkg/e2e/.cache-synpress/532f685e346606c2a803/Default/shared_proto_db/MANIFEST-000001
# Placeholder LevelDB LOG file for shared_proto_db.
# This file is a generated runtime artifact and should not contain machine-specific paths or timestamps.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

@Corantin Corantin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore .cache-synpress

Copilot AI and others added 3 commits February 20, 2026 04:21
Co-authored-by: Corantin <13890618+Corantin@users.noreply.github.com>
The pkg/e2e/.cache-synpress directory was committed to the e2e branch
accidentally. This commit removes it from git tracking by merging the
e2e branch and then running git rm --cached -r pkg/e2e/.cache-synpress.

The .gitignore entry ensures it stays ignored going forward.
fix: remove tracked .cache-synpress from e2e branch
@Corantin Corantin changed the title E2e 🧪 E2E Mar 4, 2026
@Corantin Corantin changed the base branch from mobile-view to dev March 5, 2026 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants