Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
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
postinstallto install Playwright Chromium for thee2epackage and updates workspace/submodule configuration. - Introduces
testId/data-testidprops 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
testIdis optional, these interpolations can renderdata-testid=\"modal-close-button-undefined\"/modal-close-backdrop-undefinedand create collisions across different modals. Prefer only setting thesedata-testidattributes whentestIdis 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
testIdis optional, these interpolations can renderdata-testid=\"modal-close-button-undefined\"/modal-close-backdrop-undefinedand create collisions across different modals. Prefer only setting thesedata-testidattributes whentestIdis 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 omittingdata-testidwhentestIdis 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 chromiumon every rootpostinstallcan 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 thepkg/e2epackage 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.E2Ewon’t be available unless explicitly inlined by the build system, which can make the flag confusing; prefer relying only on aNEXT_PUBLIC_*variable for browser bundles. Also, the template-literal cast can mask runtime formatting issues (e.g., ifgetDataSuffix()already includes0x); consider updatinggetDataSuffixto return a0x${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.E2Ewon’t be available unless explicitly inlined by the build system, which can make the flag confusing; prefer relying only on aNEXT_PUBLIC_*variable for browser bundles. Also, the template-literal cast can mask runtime formatting issues (e.g., ifgetDataSuffix()already includes0x); consider updatinggetDataSuffixto return a0x${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 | |||
There was a problem hiding this comment.
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.
| {"protection":{"super_mac":"B613679A0814D9EC772F95D778C35FC5FF1697C493715653C6C712144292C5AD"}} | |
| {} |
| 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 |
There was a problem hiding this comment.
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.
| 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. |
Corantin
left a comment
There was a problem hiding this comment.
Ignore .cache-synpress
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
No description provided.