test: add E2E tests for file versioning#164
Conversation
Extends full-workflow E2E suite with version history tests: - Extend DetailsDialogPage page object with version history methods - Add 3 test cases: version display, restore, delete Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add version section, entry, and action button locators - Add inline confirm dialog locators (yes/no buttons) - Add version error locator - Add interaction methods: getVersionCount, clickVersionRestore, clickVersionDelete, confirmVersionAction, cancelVersionAction, waitForVersionSection, getVersionNumberText, getVersionSizeText Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Test 6.6.1: Version history visible in Details dialog after text editor save, verifies version count and version numbering - Test 6.6.2: Restore a past version via inline confirm, verifies content reverts to pre-edit state via text editor - Test 6.6.3: Delete a past version via inline confirm, verifies version section disappears when no versions remain Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tasks completed: 2/2 - Extend DetailsDialogPage with version history methods - Add versioning test cases to full-workflow.spec.ts SUMMARY: .planning/quick/018-e2e-versioning-tests/018-SUMMARY.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Quick task completed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThis PR adds comprehensive E2E test coverage for file versioning functionality. It extends the DetailsDialogPage with version history interaction methods (locators and helper functions) and introduces three test cases covering version visibility, restoration, and deletion scenarios within the full-workflow test suite. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
tests/e2e/page-objects/dialogs/details-dialog.page.ts (1)
259-275: Prefer anchored regex over plain strings inhasTextto avoid unintended substring matches.Playwright treats a plain
hasTextstring as a case-insensitive substring check, so{ hasText: 'rm' }matches any button whose text contains "rm" (e.g., "confirm", "form"). Since the buttons are scoped within.details-version-entrythis is low-risk today, but anchored regex makes the intent explicit and guards against future button additions.♻️ Proposed fix using anchored regex
versionDownloadBtn(index: number): Locator { - return this.versionEntry(index).locator('button', { hasText: 'dl' }); + return this.versionEntry(index).locator('button', { hasText: /^dl$/i }); } versionRestoreBtn(index: number): Locator { - return this.versionEntry(index).locator('button', { hasText: 'restore' }); + return this.versionEntry(index).locator('button', { hasText: /^restore$/i }); } versionDeleteBtn(index: number): Locator { - return this.versionEntry(index).locator('button', { hasText: 'rm' }); + return this.versionEntry(index).locator('button', { hasText: /^rm$/i }); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/e2e/page-objects/dialogs/details-dialog.page.ts` around lines 259 - 275, The hasText predicates in versionDownloadBtn, versionRestoreBtn, and versionDeleteBtn use plain strings which perform substring/case-insensitive matches; replace those with anchored regexes (e.g., /^dl$/i, /^restore$/i, /^rm$/i or variants that allow surrounding whitespace) so Playwright matches the whole button text exactly and avoids accidental matches like "confirm" or "form".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/e2e/tests/full-workflow.spec.ts`:
- Around line 1230-1257: The 6.6.1 test ("6.6.1 Version history visible in
Details dialog") can time out because waitForVersionSection({ timeout: 30000 })
uses most of Playwright's default 30s; add a test.setTimeout(60000) at the start
of that test to match its sibling tests and allow the remaining operations to
complete. Locate the test by the string "6.6.1 Version history visible in
Details dialog" and add the single-line call to test.setTimeout(60000) before
any awaits (e.g., before fileList.rightClickItem or before calling
detailsDialog.waitForOpen) so waitForVersionSection and subsequent assertions
have sufficient time.
- Around line 1222-1339: Add a 60s test timeout to the "6.6.1 Version history
visible in Details dialog" test by calling test.setTimeout(60000) at the start
of that test (before awaiting detailsDialog.waitForVersionSection). This mirrors
sibling tests (6.6.2/6.6.3) and gives extra headroom for
detailsDialog.waitForVersionSection and the subsequent assertions (references:
test '6.6.1 Version history visible in Details dialog', test.setTimeout,
detailsDialog.waitForVersionSection).
---
Nitpick comments:
In `@tests/e2e/page-objects/dialogs/details-dialog.page.ts`:
- Around line 259-275: The hasText predicates in versionDownloadBtn,
versionRestoreBtn, and versionDeleteBtn use plain strings which perform
substring/case-insensitive matches; replace those with anchored regexes (e.g.,
/^dl$/i, /^restore$/i, /^rm$/i or variants that allow surrounding whitespace) so
Playwright matches the whole button text exactly and avoids accidental matches
like "confirm" or "form".
Add test.setTimeout(60000) to test 6.6.1 for consistency with sibling tests 6.6.2/6.6.3, and use anchored regex in version button locators to prevent unintended substring matches. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The navigateIntoFolder helper had a 15s breadcrumb timeout which is too tight for cold IPNS resolution in CI. After page reload, navigating into a folder not previously visited requires a fresh IPNS resolve that can exceed 15s under CI load. Bumped to 30s (consistent with content-load timeouts) and added 90s test timeout for test 3.10 which does cold nav + upload + round-trip verification. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
DetailsDialogPagewith 12 version history interaction methods (section visibility, version count, download/restore/delete clicks, inline confirm/cancel)full-workflow.spec.tscovering version history display, version restore, and version deleteTest plan
pnpm --filter e2e testwith API and web dev servers running🤖 Generated with Claude Code
Summary by CodeRabbit