fix(e2e): clear file input before setInputFiles to fix TC08#270
Conversation
When TC08 uploads v2 of a file with the same disk path as v1, Chromium skips the change event because the input value hasn't changed. Clearing input.value before setInputFiles ensures the change event always fires. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: bd5084e0c4c4
WalkthroughModified the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 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.
🧹 Nitpick comments (1)
tests/e2e/page-objects/file-browser/upload-zone.page.ts (1)
57-59: Consider applying the same pre-clear step touploadFilesfor consistency.The
uploadFilesmethod could encounter the same issue if a test re-uploads the same array of file paths. For consistency and to prevent future debugging headaches, consider adding the sameel.value = ''clearing here.♻️ Suggested fix
async uploadFiles(filePaths: string[]): Promise<void> { + // Clear previous selection so re-uploading the same file paths triggers change + await this.fileInput().evaluate((el: HTMLInputElement) => { + el.value = ''; + }); await this.fileInput().setInputFiles(filePaths); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/e2e/page-objects/file-browser/upload-zone.page.ts` around lines 57 - 59, The uploadFiles method can fail when re-uploading the same file paths because the input value wasn't cleared; modify uploadFiles to first clear the underlying input element (set el.value = '') before calling this.fileInput().setInputFiles(filePaths) — locate the uploadFiles method and the helper fileInput() in upload-zone.page.ts and add the same pre-clear step used elsewhere to ensure repeated uploads work reliably.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tests/e2e/page-objects/file-browser/upload-zone.page.ts`:
- Around line 57-59: The uploadFiles method can fail when re-uploading the same
file paths because the input value wasn't cleared; modify uploadFiles to first
clear the underlying input element (set el.value = '') before calling
this.fileInput().setInputFiles(filePaths) — locate the uploadFiles method and
the helper fileInput() in upload-zone.page.ts and add the same pre-clear step
used elsewhere to ensure repeated uploads work reliably.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 38af3696-d78c-4636-bfe7-6b16c99cbbaf
📒 Files selected for processing (1)
tests/e2e/page-objects/file-browser/upload-zone.page.ts
Summary
permanent delete of versioned file reclaims all quota) failed because the v2 re-upload of the same file path didn't trigger Chromium'schangeevent on the<input type="file">input.value = ''inUploadZonePage.uploadFile()before callingsetInputFiles, ensuring the change event always fires even when re-selecting the same disk pathTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit