questionnaire docs
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

FeatureThemeTest Goal
Questionnaire FlowQuestionnaireVerify user can answer questions and is prompted with a CTA button only on the final step.
Chat SimulationWhatsAppVerify chat bubbles load sequentially and Display Ad injects after the first message.
Implicit TriggerWhatsAppVerify clicking the final option (e.g., "Yes", "View Results") triggers the rewarded ad immediately.
Guide FlowGuideVerify questions complete, showing a loader, and establishing a blurred content state.
Popup TriggerGuideVerify RewardedAdPopupGuide appears automatically over blurred content when the ad is ready.
Link InterceptionGuideEdge Case: Click an article link without watching the ad. Verify URL gets ?guideNoAd=1.

B. Ad Logic & Monetization

FeatureTest Goal
Rewarded AdVerify user cannot close the ad early without penalty (should re-trigger or not unlock content).
Ad WaterfallIn Network Tab, verify gpt.js requests use correct KV strings (e.g., rewardedKv1Values).
KV2 FallbackVerify no-fill on KV1 triggers the inline KV2 popup.

3. Detailed Test Cases

3.1 Guide Theme & Content Protection

  1. Navigate to Category: Open a category page configured with the "Guide" theme.
  2. Complete Questions: Answer all questions in the modal.
  3. 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.
  4. Action - Watch Ad: Click "Show me how".
    • Expectation: Video ad plays.
    • Completion: After ad finishes, popup closes, and blur is REMOVED.
  5. 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 ArticleRewardedAd logic should trigger again.

3.2 WhatsApp Theme "Persistence"

  1. Navigate to Category: Open a category page configured with "WhatsApp" theme.
  2. Wait: Allow chat bubbles to load.
    • Verify: A display banner ad injects inside the message stream.
  3. Final Step: Click the final option (e.g., "View Results").
    • Expectation: Video ad (Rewarded) opens immediately.
  4. Action - Close Early: Close the ad explicitly before it finishes.
    • Expectation: Ad closes, but immediately re-opens (Persistence Loop).
  5. Action - Complete Ad: Watch ad to completion.
    • Expectation: User redirected to ?sp=1 or final destination.

3.3 General Questionnaire Flow

  1. Navigate to Category: Open standard Questionnaire category.
  2. Answer: Click through questions.
  3. Verify: NO CTA button is visible on intermediate steps.
  4. Final Step: CTA Button ("Watch Ad to Continue") appears.
  5. Action: Click CTA.
    • Expectation: Ad plays.
    • Completion: Redirects to ?sp=1.

4. Ad Verification Guide (Network Tab)

Tools: Chrome DevTools → Network Tab

  1. Open Chrome DevTools → Network Tab.
  2. Filter by securepubads or gampad.
  3. Select a Google Ad Manager request and look at the Query String Parameters.
  4. 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).

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 logic

6. KV Waterfall & Encoding Details

KV Value Encoding Map

Numeric price values are encoded at the service layer for obfuscation:

NumericEncoded
0A
1C
2E
3G
4I
5K
6M
7O
8Q
9S
.-
  • Example: 800.00QAA-AA
  • Example: 0.01A-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

AspectSame DomainCross-Domain
Redirect Methodrouter.push()window.location.href
URL Parameter?sp=1 addedNo parameter added
Second Page PopupShows SecondPageRewardedPopupN/A (external site)
Session PreservedYesNo
PixelsFire before redirectFire before redirect

8. Quick Reference - Pixel Function Locations

FunctionFile 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

On this page