# 7. Maintenance & Operations — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: maintenance_operations.md — every feature, sub-feature, and rule covered

---

## Test Execution Policy
- Zero tolerance: any deviation from documented behavior = FAILED = bug
- Every bug is immediately logged/reported (Bug ID, feature, sub-feature,
  expected vs actual, severity) and fixed 100% before the group passes
- Feature group passes only at 100% test pass rate

## Coverage Matrix
| Feature | Sub-feature / Rule | Test IDs |
|---------|--------------------|----------|
| 7.1 Maintenance Mode | Enable maintenance mode (platform-wide or a defined scope) | TC-SA-04-07-001 |
| 7.1 Maintenance Mode | Maintenance message: the user-facing notice shown during maintenance | TC-SA-04-07-002 |
| 7.1 Maintenance Mode | Scheduled maintenance: set a window in advance with a pre-notification | TC-SA-04-07-003 |
| 7.1 Maintenance Mode | Emergency maintenance: enable immediately with the message | TC-SA-04-07-004 |
| 7.1 Maintenance Mode | Authorized access: staff/Super Admin can access during maintenance (bypass path) | TC-SA-04-07-005 |
| 7.1 Maintenance Mode | Exit: end maintenance and restore normal access | TC-SA-04-07-006 |
| 7.1 Maintenance Mode | User communication: pre-notification for scheduled, the message during, and a restoration notice | TC-SA-04-07-007 |
| 7.1 Maintenance Mode | Audit logging of maintenance mode entry and exit | TC-SA-04-07-008 |
| 7.1 Maintenance Mode | Rule: maintenance mode pauses user access with a clear message; it is not a silent outage | TC-SA-04-07-002 |
| 7.1 Maintenance Mode | Rule: scheduled maintenance pre-notifies users; emergency maintenance is immediate with the message shown | TC-SA-04-07-003, TC-SA-04-07-004 |
| 7.1 Maintenance Mode | Rule: authorized staff retain access during maintenance via the bypass path; the bypass is itself controlled and logged | TC-SA-04-07-005, TC-SA-04-07-009 |
| 7.1 Maintenance Mode | Rule: exit restores access immediately; there is no lingering maintenance state | TC-SA-04-07-006 |
| 7.1 Maintenance Mode | Rule: the scope is explicit (platform-wide or defined); a scoped maintenance does not affect out-of-scope surfaces | TC-SA-04-07-010 |
| 7.1 Maintenance Mode | Rule: maintenance entry and exit are audit-logged with the scope, message, and timestamps | TC-SA-04-07-008 |
| 7.2 Banner Announcements and Popup Messages | Banner announcements: persistent messages shown in the interface, with start/end times | TC-SA-04-07-011 |
| 7.2 Banner Announcements and Popup Messages | Popup messages: one-time messages shown on next login/visit, dismissible | TC-SA-04-07-012 |
| 7.2 Banner Announcements and Popup Messages | Targeting: all users or a segment (by type, institute, or status) | TC-SA-04-07-013 |
| 7.2 Banner Announcements and Popup Messages | Scheduling: start and end times for the message's visibility | TC-SA-04-07-014 |
| 7.2 Banner Announcements and Popup Messages | Priority/styling: the message's prominence (info, warning, critical) | TC-SA-04-07-015 |
| 7.2 Banner Announcements and Popup Messages | Dismissal handling: a popup is shown once per user; a banner persists until its end time | TC-SA-04-07-016 |
| 7.2 Banner Announcements and Popup Messages | Audit logging of message creation, scheduling, and removal | TC-SA-04-07-017 |
| 7.2 Banner Announcements and Popup Messages | Rule: a banner persists from its start to its end time; a popup is shown once per user and then dismissed permanently for them | TC-SA-04-07-016 |
| 7.2 Banner Announcements and Popup Messages | Rule: targeting is explicit: a message reaches all users or the defined segment, not an accidental subset | TC-SA-04-07-013, TC-SA-04-07-018 |
| 7.2 Banner Announcements and Popup Messages | Rule: styling matches the message's importance (info, warning, critical); a critical message is visually distinct | TC-SA-04-07-015 |
| 7.2 Banner Announcements and Popup Messages | Rule: a message can be removed early; removal takes effect immediately | TC-SA-04-07-019 |
| 7.2 Banner Announcements and Popup Messages | Rule: scheduling is honored: a message is not visible outside its start/end window | TC-SA-04-07-020 |
| 7.2 Banner Announcements and Popup Messages | Rule: message creation, scheduling, targeting, and removal are audit-logged with the acting admin and timestamps | TC-SA-04-07-017 |
| 7.3 Scheduled Notifications | Scheduled notification creation: audience, content, channel(s), and send time | TC-SA-04-07-021 |
| 7.3 Scheduled Notifications | Audience targeting: all users or a segment (by type, institute, status, or list) | TC-SA-04-07-022 |
| 7.3 Scheduled Notifications | Channel selection from the configured channels (per the notification settings) | TC-SA-04-07-023 |
| 7.3 Scheduled Notifications | Preview before scheduling (content and audience summary) | TC-SA-04-07-024 |
| 7.3 Scheduled Notifications | Send-time scheduling with a status (scheduled, sent, cancelled) | TC-SA-04-07-025 |
| 7.3 Scheduled Notifications | Cancellation of a scheduled notification before its send time | TC-SA-04-07-026 |
| 7.3 Scheduled Notifications | Audit logging of scheduled notification creation, send, and cancellation | TC-SA-04-07-027 |
| 7.3 Scheduled Notifications | Rule: a scheduled notification sends only at its defined time to its defined audience; it is not event-driven | TC-SA-04-07-025, TC-SA-04-07-028 |
| 7.3 Scheduled Notifications | Rule: the preview shows the content and audience before scheduling, so a mis-targeted send is caught early | TC-SA-04-07-024 |
| 7.3 Scheduled Notifications | Rule: cancellation before the send time prevents the send; a cancelled notification is not delivered | TC-SA-04-07-026 |
| 7.3 Scheduled Notifications | Rule: channels are selected from the configured set (per the notification settings); a channel capability check applies at send | TC-SA-04-07-023, TC-SA-04-07-029 |
| 7.3 Scheduled Notifications | Rule: the status (scheduled, sent, cancelled) is tracked and visible for each notification | TC-SA-04-07-025 |
| 7.3 Scheduled Notifications | Rule: scheduled notification creation, send, and cancellation are audit-logged with the acting admin and timestamps | TC-SA-04-07-027 |

## 7.1 Maintenance Mode

### TC-SA-04-07-001 — Maintenance mode can be enabled platform-wide or for a defined scope
**Type:** Positive
**Covers:** 7.1 → Enable maintenance mode (platform-wide or a defined scope)
**Preconditions:** A platform update is planned.
**Steps:**
1. Open Maintenance & Operations.
2. Enable maintenance mode platform-wide.
3. Verify user access is paused platform-wide.
**Expected Result:** Maintenance mode is enabled platform-wide; user access is paused.
**Priority:** Critical

### TC-SA-04-07-002 — The maintenance message is shown to users during maintenance; it is not a silent outage
**Type:** Positive
**Covers:** 7.1 → Maintenance message: the user-facing notice shown during maintenance; Rule: maintenance mode pauses user access with a clear message; it is not a silent outage
**Preconditions:** Maintenance mode is active with the message "Scheduled maintenance — back in 30 minutes."
**Steps:**
1. As a regular user, attempt to log in during maintenance.
2. Verify the maintenance message is shown (not a silent outage or error).
**Expected Result:** The user sees the clear maintenance message — the outage is communicated, not silent.
**Priority:** Critical

### TC-SA-04-07-003 — Scheduled maintenance: a window is set in advance with a pre-notification to users
**Type:** Positive
**Covers:** 7.1 → Scheduled maintenance: set a window in advance with a pre-notification; Rule: scheduled maintenance pre-notifies users; emergency maintenance is immediate with the message shown
**Preconditions:** A maintenance window is scheduled for 2 days from now.
**Steps:**
1. Schedule the maintenance window and enable the pre-notification.
2. Verify users are notified in advance of the window.
3. At the window, verify maintenance mode is enabled.
**Expected Result:** Users are pre-notified of the scheduled window; maintenance mode is enabled at the window.
**Priority:** High

### TC-SA-04-07-004 — Emergency maintenance: maintenance mode is enabled immediately with the message
**Type:** Positive
**Covers:** 7.1 → Emergency maintenance: enable immediately with the message; Rule: scheduled maintenance pre-notifies users; emergency maintenance is immediate with the message shown
**Preconditions:** A critical fault occurs.
**Steps:**
1. Enable maintenance mode immediately (emergency) with the message.
2. Verify user access is paused immediately and the message is shown.
**Expected Result:** Maintenance mode is enabled immediately with the message — no scheduling delay.
**Priority:** Critical

### TC-SA-04-07-005 — Authorized staff (including Super Admin) can access the platform during maintenance via the bypass path; the bypass is controlled and logged
**Type:** Positive
**Covers:** 7.1 → Authorized access: staff/Super Admin can access during maintenance (bypass path); Rule: authorized staff retain access during maintenance via the bypass path; the bypass is itself controlled and logged
**Preconditions:** Maintenance mode is active.
**Steps:**
1. As the Super Admin, use the bypass path to access the platform.
2. Verify access is granted.
3. Verify the bypass access is logged.
**Expected Result:** The Super Admin accesses the platform via the bypass path; the bypass is controlled and logged.
**Priority:** Critical

### TC-SA-04-07-006 — Exit: ending maintenance restores normal access immediately; no lingering maintenance state
**Type:** Positive
**Covers:** 7.1 → Exit: end maintenance and restore normal access; Rule: exit restores access immediately; there is no lingering maintenance state
**Preconditions:** Maintenance mode is active.
**Steps:**
1. End maintenance mode.
2. As a regular user, attempt to log in immediately.
3. Verify normal access is restored (no lingering maintenance state).
**Expected Result:** Normal access is restored immediately on exit — no lingering maintenance state.
**Priority:** Critical

### TC-SA-04-07-007 — User communication: pre-notification for scheduled, the message during, and a restoration notice
**Type:** Positive
**Covers:** 7.1 → User communication: pre-notification for scheduled, the message during, and a restoration notice
**Preconditions:** A scheduled maintenance is planned.
**Steps:**
1. Verify the pre-notification is sent before the window.
2. Verify the maintenance message is shown during the window.
3. After exit, verify the restoration notice is sent.
**Expected Result:** All three communications occur: pre-notification before, the message during, and the restoration notice after.
**Priority:** High

### TC-SA-04-07-008 — Maintenance mode entry and exit are audit-logged with the scope, message, and timestamps
**Type:** Positive
**Covers:** 7.1 → Audit logging of maintenance mode entry and exit; Rule: maintenance entry and exit are audit-logged with the scope, message, and timestamps
**Preconditions:** A maintenance window has been entered and exited.
**Steps:**
1. Open the maintenance log.
2. Verify each window shows the start, end, the message, the scope, and the acting admin.
**Expected Result:** The maintenance log shows the start, end, message, scope, and acting admin for each window.
**Priority:** Critical

### TC-SA-04-07-009 — An unauthorized (non-staff) user cannot use the bypass path during maintenance
**Type:** Negative
**Covers:** 7.1 → Rule: authorized staff retain access during maintenance via the bypass path; the bypass is itself controlled and logged
**Preconditions:** Maintenance mode is active; a regular (non-staff) user attempts the bypass path.
**Steps:**
1. As a regular user, attempt to use the bypass path.
**Expected Result:** The bypass path is denied for the non-staff user — the bypass is controlled to authorized staff only.
**Priority:** Critical

### TC-SA-04-07-010 — A scoped maintenance does not affect out-of-scope surfaces
**Type:** Edge
**Covers:** 7.1 → Rule: the scope is explicit (platform-wide or defined); a scoped maintenance does not affect out-of-scope surfaces
**Preconditions:** Maintenance mode is enabled for a defined scope (e.g., the assessment module only).
**Steps:**
1. As a user, attempt to access the in-scope surface and verify it is paused with the message.
2. Attempt to access an out-of-scope surface and verify it remains available.
**Expected Result:** The in-scope surface is paused; the out-of-scope surface remains available — the scope is explicit and honored.
**Priority:** High

## 7.2 Banner Announcements and Popup Messages

### TC-SA-04-07-011 — Banner announcements: a persistent message is shown in the interface from its start to its end time
**Type:** Positive
**Covers:** 7.2 → Banner announcements: persistent messages shown in the interface, with start/end times
**Preconditions:** A banner "Scheduled maintenance on [date/time]" is created with start = now, end = after the maintenance.
**Steps:**
1. Save the banner.
2. As a user, verify the banner appears in the interface.
3. Verify the banner persists across pages until the end time.
**Expected Result:** The banner appears in users' interfaces and persists until the end time.
**Priority:** High

### TC-SA-04-07-012 — Popup messages: a one-time message is shown on next login/visit and is dismissible
**Type:** Positive
**Covers:** 7.2 → Popup messages: one-time messages shown on next login/visit, dismissible
**Preconditions:** A critical popup (security advisory) is created, targeted to all users.
**Steps:**
1. As a user, log in and verify the critical popup is shown.
2. Dismiss the popup.
**Expected Result:** The popup is shown on next login and can be dismissed.
**Priority:** High

### TC-SA-04-07-013 — Targeting: a message reaches all users or a defined segment (by type, institute, or status)
**Type:** Positive
**Covers:** 7.2 → Targeting: all users or a segment (by type, institute, or status); Rule: targeting is explicit: a message reaches all users or the defined segment, not an accidental subset
**Preconditions:** A new-feature message is targeted to a specific institute's staff.
**Steps:**
1. Create the message targeted to the institute's staff.
2. As a staff member of that institute, verify the message is shown.
3. As a user outside the segment, verify the message is not shown.
**Expected Result:** Only the targeted institute's staff see the message — targeting is explicit.
**Priority:** High

### TC-SA-04-07-014 — Scheduling: a message is visible only within its start/end times
**Type:** Positive
**Covers:** 7.2 → Scheduling: start and end times for the message's visibility
**Preconditions:** A banner is scheduled with start = tomorrow 09:00, end = tomorrow 17:00.
**Steps:**
1. Verify the banner is not visible before 09:00.
2. Verify the banner is visible between 09:00 and 17:00.
3. Verify the banner is not visible after 17:00.
**Expected Result:** The banner is visible only within its start/end window.
**Priority:** High

### TC-SA-04-07-015 — Priority/styling: the message's prominence (info, warning, critical) is applied; critical is visually distinct
**Type:** Positive
**Covers:** 7.2 → Priority/styling: the message's prominence (info, warning, critical); Rule: styling matches the message's importance (info, warning, critical); a critical message is visually distinct
**Preconditions:** Three messages are created: one info, one warning, one critical.
**Steps:**
1. Verify the info message is styled as info.
2. Verify the warning message is styled as warning.
3. Verify the critical message is visually distinct (critical styling).
**Expected Result:** Each message is styled per its priority; the critical message is visually distinct.
**Priority:** Medium

### TC-SA-04-07-016 — Dismissal handling: a popup is shown once per user (permanently dismissed); a banner persists until its end time
**Type:** Positive
**Covers:** 7.2 → Dismissal handling: a popup is shown once per user; a banner persists until its end time; Rule: a banner persists from its start to its end time; a popup is shown once per user and then dismissed permanently for them
**Preconditions:** A popup has been dismissed by a user; a banner is active.
**Steps:**
1. As the user, log in again and verify the popup is not shown again (one-time per user).
2. Verify the banner is still shown (persists until its end time).
**Expected Result:** The popup is not re-shown to the user (permanently dismissed); the banner persists until its end time.
**Priority:** High

### TC-SA-04-07-017 — Message creation, scheduling, targeting, and removal are audit-logged with the acting admin and timestamps
**Type:** Positive
**Covers:** 7.2 → Audit logging of message creation, scheduling, and removal; Rule: message creation, scheduling, targeting, and removal are audit-logged with the acting admin and timestamps
**Preconditions:** A banner is created, scheduled, targeted, and later removed.
**Steps:**
1. Open the audit trail and filter by "announcement".
2. Verify entries for creation, scheduling, targeting, and removal with the acting admin and timestamps.
**Expected Result:** The creation, scheduling, targeting, and removal are all audit-logged with the acting admin and timestamps.
**Priority:** Critical

### TC-SA-04-07-018 — A segment-targeted message does not reach users outside the segment (no accidental subset or over-reach)
**Type:** Negative
**Covers:** 7.2 → Rule: targeting is explicit: a message reaches all users or the defined segment, not an accidental subset
**Preconditions:** A message is targeted to "institute admins" only.
**Steps:**
1. As a regular student, verify the message is not shown.
2. As an institute admin, verify the message is shown.
**Expected Result:** The message reaches only the defined segment (institute admins) — no accidental over-reach or subset.
**Priority:** High

### TC-SA-04-07-019 — A message can be removed early; removal takes effect immediately
**Type:** Positive
**Covers:** 7.2 → Rule: a message can be removed early; removal takes effect immediately
**Preconditions:** An active banner exists (the maintenance is moved).
**Steps:**
1. Remove the banner early.
2. As a user, verify the banner disappears from the interface immediately.
**Expected Result:** The banner is removed and disappears from interfaces immediately.
**Priority:** High

### TC-SA-04-07-020 — Scheduling is honored: a message is not visible outside its start/end window
**Type:** Negative
**Covers:** 7.2 → Rule: scheduling is honored: a message is not visible outside its start/end window
**Preconditions:** A banner is scheduled to start in 2 hours.
**Steps:**
1. As a user, verify the banner is not visible now (before the start time).
**Expected Result:** The banner is not visible before its start time — scheduling is honored.
**Priority:** High

## 7.3 Scheduled Notifications

### TC-SA-04-07-021 — Scheduled notification creation: audience, content, channel(s), and send time are defined
**Type:** Positive
**Covers:** 7.3 → Scheduled notification creation: audience, content, channel(s), and send time
**Preconditions:** A course deadline is in 3 days for a cohort.
**Steps:**
1. Create a scheduled notification: audience = the cohort, content = the deadline reminder, channel = push, send time = 24 hours before the deadline.
2. Verify the notification is created with all four elements.
**Expected Result:** The scheduled notification is created with the audience, content, channel, and send time.
**Priority:** Critical

### TC-SA-04-07-022 — Audience targeting: all users or a segment (by type, institute, status, or list)
**Type:** Positive
**Covers:** 7.3 → Audience targeting: all users or a segment (by type, institute, status, or list)
**Preconditions:** A weekly digest is targeted to institute admins.
**Steps:**
1. Create the digest targeted to institute admins.
2. Verify the audience summary shows the institute-admin segment.
**Expected Result:** The digest is targeted to the institute-admin segment — audience targeting works.
**Priority:** High

### TC-SA-04-07-023 — Channel selection from the configured channels; a channel capability check applies at send
**Type:** Positive
**Covers:** 7.3 → Channel selection from the configured channels (per the notification settings); Rule: channels are selected from the configured set (per the notification settings); a channel capability check applies at send
**Preconditions:** Push is a configured channel; a scheduled notification uses push.
**Steps:**
1. Select push as the channel for the scheduled notification.
2. At send time, verify the notification is delivered via push to users with push enabled.
3. Verify users without push capability are handled per the capability check.
**Expected Result:** The notification is delivered via the configured channel; the capability check applies at send.
**Priority:** High

### TC-SA-04-07-024 — Preview before scheduling: the content and audience summary are shown, so a mis-targeted send is caught early
**Type:** Positive
**Covers:** 7.3 → Preview before scheduling (content and audience summary); Rule: the preview shows the content and audience before scheduling, so a mis-targeted send is caught early
**Preconditions:** A scheduled notification is being created for a cohort.
**Steps:**
1. Preview the notification before scheduling.
2. Verify the content renders correctly and the audience summary shows the cohort size.
**Expected Result:** The preview shows the content and the audience summary (cohort size) before scheduling.
**Priority:** High

### TC-SA-04-07-025 — Send-time scheduling with a status (scheduled, sent, cancelled); the status is tracked and visible
**Type:** Positive
**Covers:** 7.3 → Send-time scheduling with a status (scheduled, sent, cancelled); Rule: the status (scheduled, sent, cancelled) is tracked and visible for each notification; Rule: a scheduled notification sends only at its defined time to its defined audience; it is not event-driven
**Preconditions:** A scheduled notification is set for a future send time.
**Steps:**
1. Schedule the notification and verify the status is "scheduled" with the send time.
2. At the send time, verify the notification is delivered and the status moves to "sent".
**Expected Result:** The status is "scheduled" before send and moves to "sent" at the send time — the status is tracked and visible.
**Priority:** Critical

### TC-SA-04-07-026 — Cancellation of a scheduled notification before its send time prevents the send
**Type:** Positive
**Covers:** 7.3 → Cancellation of a scheduled notification before its send time; Rule: cancellation before the send time prevents the send; a cancelled notification is not delivered
**Preconditions:** A scheduled notification is pending (the deadline moved).
**Steps:**
1. Cancel the pending notification before its send time.
2. Verify the status moves to "cancelled".
3. At the original send time, verify nothing is sent.
**Expected Result:** The notification is cancelled; the status is "cancelled"; nothing is delivered at the original send time.
**Priority:** Critical

### TC-SA-04-07-027 — Scheduled notification creation, send, and cancellation are audit-logged with the audience, content, channel, time, and acting admin
**Type:** Positive
**Covers:** 7.3 → Audit logging of scheduled notification creation, send, and cancellation; Rule: scheduled notification creation, send, and cancellation are audit-logged with the acting admin and timestamps
**Preconditions:** A scheduled notification has been created, sent, and another cancelled.
**Steps:**
1. Open the audit trail and filter by "scheduled notification".
2. Verify entries for creation, send, and cancellation with the audience, content, channel, time, and acting admin.
**Expected Result:** The creation, send, and cancellation are audit-logged with the audience, content, channel, time, and acting admin.
**Priority:** Critical

### TC-SA-04-07-028 — A scheduled notification is not sent before its defined time (not event-driven)
**Type:** Negative
**Covers:** 7.3 → Rule: a scheduled notification sends only at its defined time to its defined audience; it is not event-driven
**Preconditions:** A scheduled notification is set for 24 hours before a deadline.
**Steps:**
1. Verify the notification is not sent before the defined send time.
**Expected Result:** The notification is not sent early — it sends only at its defined time.
**Priority:** High

### TC-SA-04-07-029 — A channel not in the configured set cannot be selected for a scheduled notification
**Type:** Negative
**Covers:** 7.3 → Rule: channels are selected from the configured set (per the notification settings); a channel capability check applies at send
**Preconditions:** SMS is disabled platform-wide in the notification settings.
**Steps:**
1. As the Super Admin, attempt to select SMS as the channel for a scheduled notification.
**Expected Result:** SMS is not available for selection — channels are selected only from the configured set.
**Priority:** Medium
