• wwwillchen-bot's avatar
    refactor: modularize e2e test helpers into separate modules (#2556) · b2bf3bed
    wwwillchen-bot 提交于
    ## Summary
    - Split the monolithic `test_helper.ts` (~1700 lines) into focused
    modules for better maintainability
    - Created `constants.ts` for timeout constants
    - Created `fixtures.ts` for Playwright fixtures and test setup
    - Created `utils/` directory for utility functions (normalization,
    dump-prettifier)
    - Created `page-objects/` directory with component and dialog page
    objects
    
    ## Test plan
    - [x] All existing unit tests pass (784 tests)
    - [x] Lint and type checks pass
    - [ ] E2E tests should work with the refactored helpers (imports are
    re-exported from test_helper.ts for backward compatibility)
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    <!-- devin-review-badge-begin -->
    
    ---
    
    <a href="https://app.devin.ai/review/dyad-sh/dyad/pull/2556"
    target="_blank">
      <picture>
    <source media="(prefers-color-scheme: dark)"
    srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
    <img
    src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
    alt="Open with Devin">
      </picture>
    </a>
    <!-- devin-review-badge-end -->
    
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    Refactored e2e test helpers into modular page objects, fixtures, and
    utilities for easier maintenance and more deterministic snapshots. Added
    loop guards to prevent hangs in toast dismissal and the Context Files
    Picker; existing tests keep working via re-exports.
    
    - **Refactors**
    - Split test_helper.ts into constants.ts, fixtures.ts, utils/, and
    page-objects/ (components + dialogs); added a main PageObject that
    composes component page objects.
    - Introduced normalization and dump-prettifier utilities for stable
    snapshots.
    - Centralized CI-aware timeouts in constants.ts; added optional debug
    logging flag.
      - Kept test_helper.ts as a thin re-export for backward compatibility.
    - Updated TypeScript strict-mode docs with ES2020 target limitations on
    replaceAll.
    
    - **Bug Fixes**
      - Fixed importApp path resolution to use __dirname three levels up.
    - Switched git config calls to execFileSync to avoid command injection.
    - Corrected toast dismissal loop to click the first toast repeatedly
    until none remain; added maxAttempts=20 guard (and in Context Files
    Picker) to prevent hangs.
    - Derived the app executable name from appInfo instead of hardcoding
    dyad.exe.
    
    <sup>Written for commit 26329e6b1866fd31e1cba91e0b641fc04df30e8a.
    Summary will update on new commits.</sup>
    
    <!-- End of auto-generated description by cubic. -->
    
    ---------
    Co-authored-by: 's avatarWill Chen <willchen90@gmail.com>
    Co-authored-by: 's avatarClaude Opus 4.5 <noreply@anthropic.com>
    Co-authored-by: 's avatarclaude[bot] <41898282+claude[bot]@users.noreply.github.com>
    b2bf3bed
名称
最后提交
最后更新
.claude 正在载入提交数据...
.cursor/rules 正在载入提交数据...
.devcontainer 正在载入提交数据...
.github 正在载入提交数据...
.husky 正在载入提交数据...
.storybook 正在载入提交数据...
assets 正在载入提交数据...
docs 正在载入提交数据...
drizzle 正在载入提交数据...
e2e-tests 正在载入提交数据...
makers 正在载入提交数据...
packages/@dyad-sh 正在载入提交数据...
rules 正在载入提交数据...
scaffold 正在载入提交数据...
scripts 正在载入提交数据...
shared 正在载入提交数据...
src 正在载入提交数据...
testing 正在载入提交数据...
tools 正在载入提交数据...
worker 正在载入提交数据...
workers/tsc 正在载入提交数据...
.cursorignore 正在载入提交数据...
.env.example 正在载入提交数据...
.eslintrc.json 正在载入提交数据...
.gitattributes 正在载入提交数据...
.gitignore 正在载入提交数据...
.oxfmtrc.json 正在载入提交数据...
.oxlintrc.json 正在载入提交数据...
.prettierignore 正在载入提交数据...
.prettierrc 正在载入提交数据...
AGENTS.md 正在载入提交数据...
CLA.md 正在载入提交数据...
CLAUDE.md 正在载入提交数据...
CONTRIBUTING.md 正在载入提交数据...
LICENSE 正在载入提交数据...
README.md 正在载入提交数据...
SECURITY.md 正在载入提交数据...
biome.json 正在载入提交数据...
components.json 正在载入提交数据...
drizzle.config.ts 正在载入提交数据...
forge.config.ts 正在载入提交数据...
forge.env.d.ts 正在载入提交数据...
index.html 正在载入提交数据...
lint-staged.config.js 正在载入提交数据...
merge.config.ts 正在载入提交数据...
package-lock.json 正在载入提交数据...
package.json 正在载入提交数据...
playwright.config.ts 正在载入提交数据...
tsconfig.app.json 正在载入提交数据...
tsconfig.json 正在载入提交数据...
tsconfig.node.json 正在载入提交数据...
vite.main.config.mts 正在载入提交数据...
vite.preload.config.mts 正在载入提交数据...
vite.renderer.config.mts 正在载入提交数据...
vite.worker.config.mts 正在载入提交数据...
vitest.config.ts 正在载入提交数据...
windowsSign.ts 正在载入提交数据...