Skip to content

[MBL-19469][Student] - Discussion Checkpoints Notifications E2E Test#3622

Merged
kdeakinstructure merged 2 commits intomasterfrom
MBL-19469-discussions-e2e-test-for-notifications
Apr 7, 2026
Merged

[MBL-19469][Student] - Discussion Checkpoints Notifications E2E Test#3622
kdeakinstructure merged 2 commits intomasterfrom
MBL-19469-discussions-e2e-test-for-notifications

Conversation

@kdeakinstructure
Copy link
Copy Markdown
Contributor

@kdeakinstructure kdeakinstructure commented Apr 6, 2026

Implement Discussion checkpoint notifications E2E test.
Refactor notification assertion and click logic to handle contains.

refs: MBL-19469
affects: Student
release note: -

  • Run E2E test suite

Refactor notification assertion and click logic to handle contains.

refs: MBL-19469
affects: Student
release note: -
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: Discussion Checkpoints Notifications E2E Test

This PR adds an E2E test for Discussion Checkpoints notifications and refactors NotificationPage to support both exact and partial text matching. The test structure is solid and follows the existing patterns well.

Issues Found

  • Breaking behavior change in NotificationPage (potential regression)NotificationPage.kt lines 42–47 and 77–84
    The original assertNotificationDisplayed(title) and clickNotification(title) always used containsTextCaseInsensitive, which does substring + case-insensitive matching. With the new default (contains = false), all existing callers silently switch to withText(title)exact, case-sensitive matching. Any existing test relying on the old partial/case-insensitive behavior will now fail without any compile-time warning. Consider inverting the default to preserve backward compatibility, or renaming the parameter to make the intent explicit:

    // Option A: preserve old default behavior
    fun assertNotificationDisplayed(title: String, exactMatch: Boolean = false) {
        val matcher = if (exactMatch) {
            allOf(withText(title), withId(R.id.title))
        } else {
            allOf(containsTextCaseInsensitive(title), withId(R.id.title))
        }
  • Potential timezone-related test flakinessNotificationsE2ETest.kt, assignmentDetailsDisplayFormat line
    getCustomDateCalendar(n) creates a Calendar in UTC (sets hour=10, minute=1, second=1 in UTC). However, assignmentDetailsDisplayFormat does not set a timezone, so SimpleDateFormat defaults to the device's local timezone when formatting. On a CI runner in a non-UTC timezone, the formatted time will differ from what the app displays (which uses UTC). Add an explicit timezone:

    val assignmentDetailsDisplayFormat = SimpleDateFormat("MMM d, yyyy h:mm a", Locale.US).apply {
        timeZone = TimeZone.getTimeZone("UTC")
    }
  • Unused syllabusBody in seedDataNotificationsE2ETest.kt, testDiscussionCheckpointsNotificationsE2E
    seedData(..., syllabusBody = "this is the syllabus body") seeds data that is never referenced by this test. Removing it reduces noise and avoids unnecessary server calls.

  • Inconsistent retry block formattingNotificationsE2ETest.kt, retry block
    The closing brace of catchBlock is placed on the same line as the call (refresh() }), while the main lambda opens on a new line. This looks inconsistent with the Kotlin style used elsewhere in the file:

    retryWithIncreasingDelay(times = 10, maxDelay = 3000, catchBlock = { refresh() }) {
        notificationPage.assertNotificationDisplayed(discussionWithCheckpointsTitle)
        notificationPage.assertNotificationDisplayed("Assignment Created - $discussionWithCheckpointsTitle", contains = true)
    }

Positive Notes

  • Migrating from StudentTest to StudentComposeTest is the right call for a test that interacts with Compose-based pages like discussionDetailsPage.
  • Using retryWithIncreasingDelay for polling notification appearance is a good pattern for flake-resistant E2E tests.
  • The date formatting split (seed format vs. display format) is thorough and covers the format mismatch between the API and the UI.
  • The contains: Boolean = false extension to the page object methods is a clean, backward-compatible API addition in concept — just needs the default value adjusted as noted above.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 6, 2026

🧪 Unit Test Results

✅ 📱 Student App

  • Tests: 1252 total, 0 failed, 0 skipped
  • Duration: 0.000s
  • Success Rate: 100%

✅ 🌅 Horizon

  • Tests: 790 total, 0 failed, 0 skipped
  • Duration: 37.838s
  • Success Rate: 100%

✅ 📦 Submodules

  • Tests: 3348 total, 0 failed, 0 skipped
  • Duration: 52.346s
  • Success Rate: 100%

📊 Summary

  • Total Tests: 5390
  • Failed: 0
  • Skipped: 0
  • Status: ✅ All tests passed!

Last updated: Mon, 06 Apr 2026 22:19:09 GMT

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 6, 2026

📊 Code Coverage Report

✅ Student

  • PR Coverage: 42.65%
  • Master Coverage: 42.65%
  • Delta: +0.00%

✅ Teacher

  • PR Coverage: 25.37%
  • Master Coverage: 25.37%
  • Delta: +0.00%

✅ Pandautils

  • PR Coverage: 23.68%
  • Master Coverage: 23.68%
  • Delta: +0.00%

📈 Overall Average

  • PR Coverage: 30.57%
  • Master Coverage: 30.57%
  • Delta: +0.00%

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 6, 2026

Student Install Page

@kdeakinstructure kdeakinstructure merged commit 0a47617 into master Apr 7, 2026
28 of 29 checks passed
@kdeakinstructure kdeakinstructure deleted the MBL-19469-discussions-e2e-test-for-notifications branch April 7, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants