# 3. Campaign Targeting — Test Cases

User Type: **Super Administrator**
Source: *Mi Digital Academy - Education CRM Features Document*
Spec: campaign_targeting.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 |
|---------|--------------------|----------|
| 3.1 Targeted Promotions by User Segment | Segment definition: the segment (the new users, the returning users, the lapsed users, the high-value users) | TC-SA-13-03-001 |
| 3.1 Targeted Promotions by User Segment | Segment scope: the scope (the segment, the promotion) | TC-SA-13-03-002 |
| 3.1 Targeted Promotions by User Segment | Segment offer: the offer (the discount, the freebie) | TC-SA-13-03-003 |
| 3.1 Targeted Promotions by User Segment | Segment period: the period (the start, the end) | TC-SA-13-03-004 |
| 3.1 Targeted Promotions by User Segment | Targeting definition: the targeting defined by the Super Admin (the segment, the offer, the period) | TC-SA-13-03-001 |
| 3.1 Targeted Promotions by User Segment | Targeting application: the targeting applied (the segment gets the offer) | TC-SA-13-03-005 |
| 3.1 Targeted Promotions by User Segment | Audit logging of the targeting definition and the application | TC-SA-13-03-006 |
| 3.1 Targeted Promotions by User Segment | Rule: the segment is explicit (the new users, the returning users, the lapsed users, the high-value users); the segment is the audience | TC-SA-13-03-001 |
| 3.1 Targeted Promotions by User Segment | Rule: the segment scope is the segment and the promotion; the scope is the control | TC-SA-13-03-002 |
| 3.1 Targeted Promotions by User Segment | Rule: the segment offer is the value (the discount, the freebie); the offer is the incentive | TC-SA-13-03-003 |
| 3.1 Targeted Promotions by User Segment | Rule: a targeting change (the segment, the offer, the period updated) is recorded (the new segment, the new offer, the new period); it is auditable | TC-SA-13-03-007 |
| 3.1 Targeted Promotions by User Segment | Rule: the segment targeting is visible (the segments, the offers, the periods, the performance); the targeting is managed | TC-SA-13-03-008 |
| 3.1 Targeted Promotions by User Segment | Rule: targeting definition and application are audit-logged with the segment, offer, and timestamp | TC-SA-13-03-006 |
| 3.2 Personalized Course Recommendations | Recommendation rule: the rule (the profile, the history, the courses) | TC-SA-13-03-009 |
| 3.2 Personalized Course Recommendations | Recommendation scope: the scope (the user, the recommendations) | TC-SA-13-03-010 |
| 3.2 Personalized Course Recommendations | Recommendation profile: the profile (the user's profile, the user's interests) | TC-SA-13-03-011 |
| 3.2 Personalized Course Recommendations | Recommendation history: the history (the user's history, the user's courses) | TC-SA-13-03-012 |
| 3.2 Personalized Course Recommendations | Recommendation courses: the courses (the courses that fit the user) | TC-SA-13-03-013 |
| 3.2 Personalized Course Recommendations | Rule definition: the rules defined by the Super Admin (the profile, the history, the courses) | TC-SA-13-03-009 |
| 3.2 Personalized Course Recommendations | Audit logging of the recommendation rules and the applications | TC-SA-13-03-014 |
| 3.2 Personalized Course Recommendations | Rule: the recommendation rule is explicit (the profile, the history, the courses); the rule is the structure | TC-SA-13-03-009 |
| 3.2 Personalized Course Recommendations | Rule: the recommendation scope is the user and the recommendations; the scope is the control | TC-SA-13-03-010 |
| 3.2 Personalized Course Recommendations | Rule: the recommendation profile is the basis (the user's profile, the user's interests); the profile is the input | TC-SA-13-03-011 |
| 3.2 Personalized Course Recommendations | Rule: a rule change (the profile, the history, the courses updated) is recorded (the new profile, the new history, the new courses); it is auditable | TC-SA-13-03-015 |
| 3.2 Personalized Course Recommendations | Rule: the recommendations are visible (the users, the profiles, the histories, the courses, the performance); the personalization is managed | TC-SA-13-03-016 |
| 3.2 Personalized Course Recommendations | Rule: recommendation rules and applications are audit-logged with the user, profile, and timestamp | TC-SA-13-03-014 |
| 3.3 A/B Testing for Campaigns | A/B test: the test (the variant A, the variant B, the split, the metric) | TC-SA-13-03-017 |
| 3.3 A/B Testing for Campaigns | Test scope: the scope (the campaign, the test) | TC-SA-13-03-018 |
| 3.3 A/B Testing for Campaigns | Variant A: the variant (the variant A, the offer A) | TC-SA-13-03-019 |
| 3.3 A/B Testing for Campaigns | Variant B: the variant (the variant B, the offer B) | TC-SA-13-03-020 |
| 3.3 A/B Testing for Campaigns | Test split: the split (the split of the users, e.g., 50/50) | TC-SA-13-03-021 |
| 3.3 A/B Testing for Campaigns | Test metric: the metric (the metric, e.g., the conversion rate) | TC-SA-13-03-022 |
| 3.3 A/B Testing for Campaigns | Audit logging of the A/B test definition and the results | TC-SA-13-03-023 |
| 3.3 A/B Testing for Campaigns | Rule: the A/B test is explicit (the variant A, the variant B, the split, the metric); the test is the structure | TC-SA-13-03-017 |
| 3.3 A/B Testing for Campaigns | Rule: the test scope is the campaign and the test; the scope is the control | TC-SA-13-03-018 |
| 3.3 A/B Testing for Campaigns | Rule: the variant A is the control (the offer A); the variant is the baseline | TC-SA-13-03-019 |
| 3.3 A/B Testing for Campaigns | Rule: a test change (the variant A, the variant B, the split, the metric updated) is recorded (the new variant A, the new variant B, the new split, the new metric); it is auditable | TC-SA-13-03-024 |
| 3.3 A/B Testing for Campaigns | Rule: the A/B tests are visible (the campaigns, the variants, the splits, the metrics, the results); the testing is managed | TC-SA-13-03-025 |
| 3.3 A/B Testing for Campaigns | Rule: A/B test definition and results are audit-logged with the campaign, variants, and timestamp | TC-SA-13-03-023 |

## 3.1 Targeted Promotions by User Segment

### TC-SA-13-03-001 — Segment definition: the segment (the new users, the returning users, the lapsed users, the high-value users); the segment is explicit
**Type:** Positive
**Covers:** 3.1 → Segment definition: the segment (the new users, the returning users, the lapsed users, the high-value users); Targeting definition: the targeting defined by the Super Admin (the segment, the offer, the period); Rule: the segment is explicit (the new users, the returning users, the lapsed users, the high-value users); the segment is the audience
**Preconditions:** The Super Admin opens the campaign targeting.
**Steps:**
1. Define the segment targeting: the segment (the new users, the returning users, the lapsed users, the high-value users), the offer (the discount, the freebie), and the period (the start, the end).
2. Save the targeting.
3. Verify the segment targeting is live and the segment gets the offer (the targeting is applied).
**Expected Result:** The segment targeting is defined (the segment, the offer, the period) — the segment is explicit.
**Priority:** Critical

### TC-SA-13-03-002 — Segment scope: the scope (the segment, the promotion); the scope is the control
**Type:** Positive
**Covers:** 3.1 → Segment scope: the scope (the segment, the promotion); Rule: the segment scope is the segment and the promotion; the scope is the control
**Preconditions:** A segment targeting is defined.
**Steps:**
1. Open the segment scope.
2. Verify the scope is the segment and the promotion.
3. Verify the scope is the control.
**Expected Result:** The segment scope is the segment and the promotion — the scope is the control.
**Priority:** Medium

### TC-SA-13-03-003 — Segment offer: the offer (the discount, the freebie); the offer is the incentive
**Type:** Positive
**Covers:** 3.1 → Segment offer: the offer (the discount, the freebie); Rule: the segment offer is the value (the discount, the freebie); the offer is the incentive
**Preconditions:** A segment targeting is defined with an offer.
**Steps:**
1. Open the segment offer.
2. Verify the offer is the discount or the freebie.
3. Verify the offer is the incentive for the segment.
**Expected Result:** The segment offer is the value — the discount or the freebie is the incentive.
**Priority:** High

### TC-SA-13-03-004 — Segment period: the period (the start, the end); the period is the timing
**Type:** Positive
**Covers:** 3.1 → Segment period: the period (the start, the end)
**Preconditions:** A segment targeting is defined with a period.
**Steps:**
1. Open the segment period.
2. Verify the period is the start and the end.
3. Verify the period is the timing of the targeting.
**Expected Result:** The segment period is the start and the end — the period is the timing.
**Priority:** High

### TC-SA-13-03-005 — Targeting application: the targeting applied (the segment gets the offer); users outside the segment do not get the offer
**Type:** Negative
**Covers:** 3.1 → Targeting application: the targeting applied (the segment gets the offer)
**Preconditions:** A segment targeting is live for the lapsed users segment.
**Steps:**
1. As a lapsed user, verify the offer is shown (the segment gets the offer).
2. As a new user (outside the segment), verify the offer is not shown.
3. Verify the targeting is applied only to the segment.
**Expected Result:** The targeting is applied — the segment gets the offer and users outside the segment do not.
**Priority:** Critical

### TC-SA-13-03-006 — Targeting definition and application are audit-logged with the segment, offer, and timestamp
**Type:** Positive
**Covers:** 3.1 → Audit logging of the targeting definition and the application; Rule: targeting definition and application are audit-logged with the segment, offer, and timestamp
**Preconditions:** Targeting definition and application events have occurred.
**Steps:**
1. Open the audit trail and filter by "segment targeting".
2. Verify entries show the segment, the offer, and the timestamp.
**Expected Result:** The targeting definition and application are audit-logged with the segment, offer, and timestamp.
**Priority:** Critical

### TC-SA-13-03-007 — A targeting change (the segment, the offer, the period updated) is recorded (the new segment, the new offer, the new period); it is auditable
**Type:** Positive
**Covers:** 3.1 → Rule: a targeting change (the segment, the offer, the period updated) is recorded (the new segment, the new offer, the new period); it is auditable
**Preconditions:** A segment targeting is live.
**Steps:**
1. Change the targeting (the new segment, the new offer, the new period).
2. Verify the targeting is updated.
3. Verify the change is recorded and auditable.
**Expected Result:** The targeting change is recorded (the new segment, the new offer, the new period) — it is auditable.
**Priority:** High

### TC-SA-13-03-008 — The segment targeting is visible (the segments, the offers, the periods, the performance); the targeting is managed
**Type:** Positive
**Covers:** 3.1 → Rule: the segment targeting is visible (the segments, the offers, the periods, the performance); the targeting is managed
**Preconditions:** Multiple segment targetings exist.
**Steps:**
1. Open the segment targeting view.
2. Verify the segments, the offers, the periods, and the performance (the redemptions, the revenue per segment) are visible.
3. Verify the targeting is managed.
**Expected Result:** The segment targeting is visible — the segments, the offers, the periods, and the performance are shown.
**Priority:** Medium

## 3.2 Personalized Course Recommendations

### TC-SA-13-03-009 — Rule definition: the rules defined by the Super Admin (the profile, the history, the courses); the rule is explicit
**Type:** Positive
**Covers:** 3.2 → Recommendation rule: the rule (the profile, the history, the courses); Rule definition: the rules defined by the Super Admin (the profile, the history, the courses); Rule: the recommendation rule is explicit (the profile, the history, the courses); the rule is the structure
**Preconditions:** The Super Admin opens the campaign targeting.
**Steps:**
1. Configure the recommendation rules: the profile (the user's profile, the user's interests), the history (the user's history, the user's courses), and the courses (the courses that fit the user).
2. Save the rules.
3. Verify the recommendation rules are live and the recommendations are personalized (the user gets the courses that fit them).
**Expected Result:** The recommendation rules are defined (the profile, the history, the courses) — the rule is explicit.
**Priority:** Critical

### TC-SA-13-03-010 — Recommendation scope: the scope (the user, the recommendations); the scope is the control
**Type:** Positive
**Covers:** 3.2 → Recommendation scope: the scope (the user, the recommendations); Rule: the recommendation scope is the user and the recommendations; the scope is the control
**Preconditions:** The recommendation rules are configured.
**Steps:**
1. Open the recommendation scope.
2. Verify the scope is the user and the recommendations.
3. Verify the scope is the control.
**Expected Result:** The recommendation scope is the user and the recommendations — the scope is the control.
**Priority:** Medium

### TC-SA-13-03-011 — Recommendation profile: the profile (the user's profile, the user's interests); the profile is the input
**Type:** Positive
**Covers:** 3.2 → Recommendation profile: the profile (the user's profile, the user's interests); Rule: the recommendation profile is the basis (the user's profile, the user's interests); the profile is the input
**Preconditions:** The recommendation rules are configured.
**Steps:**
1. Open the recommendation profile.
2. Verify the profile is the user's profile and the user's interests.
3. Verify the profile is the basis and the input for the recommendations.
**Expected Result:** The recommendation profile is the user's profile and interests — the profile is the input.
**Priority:** High

### TC-SA-13-03-012 — Recommendation history: the history (the user's history, the user's courses); the history is the context
**Type:** Positive
**Covers:** 3.2 → Recommendation history: the history (the user's history, the user's courses)
**Preconditions:** The recommendation rules are configured.
**Steps:**
1. Open the recommendation history.
2. Verify the history is the user's history and the user's courses.
3. Verify the history is the context for the recommendations.
**Expected Result:** The recommendation history is the user's history and courses — the history is the context.
**Priority:** High

### TC-SA-13-03-013 — Recommendation courses: the courses (the courses that fit the user); the user gets the courses that fit them
**Type:** Positive
**Covers:** 3.2 → Recommendation courses: the courses (the courses that fit the user)
**Preconditions:** The recommendation rules are live and a user has a profile and history.
**Steps:**
1. As the user, view the recommendations.
2. Verify the courses shown are the courses that fit the user (based on the profile and history).
3. Verify the recommendations are personalized.
**Expected Result:** The recommendation courses are the courses that fit the user — the recommendations are personalized.
**Priority:** Critical

### TC-SA-13-03-014 — Recommendation rules and applications are audit-logged with the user, profile, and timestamp
**Type:** Positive
**Covers:** 3.2 → Audit logging of the recommendation rules and the applications; Rule: recommendation rules and applications are audit-logged with the user, profile, and timestamp
**Preconditions:** Recommendation rule and application events have occurred.
**Steps:**
1. Open the audit trail and filter by "recommendation".
2. Verify entries show the user, the profile, and the timestamp.
**Expected Result:** The recommendation rules and applications are audit-logged with the user, profile, and timestamp.
**Priority:** Critical

### TC-SA-13-03-015 — A rule change (the profile, the history, the courses updated) is recorded (the new profile, the new history, the new courses); it is auditable
**Type:** Positive
**Covers:** 3.2 → Rule: a rule change (the profile, the history, the courses updated) is recorded (the new profile, the new history, the new courses); it is auditable
**Preconditions:** The recommendation rules are live.
**Steps:**
1. Change the rules (the new profile, the new history, the new courses).
2. Verify the rules are updated.
3. Verify the change is recorded and auditable.
**Expected Result:** The rule change is recorded (the new profile, the new history, the new courses) — it is auditable.
**Priority:** High

### TC-SA-13-03-016 — The recommendations are visible (the users, the profiles, the histories, the courses, the performance); the personalization is managed
**Type:** Positive
**Covers:** 3.2 → Rule: the recommendations are visible (the users, the profiles, the histories, the courses, the performance); the personalization is managed
**Preconditions:** The recommendation rules are live with recommendations generated.
**Steps:**
1. Open the recommendations view.
2. Verify the users, the profiles, the histories, the courses, and the performance (the clicks, the enrollments per recommendation) are visible.
3. Verify the personalization is managed.
**Expected Result:** The recommendations are visible — the users, the profiles, the histories, the courses, and the performance are shown.
**Priority:** Medium

## 3.3 A/B Testing for Campaigns

### TC-SA-13-03-017 — A/B test: the test (the variant A, the variant B, the split, the metric); the test is explicit
**Type:** Positive
**Covers:** 3.3 → A/B test: the test (the variant A, the variant B, the split, the metric); Rule: the A/B test is explicit (the variant A, the variant B, the split, the metric); the test is the structure
**Preconditions:** The Super Admin opens the campaign targeting.
**Steps:**
1. Define the A/B test: the variant A (the offer A), the variant B (the offer B), the split (the split of the users, e.g., 50/50), and the metric (the metric, e.g., the conversion rate).
2. Save the test.
3. Verify the A/B test is live and running (the variants are compared, the metric is tracked).
**Expected Result:** The A/B test is defined (the variant A, the variant B, the split, the metric) — the test is explicit.
**Priority:** Critical

### TC-SA-13-03-018 — Test scope: the scope (the campaign, the test); the scope is the control
**Type:** Positive
**Covers:** 3.3 → Test scope: the scope (the campaign, the test); Rule: the test scope is the campaign and the test; the scope is the control
**Preconditions:** An A/B test is defined.
**Steps:**
1. Open the test scope.
2. Verify the scope is the campaign and the test.
3. Verify the scope is the control.
**Expected Result:** The test scope is the campaign and the test — the scope is the control.
**Priority:** Medium

### TC-SA-13-03-019 — Variant A: the variant (the variant A, the offer A); the variant is the baseline
**Type:** Positive
**Covers:** 3.3 → Variant A: the variant (the variant A, the offer A); Rule: the variant A is the control (the offer A); the variant is the baseline
**Preconditions:** An A/B test is defined with variant A.
**Steps:**
1. Open the variant A.
2. Verify the variant A is the offer A.
3. Verify the variant A is the control and the baseline.
**Expected Result:** The variant A is the offer A — the variant is the baseline.
**Priority:** High

### TC-SA-13-03-020 — Variant B: the variant (the variant B, the offer B); the variant is the test
**Type:** Positive
**Covers:** 3.3 → Variant B: the variant (the variant B, the offer B)
**Preconditions:** An A/B test is defined with variant B.
**Steps:**
1. Open the variant B.
2. Verify the variant B is the offer B.
3. Verify the variant B is the test variant.
**Expected Result:** The variant B is the offer B — the variant is the test.
**Priority:** High

### TC-SA-13-03-021 — Test split: the split (the split of the users, e.g., 50/50); the users are split as configured
**Type:** Positive
**Covers:** 3.3 → Test split: the split (the split of the users, e.g., 50/50)
**Preconditions:** An A/B test is live with a 50/50 split.
**Steps:**
1. Verify the users are split 50/50 between variant A and variant B.
2. Verify each user sees only one variant.
3. Verify the split is applied as configured.
**Expected Result:** The test split is applied — the users are split as configured (e.g., 50/50).
**Priority:** Critical

### TC-SA-13-03-022 — Test metric: the metric (the metric, e.g., the conversion rate); the metric is tracked
**Type:** Positive
**Covers:** 3.3 → Test metric: the metric (the metric, e.g., the conversion rate)
**Preconditions:** An A/B test is running with a metric.
**Steps:**
1. Open the test metric.
2. Verify the metric is the conversion rate (or the configured metric).
3. Verify the metric is tracked per variant.
**Expected Result:** The test metric is the conversion rate — the metric is tracked per variant.
**Priority:** High

### TC-SA-13-03-023 — A/B test definition and results are audit-logged with the campaign, variants, and timestamp
**Type:** Positive
**Covers:** 3.3 → Audit logging of the A/B test definition and the results; Rule: A/B test definition and results are audit-logged with the campaign, variants, and timestamp
**Preconditions:** A/B test definition and result events have occurred.
**Steps:**
1. Open the audit trail and filter by "A/B test".
2. Verify entries show the campaign, the variants, and the timestamp.
**Expected Result:** The A/B test definition and results are audit-logged with the campaign, variants, and timestamp.
**Priority:** Critical

### TC-SA-13-03-024 — A test change (the variant A, the variant B, the split, the metric updated) is recorded (the new variant A, the new variant B, the new split, the new metric); it is auditable
**Type:** Positive
**Covers:** 3.3 → Rule: a test change (the variant A, the variant B, the split, the metric updated) is recorded (the new variant A, the new variant B, the new split, the new metric); it is auditable
**Preconditions:** An A/B test is live.
**Steps:**
1. Change the test (the new variant A, the new variant B, the new split, the new metric).
2. Verify the test is updated.
3. Verify the change is recorded and auditable.
**Expected Result:** The test change is recorded (the new variant A, the new variant B, the new split, the new metric) — it is auditable.
**Priority:** High

### TC-SA-13-03-025 — The A/B tests are visible (the campaigns, the variants, the splits, the metrics, the results); the testing is managed
**Type:** Positive
**Covers:** 3.3 → Rule: the A/B tests are visible (the campaigns, the variants, the splits, the metrics, the results); the testing is managed
**Preconditions:** Multiple A/B tests exist with results.
**Steps:**
1. Open the A/B tests view.
2. Verify the campaigns, the variants, the splits, the metrics, and the results (the metric per variant, the winner) are visible.
3. Verify the testing is managed.
**Expected Result:** The A/B tests are visible — the campaigns, the variants, the splits, the metrics, and the results are shown.
**Priority:** Medium
