Operations
QA Test Plan
Quality assurance strategy and detailed test scenarios.
QA Test Plan
This document provides a comprehensive quality assurance strategy and test suites for the Questionnaire & Content Management Platform.
1. Test Approach & Scope
Focus on the end-user journey: ensure that users can navigate from the landing page, answer questions, trigger ads, and cleanly unlock/redirect to the final content.
Validating Ads & Tracking
- Ads: Verify ad visibility and "Waterfall" logic (fallback to different KV values) via the Browser's Network Tab.
- Pixels: Use browser extensions like Google Tag Assistant or verify network requests directly.
2. High-Level Test Scenarios
A. Theme-Specific Flows
| Feature | Theme | Test Goal |
|---|---|---|
| Questionnaire Flow | Questionnaire | Verify user can answer questions and is prompted with a CTA button only on the final step. |
| Chat Simulation | Verify chat bubbles load sequentially and Display Ad injects after the first message. | |
| Implicit Trigger | Verify clicking the final option (e.g., "Yes", "View Results") triggers the rewarded ad immediately. | |
| Guide Flow | Guide | Verify questions complete, showing a loader, and establishing a blurred content state. |
| Popup Trigger | Guide | Verify RewardedAdPopupGuide appears automatically over blurred content when the ad is ready. |
| Link Interception | Guide | Edge Case: Click an article link without watching the ad. Verify URL gets ?guideNoAd=1. |
B. Ad Logic & Monetization
| Feature | Test Goal |
|---|---|
| Rewarded Ad | Verify user cannot close the ad early without penalty (should re-trigger or not unlock content). |
| Ad Waterfall | In Network Tab, verify gpt.js requests use correct KV strings (e.g., rewardedKv1Values). |
| KV2 Fallback | Verify no-fill on KV1 triggers the inline KV2 popup. |
3. Detailed Test Cases
3.1 Guide Theme & Content Protection
- Navigate to Category: Open a category page configured with the "Guide" theme.
- Complete Questions: Answer all questions in the modal.
- Verify State:
- Modal should close.
- Loader should appear briefly.
- Page Content should be visible but BLURRED.
- Popup (
RewardedAdPopupGuide) should appear with "Show me how" button.
- Action - Watch Ad: Click "Show me how".
- Expectation: Video ad plays.
- Completion: After ad finishes, popup closes, and blur is REMOVED.
- Action - Bypass Attempt (Refresh page to reset):
- Reach blurred state.
- Click any link in the "articles" list.
- Expectation: URL updates to include
?guideNoAd=1. - Expectation: User is redirected to Article page, where the
ArticleRewardedAdlogic should trigger again.
3.2 WhatsApp Theme "Persistence"
- Navigate to Category: Open a category page configured with "WhatsApp" theme.
- Wait: Allow chat bubbles to load.
- Verify: A display banner ad injects inside the message stream.
- Final Step: Click the final option (e.g., "View Results").
- Expectation: Video ad (Rewarded) opens immediately.
- Action - Close Early: Close the ad explicitly before it finishes.
- Expectation: Ad closes, but immediately re-opens (Persistence Loop).
- Action - Complete Ad: Watch ad to completion.
- Expectation: User redirected to
?sp=1or final destination.
- Expectation: User redirected to
3.3 General Questionnaire Flow
- Navigate to Category: Open standard Questionnaire category.
- Answer: Click through questions.
- Verify: NO CTA button is visible on intermediate steps.
- Final Step: CTA Button ("Watch Ad to Continue") appears.
- Action: Click CTA.
- Expectation: Ad plays.
- Completion: Redirects to
?sp=1.
4. Ad Verification Guide (Network Tab)
Tools: Chrome DevTools → Network Tab
- Open Chrome DevTools → Network Tab.
- Filter by
securepubadsorgampad. - Select a Google Ad Manager request and look at the Query String Parameters.
- Find
cust_params(custom parameters):- It should contain the "key-value" (KV) pairs defined in the database (e.g.,
cust_params=price_rule%3DQAA-AA). - If an ad fails/user retries, verify the next request uses the fallback value (e.g.,
cust_params=price_rule%3DOAA-AA).
- It should contain the "key-value" (KV) pairs defined in the database (e.g.,
5. Pixel Firing Sequence by Theme
Questionnaire Theme
1. User lands on Category Page
→ fireCategoryPageLoadPixel() [after 3s]
2. User clicks through questions
→ NO pixel fires (intermediate steps)
3. User clicks CTA on Final Step
→ fireButtonClickConversion() [first page only]
4. Ad loads successfully
→ fireConversionPixel() [with KV value]
5. User completes ad + clicks CTA
→ fireConversionPixel() [300ms delay]
6. Redirect to ?sp=1 (Second Page)
→ fireButtonClickConversion() [after 1s on second page arrival]
7. User closes ad after reward
→ fireAdClosedPixel()WhatsApp Theme
1. User lands on Category Page
→ fireCategoryPageLoadPixel() [after 3s]
2. User interacts with chat bubbles
→ NO pixel fires
3. User clicks final option (Implicit CTA)
→ fireButtonClickConversion()
4. Rewarded ad plays
→ fireConversionPixel() [on ad received]
5. Ad completes
→ fireConversionPixel() [on button click post-ad]
6. User closes ad
→ fireAdClosedPixel()Guide Theme
1. User lands on Category Page
→ fireCategoryPageLoadPixel() [after 3s]
2. User answers second question
→ fireButtonClickConversion() [special trigger]
3. Questions complete → Content blurred → Ad loads
→ fireConversionPixel() [on ad received, isSecondPage=true]
4. User clicks "Show me how" in popup
→ fireConversionPixel() [300ms delay]
5. User clicks article link (without ad)
→ NO pixel fires, redirects with ?guideNoAd=1
→ Article page triggers ArticleRewardedAd logic6. KV Waterfall & Encoding Details
KV Value Encoding Map
Numeric price values are encoded at the service layer for obfuscation:
| Numeric | Encoded |
|---|---|
0 | A |
1 | C |
2 | E |
3 | G |
4 | I |
5 | K |
6 | M |
7 | O |
8 | Q |
9 | S |
. | - |
- Example:
800.00→QAA-AA - Example:
0.01→A-AC
Default Hardcoded Fallback Arrays
First Page:
["800.00", "700.00", "600.00", "500.00", "425.00", "375.00", "325.00",
"275.00", "220.00", "190.00", "160.00", "160.00", "140.00", "120.00",
"100.00", "85.00", "70.00", "60.00", "55.00", "44.00", "38.00",
"32.00", "28.00", "24.00", "20.00", "17.00", "14.00"]Second Page:
["800.00", "525.00", "350.00", "150.00", "95.00", "65.00", "40.00",
"26.00", "17.00", "11.00", "8.00", "5.00", "3.00", "3.00", "2.00"]7. Cross-Domain Redirection
Cross-domain redirection occurs when the secondPageUrl in the category's adConfig points to an external domain.
Redirection Rules & Same-Domain vs Cross-Domain
| Aspect | Same Domain | Cross-Domain |
|---|---|---|
| Redirect Method | router.push() | window.location.href |
| URL Parameter | ?sp=1 added | No parameter added |
| Second Page Popup | Shows SecondPageRewardedPopup | N/A (external site) |
| Session Preserved | Yes | No |
| Pixels | Fire before redirect | Fire before redirect |
8. Quick Reference - Pixel Function Locations
| Function | File Location |
|---|---|
fireButtonClickConversion() | lib/utils/pixelTracking.js |
fireConversionPixel() | lib/utils/pixelTracking.js |
fireAdClosedPixel() | lib/utils/pixelTracking.js |
fireArticlePageLoadPixel() | lib/utils/pixelTracking.js |
fireCategoryPageLoadPixel() | lib/utils/pixelTracking.js |
useConversionPixels (hook) | components/hooks/useConversionPixels.js |
useButtonClickHandlers (hook) | components/hooks/useButtonClickHandlers.js |
useAdWaterfall (hook) | components/hooks/useAdWaterfall.js |