-
Notifications
You must be signed in to change notification settings - Fork 108
[MBL-19440][Student] Extend Notifications E2E test to verify inbox conversations are excluded #3339
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-19440][Student] Extend Notifications E2E test to verify inbox conversations are excluded #3339
Conversation
…ted in notifications page. refs: MBL-19440 affects: Student release note:
…th-testing-inbox-conversations-are-not-listed
Code Review for PR #3339SummaryThis PR extends the ✅ Positive Aspects
🔍 Issues & Recommendations1. Hard-coded Sleep Duration (apps/student/src/androidTest/java/com/instructure/student/ui/e2e/classic/NotificationsE2ETest.kt:122)Issue: Using sleep(3000) //wait here to be sure that the conversation notification does not appears.Recommendation: Consider using a more robust polling mechanism similar to what's already used elsewhere in the test (lines 82-93 and 126-144). However, I understand this may be acceptable for E2E tests when verifying negative assertions (that something does NOT appear). If this approach is intentional, consider adding a more detailed comment explaining why a fixed wait is necessary here. Alternative approach: // Poll to ensure conversation doesn't appear (negative assertion)
var conversationAppeared = false
repeat(5) {
try {
refresh()
sleep(500)
notificationPage.assertNotificationDisplayed(seededConversation.subject)
conversationAppeared = true
return@repeat
} catch (e: AssertionError) {
// Expected - conversation should not appear
}
}
if (conversationAppeared) {
throw AssertionError("Conversation should not appear in notifications")
}2. Import Organization (apps/student/src/androidTest/java/com/instructure/student/ui/pages/classic/NotificationPage.kt:21)Minor: The 🎯 Code Quality Assessment
📋 Pre-Merge ChecklistAs noted in the PR description:
💡 Additional NotesThe implementation is well thought out and integrates seamlessly with the existing test structure. The use of refresh and navigation between Inbox and Notifications pages appropriately validates the requirement. The page object method Overall Assessment: ✅ Approved with minor suggestions The code is ready to merge once the E2E tests pass. The suggested improvements are optional and would only marginally improve the test reliability. |
📊 Code Coverage Report✅ Student
✅ Teacher
✅ Pandautils
📈 Overall Average
|
.../student/src/androidTest/java/com/instructure/student/ui/e2e/classic/NotificationsE2ETest.kt
Outdated
Show resolved
Hide resolved
apps/student/src/androidTest/java/com/instructure/student/ui/pages/classic/NotificationPage.kt
Outdated
Show resolved
Hide resolved
…th-testing-inbox-conversations-are-not-listed
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 adds test coverage to verify that inbox conversations do NOT appear in the notifications list, which is a good addition to the E2E test suite.
Strengths
✅ Follows existing page object pattern with the new assertNotificationNotDisplayed() method
✅ Good use of existing test infrastructure (ConversationsApi, logging patterns)
✅ Clear test intent with descriptive assertion messages
Key Issues
sleep(3000) on line 121 is a testing anti-pattern that can cause flakiness and unnecessary delays. Please use Espresso's idling resources or explicit wait conditions instead.
.first() instead of array indexing when accessing seeded data.
Suggestions
💡 The test flow navigates to Inbox to verify the conversation exists before checking Notifications. Consider whether this intermediate step is necessary or if a comment explaining its purpose would help.
💡 Consider adding KDoc to the new page object method for clarity on when to use negative assertions.
Overall, this is a solid test addition. The main concern is the hard-coded sleep which should be addressed to prevent test flakiness.
Summary
Extends testNotificationsE2E to verify that inbox conversations are not displayed in the Notifications page.
refs: MBL-19440
affects: Student
release note:
Checklist