-
Notifications
You must be signed in to change notification settings - Fork 5.4k
test: Shield E2E - Add more Claim scenarios #38389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
✨ Files requiring CODEOWNER review ✨🧪 @MetaMask/qa (1 files, +74 -7)
🔐 @MetaMask/web3auth (1 files, +5 -1)
|
Builds ready [024bae7]
UI Startup Metrics (1215 ± 108 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [af4d75f]
UI Startup Metrics (1229 ± 107 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [da9c524]
UI Startup Metrics (1216 ± 98 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [c75b833]
UI Startup Metrics (1268 ± 122 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [babe575]
UI Startup Metrics (1253 ± 113 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
This PR adds comprehensive E2E test coverage for Shield Claims functionality, including successful claim submission with file attachments and error handling scenarios. The changes include:
Added E2E tests for Shield Claims:
Enhanced Page Object Model:
verifyFieldError()method for inline field error verificationverifyToastError()method for toast error message verificationuploadTestFile()method for file upload functionalityverifyFileUploaded()method for file upload verificationImproved Mock Service:
ShieldMockttpServiceto support error scenarios (E102: TRANSACTION_NOT_ELIGIBLE, E203: DUPLICATE_CLAIM_EXISTS)claimErrorCodeoverride parameter for flexible error testingUI Enhancement:
data-testid="shield-claim-impacted-tx-hash-error"to transaction hash error field for better testabilityTest Data:
test/e2e/test-data/test-document.pdf) for file upload scenariosMotivation: These tests ensure critical Shield Claims functionality works correctly, including form validation, error handling, and file upload capabilities. This improves test coverage and helps prevent regressions in the claims submission flow.
Changelog
CHANGELOG entry: null
(This is a test-only change and does not affect end-user functionality)
Related issues
Fixes:
Manual testing steps
Error Scenarios Testing:
Transaction Not Eligible Error:
Duplicate Claim Error:
Screenshots/Recordings
Before
No E2E tests existed for Shield Claims error scenarios
After
E2E tests now cover:
Pre-merge author checklist
I've followed MetaMask Contributor Docs and MetaMask Extension Coding Standards.
I've completed the PR template to the best of my ability
I've included tests if applicable
I've documented my code using JSDoc format if applicable
I've applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
test,e2e,shield,enhancementPre-merge reviewer checklist
I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
Note
Adds E2E tests for Shield Claims (success with attachment, in-field and toast errors) and supporting mock, page object, and UI test-id updates.
test/e2e/tests/shield/shield-subscription-management.spec.ts.ShieldMockttpServiceto acceptclaimErrorCodeoverride and return mapped errors in#handleSubmitClaim(E102, E203) or success; propagate override insetup.ShieldClaimPagewith file upload helpers (uploadTestFile,verifyFileUploaded), error verifiers (verifyFieldError,verifyToastError), and optionaluploadTestFileinfillForm.file-uploader-input,claim-submit-toast-error,shield-claim-impacted-tx-hash-error).data-testid="shield-claim-impacted-tx-hash-error"to impacted tx hash error help text inclaims-form.tsx.test/e2e/test-data/test-document.pdf.MOCK_CLAIM_2for view-mode verification.Written by Cursor Bugbot for commit c75b833. This will update automatically on new commits. Configure here.