# 1. LMS Integration — Test Cases

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

## Test Execution Policy

- Zero tolerance: any deviation from the documented behavior is a defect.
- Every failed test is logged with a Bug ID, the feature, the sub-feature, the expected vs actual result, and the severity; 100% of bugs are fixed before the group passes.
- 100% pass rate is required for the group to be marked complete.

## Coverage Matrix

| Feature | Sub-feature / Rule | Test IDs |
|---------|--------------------|----------|
| 1.1 SSO Configuration | SSO protocol (SAML 2.0, OIDC) | TC-SA-INT-1-001 |
| 1.1 SSO Configuration | IdP metadata and entity ID | TC-SA-INT-1-002 |
| 1.1 SSO Configuration | Attribute mapping (LMS attributes to roles) | TC-SA-INT-1-003 |
| 1.1 SSO Configuration | SSO scope (users, institutions, plans) | TC-SA-INT-1-004 |
| 1.1 SSO Configuration | Rule: invalid IdP metadata rejected | TC-SA-INT-1-005 |
| 1.1 SSO Configuration | Rule: unmapped required attribute blocks activation | TC-SA-INT-1-006 |
| 1.1 SSO Configuration | Rule: SSO failure fallback (password or blocked) | TC-SA-INT-1-007 |
| 1.1 SSO Configuration | Rule: SSO disabled → password login only | TC-SA-INT-1-008 |
| 1.1 SSO Configuration | Audit logging of SSO configuration | TC-SA-INT-1-009 |
| 1.2 Grade Passback | Passback scope (assessments, quizzes, mock tests) | TC-SA-INT-2-001 |
| 1.2 Grade Passback | Grade mapping (platform score to LMS scale) | TC-SA-INT-2-002 |
| 1.2 Grade Passback | Passback trigger (completion, publish, scheduled) | TC-SA-INT-2-003 |
| 1.2 Grade Passback | Passback log (what, when, result) | TC-SA-INT-2-004 |
| 1.2 Grade Passback | Rule: no grade mapping → not pushed, flagged | TC-SA-INT-2-005 |
| 1.2 Grade Passback | Rule: failure retried per policy and logged | TC-SA-INT-2-006 |
| 1.2 Grade Passback | Rule: student not in roster → held and flagged | TC-SA-INT-2-007 |
| 1.2 Grade Passback | Rule: re-published score overwrites pushed grade | TC-SA-INT-2-008 |
| 1.2 Grade Passback | Audit logging of grade passback | TC-SA-INT-2-009 |
| 1.3 Roster Synchronization | Sync direction (LMS → platform, bidirectional) | TC-SA-INT-3-001 |
| 1.3 Roster Synchronization | Sync scope (institutions, courses, sections) | TC-SA-INT-3-002 |
| 1.3 Roster Synchronization | Sync frequency (real-time, scheduled, manual) | TC-SA-INT-3-003 |
| 1.3 Roster Synchronization | New/changed/removed handling | TC-SA-INT-3-004 |
| 1.3 Roster Synchronization | Rule: removed student deactivated, not deleted | TC-SA-INT-3-005 |
| 1.3 Roster Synchronization | Rule: conflict resolved by LMS as source of truth | TC-SA-INT-3-006 |
| 1.3 Roster Synchronization | Rule: failure leaves last good roster intact | TC-SA-INT-3-007 |
| 1.3 Roster Synchronization | Rule: partial sync reports per-course results | TC-SA-INT-3-008 |
| 1.3 Roster Synchronization | Audit logging of roster synchronization | TC-SA-INT-3-009 |
| 1.4 Assignment Passback | Passback scope (assignments, tasks, study plans) | TC-SA-INT-4-001 |
| 1.4 Assignment Passback | Assignment mapping (platform to LMS) | TC-SA-INT-4-002 |
| 1.4 Assignment Passback | Due-date and points mapping | TC-SA-INT-4-003 |
| 1.4 Assignment Passback | Passback log and status | TC-SA-INT-4-004 |
| 1.4 Assignment Passback | Rule: no LMS mapping → not pushed, flagged | TC-SA-INT-4-005 |
| 1.4 Assignment Passback | Rule: due-date conflict resolved by configured source | TC-SA-INT-4-006 |
| 1.4 Assignment Passback | Rule: failure retried and logged | TC-SA-INT-4-007 |
| 1.4 Assignment Passback | Rule: deleted assignment removed from LMS per rule | TC-SA-INT-4-008 |
| 1.4 Assignment Passback | Audit logging of assignment passback | TC-SA-INT-4-009 |
| 1.5 Supported LMS Providers | Provider list (Canvas, Moodle, Blackboard, Classroom, custom) | TC-SA-INT-5-001 |
| 1.5 Supported LMS Providers | Per-provider connection settings | TC-SA-INT-5-002 |
| 1.5 Supported LMS Providers | Provider enable/disable | TC-SA-INT-5-003 |
| 1.5 Supported LMS Providers | Connection test and status | TC-SA-INT-5-004 |
| 1.5 Supported LMS Providers | Rule: invalid credentials → test fails, stays disabled | TC-SA-INT-5-005 |
| 1.5 Supported LMS Providers | Rule: disabled provider suspends its integrations | TC-SA-INT-5-006 |
| 1.5 Supported LMS Providers | Rule: credential change requires re-test | TC-SA-INT-5-007 |
| 1.5 Supported LMS Providers | Rule: custom provider requires all endpoints | TC-SA-INT-5-008 |
| 1.5 Supported LMS Providers | Audit logging of supported LMS providers | TC-SA-INT-5-009 |

## 1.1 Single Sign-On (SSO) Configuration

### TC-SA-INT-1-001 — SSO protocol (SAML 2.0, OIDC)
**Type:** Positive
**Covers:** 1.1 → SSO protocol
**Preconditions:** A Super Admin account is active; an LMS provider is connected.
**Steps:**
1. As a Super Admin, open Integrations & APIs → LMS Integration → SSO and set the SSO protocol (SAML 2.0 or OIDC).
2. Complete the SSO flow and verify it uses the configured protocol.
**Expected Result:** SSO protocol — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-1-002 — IdP metadata and entity ID
**Type:** Positive
**Covers:** 1.1 → IdP metadata
**Preconditions:** The SSO protocol is set.
**Steps:**
1. Upload the IdP metadata and set the entity ID.
2. Verify the IdP is recognized and the SSO flow targets it.
**Expected Result:** IdP metadata and entity ID — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-1-003 — Attribute mapping (LMS attributes to roles)
**Type:** Positive
**Covers:** 1.1 → Attribute mapping
**Preconditions:** The IdP is configured.
**Steps:**
1. Map the LMS user attributes to platform roles.
2. Sign in via SSO and verify the user receives the mapped role.
**Expected Result:** Attribute mapping — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-1-004 — SSO scope (users, institutions, plans)
**Type:** Positive
**Covers:** 1.1 → SSO scope
**Preconditions:** SSO is configured.
**Steps:**
1. Set the SSO scope to specific institutions and verify only those institutions use SSO.
2. Set it to all users and verify SSO is available platform-wide.
**Expected Result:** SSO scope — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-1-005 — Rule: invalid IdP metadata rejected
**Type:** Negative
**Covers:** 1.1 → Rule: invalid metadata
**Preconditions:** A Super Admin is configuring SSO.
**Steps:**
1. Upload an invalid IdP metadata file.
2. Verify the file is rejected with the reason.
**Expected Result:** An invalid IdP metadata file is rejected with the reason — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-1-006 — Rule: unmapped required attribute blocks activation
**Type:** Negative
**Covers:** 1.1 → Rule: required attribute
**Preconditions:** A required attribute is left unmapped.
**Steps:**
1. Attempt to activate SSO.
2. Verify activation is blocked until the attribute is mapped.
**Expected Result:** An unmapped required attribute blocks SSO activation — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-1-007 — Rule: SSO failure fallback (password or blocked)
**Type:** Negative
**Covers:** 1.1 → Rule: failure fallback
**Preconditions:** SSO is active; the IdP is unreachable.
**Steps:**
1. Attempt an SSO sign-in while the IdP is down.
2. Verify the configured fallback applies (password login or blocked).
**Expected Result:** An SSO failure applies the configured fallback (password login or blocked) — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-1-008 — Rule: SSO disabled → password login only
**Type:** Edge
**Covers:** 1.1 → Rule: SSO disabled
**Preconditions:** SSO is disabled for a provider.
**Steps:**
1. Attempt to sign in to the provider's users.
2. Verify only password login is available.
**Expected Result:** A provider with SSO disabled uses password login only — delivered exactly as documented.
**Priority:** Medium

### TC-SA-INT-1-009 — Audit logging of SSO configuration
**Type:** Positive
**Covers:** 1.1 → Audit logging
**Preconditions:** SSO configuration changes have been made.
**Steps:**
1. Open the audit trail and filter by SSO configuration.
2. Verify entries show the setting, the change, and the timestamp.
**Expected Result:** Audit logging of SSO configuration — delivered exactly as documented.
**Priority:** Critical

## 1.2 Grade Passback

### TC-SA-INT-2-001 — Passback scope (assessments, quizzes, mock tests)
**Type:** Positive
**Covers:** 1.2 → Passback scope
**Preconditions:** A Super Admin is configuring grade passback.
**Steps:**
1. Set the passback scope (assessments, quizzes, mock tests).
2. Complete an in-scope assessment and verify the grade is pushed to the LMS.
**Expected Result:** Passback scope — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-2-002 — Grade mapping (platform score to LMS scale)
**Type:** Positive
**Covers:** 1.2 → Grade mapping
**Preconditions:** Grade passback is configured.
**Steps:**
1. Define the grade mapping (platform score to LMS grade scale).
2. Push a grade and verify it appears on the LMS scale per the mapping.
**Expected Result:** Grade mapping — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-2-003 — Passback trigger (completion, publish, scheduled)
**Type:** Positive
**Covers:** 1.2 → Passback trigger
**Preconditions:** Grade passback is configured.
**Steps:**
1. Set the trigger to on-completion and verify the grade pushes when the assessment is completed.
2. Set it to on-publish and scheduled and verify each trigger fires correctly.
**Expected Result:** Passback trigger — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-2-004 — Passback log (what, when, result)
**Type:** Positive
**Covers:** 1.2 → Passback log
**Preconditions:** Grade passbacks have occurred.
**Steps:**
1. Open the passback log.
2. Verify entries show what was pushed, when, and the result.
**Expected Result:** Passback log — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-2-005 — Rule: no grade mapping → not pushed, flagged
**Type:** Negative
**Covers:** 1.2 → Rule: no mapping
**Preconditions:** A score has no LMS grade mapping.
**Steps:**
1. Trigger the passback for the score.
2. Verify the score is not pushed and is flagged.
**Expected Result:** A score with no LMS grade mapping is not pushed and is flagged — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-2-006 — Rule: failure retried per policy and logged
**Type:** Negative
**Covers:** 1.2 → Rule: retry
**Preconditions:** The LMS is temporarily unavailable.
**Steps:**
1. Trigger a passback that fails.
2. Verify it is retried per the retry policy and the failure is logged.
**Expected Result:** A passback failure is retried per the retry policy and logged — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-2-007 — Rule: student not in roster → held and flagged
**Type:** Negative
**Covers:** 1.2 → Rule: missing roster
**Preconditions:** A grade belongs to a student not in the LMS roster.
**Steps:**
1. Trigger the passback for the grade.
2. Verify the grade is held and flagged (not pushed, not lost).
**Expected Result:** A grade for a student not in the LMS roster is held and flagged — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-2-008 — Rule: re-published score overwrites pushed grade
**Type:** Negative
**Covers:** 1.2 → Rule: overwrite
**Preconditions:** A grade was previously pushed; the score is re-published.
**Steps:**
1. Re-publish the score.
2. Verify the previously pushed grade is overwritten in the LMS.
**Expected Result:** A re-published score overwrites the previously pushed grade — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-2-009 — Audit logging of grade passback
**Type:** Positive
**Covers:** 1.2 → Audit logging
**Preconditions:** Grade passback configuration changes have been made.
**Steps:**
1. Open the audit trail and filter by grade passback.
2. Verify entries show the setting, the change, and the timestamp.
**Expected Result:** Audit logging of grade passback — delivered exactly as documented.
**Priority:** Critical

## 1.3 Roster Synchronization

### TC-SA-INT-3-001 — Sync direction (LMS → platform, bidirectional)
**Type:** Positive
**Covers:** 1.3 → Sync direction
**Preconditions:** A Super Admin is configuring roster sync.
**Steps:**
1. Set the sync direction to LMS → platform and verify enrollments flow one way.
2. Set it to bidirectional and verify enrollments flow both ways.
**Expected Result:** Sync direction — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-3-002 — Sync scope (institutions, courses, sections)
**Type:** Positive
**Covers:** 1.3 → Sync scope
**Preconditions:** Roster sync is configured.
**Steps:**
1. Set the sync scope to specific institutions/courses/sections.
2. Run a sync and verify only in-scope enrollments are synced.
**Expected Result:** Sync scope — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-3-003 — Sync frequency (real-time, scheduled, manual)
**Type:** Positive
**Covers:** 1.3 → Sync frequency
**Preconditions:** Roster sync is configured.
**Steps:**
1. Set the frequency to scheduled and verify syncs run on schedule.
2. Set it to manual and verify syncs run only on demand.
**Expected Result:** Sync frequency — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-3-004 — New/changed/removed handling
**Type:** Positive
**Covers:** 1.3 → New/changed/removed handling
**Preconditions:** Roster sync is configured.
**Steps:**
1. Configure the handling (add, update, deactivate).
2. Run a sync with new, changed, and removed students and verify each is handled per the rule.
**Expected Result:** New/changed/removed handling — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-3-005 — Rule: removed student deactivated, not deleted
**Type:** Negative
**Covers:** 1.3 → Rule: removal handling
**Preconditions:** A student is removed in the LMS.
**Steps:**
1. Run the roster sync.
2. Verify the student is deactivated on the platform, not hard-deleted.
**Expected Result:** A removed student is deactivated, not hard-deleted — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-3-006 — Rule: conflict resolved by LMS as source of truth
**Type:** Negative
**Covers:** 1.3 → Rule: conflict resolution
**Preconditions:** The same student has different data in the LMS and the platform.
**Steps:**
1. Run the roster sync.
2. Verify the conflict is resolved with the LMS as source of truth.
**Expected Result:** A roster conflict is resolved with the LMS as source of truth — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-3-007 — Rule: failure leaves last good roster intact
**Type:** Negative
**Covers:** 1.3 → Rule: failure safety
**Preconditions:** The LMS is unavailable during a sync.
**Steps:**
1. Run a sync that fails.
2. Verify the last good roster is intact and the failure is logged.
**Expected Result:** A sync failure leaves the last good roster intact and is logged — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-3-008 — Rule: partial sync reports per-course results
**Type:** Edge
**Covers:** 1.3 → Rule: partial sync
**Preconditions:** A sync covers multiple courses; one course fails.
**Steps:**
1. Run the sync.
2. Verify per-course results are reported (success and failure per course).
**Expected Result:** A partial sync reports per-course results — delivered exactly as documented.
**Priority:** Medium

### TC-SA-INT-3-009 — Audit logging of roster synchronization
**Type:** Positive
**Covers:** 1.3 → Audit logging
**Preconditions:** Roster sync configuration changes have been made.
**Steps:**
1. Open the audit trail and filter by roster synchronization.
2. Verify entries show the setting, the change, and the timestamp.
**Expected Result:** Audit logging of roster synchronization — delivered exactly as documented.
**Priority:** Critical

## 1.4 Assignment Passback

### TC-SA-INT-4-001 — Passback scope (assignments, tasks, study plans)
**Type:** Positive
**Covers:** 1.4 → Passback scope
**Preconditions:** A Super Admin is configuring assignment passback.
**Steps:**
1. Set the passback scope (assignments, tasks, study plans).
2. Create an in-scope assignment and verify it is pushed to the LMS.
**Expected Result:** Passback scope — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-4-002 — Assignment mapping (platform to LMS)
**Type:** Positive
**Covers:** 1.4 → Assignment mapping
**Preconditions:** Assignment passback is configured.
**Steps:**
1. Define the assignment mapping (platform assignment to LMS assignment).
2. Push an assignment and verify it maps correctly in the LMS.
**Expected Result:** Assignment mapping — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-4-003 — Due-date and points mapping
**Type:** Positive
**Covers:** 1.4 → Due-date and points mapping
**Preconditions:** Assignment passback is configured.
**Steps:**
1. Map the due dates and points.
2. Push an assignment and verify the due date and points appear correctly in the LMS.
**Expected Result:** Due-date and points mapping — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-4-004 — Passback log and status
**Type:** Positive
**Covers:** 1.4 → Passback log
**Preconditions:** Assignment passbacks have occurred.
**Steps:**
1. Open the passback log.
2. Verify entries show the assignment, the status, and the timestamp.
**Expected Result:** Passback log and status — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-4-005 — Rule: no LMS mapping → not pushed, flagged
**Type:** Negative
**Covers:** 1.4 → Rule: no mapping
**Preconditions:** An assignment has no LMS mapping.
**Steps:**
1. Trigger the passback for the assignment.
2. Verify it is not pushed and is flagged.
**Expected Result:** An assignment with no LMS mapping is not pushed and is flagged — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-4-006 — Rule: due-date conflict resolved by configured source
**Type:** Negative
**Covers:** 1.4 → Rule: due-date conflict
**Preconditions:** The platform and LMS have different due dates for an assignment.
**Steps:**
1. Push the assignment.
2. Verify the due-date conflict is resolved by the configured source.
**Expected Result:** A due-date conflict is resolved by the configured source — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-4-007 — Rule: failure retried and logged
**Type:** Negative
**Covers:** 1.4 → Rule: retry
**Preconditions:** The LMS is temporarily unavailable.
**Steps:**
1. Trigger a passback that fails.
2. Verify it is retried and the failure is logged.
**Expected Result:** A passback failure is retried and logged — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-4-008 — Rule: deleted assignment removed from LMS per rule
**Type:** Negative
**Covers:** 1.4 → Rule: deletion handling
**Preconditions:** A pushed assignment is deleted on the platform.
**Steps:**
1. Delete the assignment.
2. Verify it is removed from the LMS per the handling rule.
**Expected Result:** A deleted platform assignment is removed from the LMS per the handling rule — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-4-009 — Audit logging of assignment passback
**Type:** Positive
**Covers:** 1.4 → Audit logging
**Preconditions:** Assignment passback configuration changes have been made.
**Steps:**
1. Open the audit trail and filter by assignment passback.
2. Verify entries show the setting, the change, and the timestamp.
**Expected Result:** Audit logging of assignment passback — delivered exactly as documented.
**Priority:** Critical

## 1.5 Supported LMS Providers

### TC-SA-INT-5-001 — Provider list (Canvas, Moodle, Blackboard, Classroom, custom)
**Type:** Positive
**Covers:** 1.5 → Provider list
**Preconditions:** A Super Admin is managing LMS providers.
**Steps:**
1. Open LMS Integration → Providers.
2. Verify the provider list includes Canvas, Moodle, Blackboard, Google Classroom, and custom.
**Expected Result:** Provider list — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-5-002 — Per-provider connection settings
**Type:** Positive
**Covers:** 1.5 → Connection settings
**Preconditions:** A provider is selected.
**Steps:**
1. Enter the connection settings (credentials, endpoints, scopes).
2. Save and verify the settings are stored per provider.
**Expected Result:** Per-provider connection settings — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-5-003 — Provider enable/disable
**Type:** Positive
**Covers:** 1.5 → Enable/disable
**Preconditions:** A provider is configured.
**Steps:**
1. Enable the provider and verify it is active.
2. Disable the provider and verify it is inactive.
**Expected Result:** Provider enable/disable — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-5-004 — Connection test and status
**Type:** Positive
**Covers:** 1.5 → Connection test
**Preconditions:** A provider's connection settings are entered.
**Steps:**
1. Run a connection test.
2. Verify the connection status reflects the test result.
**Expected Result:** Connection test and status — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-5-005 — Rule: invalid credentials → test fails, stays disabled
**Type:** Negative
**Covers:** 1.5 → Rule: invalid credentials
**Preconditions:** A provider has invalid credentials.
**Steps:**
1. Run the connection test.
2. Verify the test fails and the provider stays disabled.
**Expected Result:** A provider with invalid credentials fails the connection test and stays disabled — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-5-006 — Rule: disabled provider suspends its integrations
**Type:** Negative
**Covers:** 1.5 → Rule: suspension
**Preconditions:** A provider with active SSO/passback/sync is disabled.
**Steps:**
1. Disable the provider.
2. Verify its integrations (SSO, passback, sync) are suspended.
**Expected Result:** A disabled provider's integrations are suspended — delivered exactly as documented.
**Priority:** Critical

### TC-SA-INT-5-007 — Rule: credential change requires re-test
**Type:** Negative
**Covers:** 1.5 → Rule: re-test
**Preconditions:** A provider's credentials are changed.
**Steps:**
1. Change the credentials.
2. Verify re-activation requires a re-test first.
**Expected Result:** A credential change requires a re-test before re-activation — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-5-008 — Rule: custom provider requires all endpoints
**Type:** Negative
**Covers:** 1.5 → Rule: custom provider
**Preconditions:** A custom provider is missing a required endpoint.
**Steps:**
1. Attempt to enable the custom provider.
2. Verify it cannot be enabled until all required endpoints are defined.
**Expected Result:** A custom provider requires all required endpoints to be defined — delivered exactly as documented.
**Priority:** High

### TC-SA-INT-5-009 — Audit logging of supported LMS providers
**Type:** Positive
**Covers:** 1.5 → Audit logging
**Preconditions:** Provider configuration changes have been made.
**Steps:**
1. Open the audit trail and filter by supported LMS providers.
2. Verify entries show the setting, the change, and the timestamp.
**Expected Result:** Audit logging of supported LMS providers — delivered exactly as documented.
**Priority:** Critical
