-
Notifications
You must be signed in to change notification settings - Fork 107
[MBL-19566][All] - Fix Custom Statuses E2E tests #3415
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
[MBL-19566][All] - Fix Custom Statuses E2E tests #3415
Conversation
…ble). refs: MBL-19566 affects: Student, Teacher, Parent release note:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Summary
This PR fixes a test cleanup issue by changing customStatusId from a local variable to a class property assignment, ensuring the @After tearDown method can access it for cleanup. The change is applied consistently to both the Parent and Student E2E tests.
Issues Found
- Null Safety Concern (apps/parent/src/androidTest/.../CustomStatusesE2ETest.kt:48 & apps/student/src/androidTest/.../CustomStatusesE2ETest.kt:46): If
upsertCustomGradeStatus()returnsnull, the test will continue with a nullcustomStatusId, which could cause unexpected behavior when passed togradeSubmission(). Consider addingrequireNotNull(customStatusId) { "Failed to create custom status" }after the assignment to fail fast with a clear error message.
Positive Feedback
✅ Consistent implementation - The fix is applied identically to both Parent and Student tests, maintaining consistency across the codebase.
✅ Proper cleanup pattern - Using the class property with the @After tearDown ensures custom statuses are properly cleaned up, respecting the 3-status limit mentioned in the comments.
✅ Clear intent - The change correctly addresses the scope issue that was preventing cleanup from working.
Test Coverage
The changes are in E2E test files themselves, so no additional test coverage is needed. The modification allows existing tearDown logic to function properly.
Recommendation
The core fix is correct and necessary. The null safety enhancement suggested in the inline comments would make the tests more robust by providing clearer failure messages if custom status creation fails during test setup.
...arent/src/androidTest/java/com/instructure/parentapp/ui/e2e/compose/CustomStatusesE2ETest.kt
Show resolved
Hide resolved
...student/src/androidTest/java/com/instructure/student/ui/e2e/compose/CustomStatusesE2ETest.kt
Show resolved
Hide resolved
📊 Code Coverage Report✅ Student
✅ Teacher
|
Fix custom statuses e2e tests in student and parent (use global variable).
refs: MBL-19566
affects: Student, Teacher, Parent
release note: