diff --git a/scripts/check_growth_live.py b/scripts/check_growth_live.py index d8b82ac1..bfcca86a 100644 --- a/scripts/check_growth_live.py +++ b/scripts/check_growth_live.py @@ -12,6 +12,12 @@ # Prevent accidental removal of existing listings, but allow genuine new releases. CATALOG_MIN_ITEMS = 92 FEATURED_SLUGS = ("debate-me", "tappitsu-battle", "future-me", "twotaku") +GUIDE_APPS = { + "quick-games": ("blur", "instant-judge", "twotaku", "nodo", "brain-burst"), + "daily-habits": ("true-me", "future-me", "water-reminder", "gratitude-log"), + "decision-helpers": ("food-roulette", "movie-roulette", "what-to-do", "chore-roulette"), + "ai-tools": ("debate-me", "voice-memo", "pantry-ai", "name-maker"), +} GROWTH_RELEASE_ID = "growth-20261106-wave2" GROWTH_LASTMOD_BASELINE = "2026-11-07" GROWTH_UPDATED_PATHS = ( @@ -23,7 +29,7 @@ ) PATHS = ("/", "/apps", "/robots.txt", "/sitemap.xml") + tuple( f"/support/{slug}/" for slug in SLUGS -) +) + tuple(f"/guides/{guide}/" for guide in GUIDE_APPS) def inspect(pages): @@ -157,6 +163,42 @@ def check(path, key, valid): check(path, "analytics", "related_app_click" in html and "download_click" in html) check(path, "play_cta", 'data-position="hero"' in html and 'data-position="details"' in html) + # Editorial guides need a complete discover->details->store funnel. + # This is a static HTTP smoke, not proof of browser GA4 delivery. + for guide, expected in GUIDE_APPS.items(): + path = f"/guides/{guide}/" + html = pages.get(path, "") + check(path, "guide_canonical", + f'' in html) + check(path, "guide_event_contract", + all(event in html for event in ( + "guide_store_click", "download_click", "app_detail_click" + ))) + article_blocks = re.findall(r'
([\s\S]*?)
', html) + records = {} + valid_articles = True + for article in article_blocks: + stores = re.findall(r'([^<]+)', article) + good = (len(stores) == len(details) == len(headings) == 1 and + details[0][0] == details[0][1] == stores[0] and + headings[0] == details[0][2] and + "play.google.com/store/apps/details?id=" in article) + if not good or stores[0] in records: + valid_articles = False + if stores: + records[stores[0]] = good + check(path, "all_guide_cards_linked", + valid_articles and len(article_blocks) >= len(expected) and + len(article_blocks) == len(records)) + for slug in expected: + check(path, f"linked_{slug}", records.get(slug, False)) + robots = pages.get("/robots.txt", "") check("/robots.txt", "public_icons_crawlable", "Allow: /icons/" in robots and "Disallow: /icons/" not in robots) diff --git a/scripts/test_growth_live.py b/scripts/test_growth_live.py index 9126688b..04aba2eb 100644 --- a/scripts/test_growth_live.py +++ b/scripts/test_growth_live.py @@ -2,7 +2,7 @@ import json import unittest -from check_growth_live import FEATURED_SLUGS, GROWTH_RELEASE_ID, GROWTH_UPDATED_PATHS, PATHS, SLUGS, inspect +from check_growth_live import FEATURED_SLUGS, GUIDE_APPS, GROWTH_RELEASE_ID, GROWTH_UPDATED_PATHS, PATHS, SLUGS, inspect def valid_pages(): @@ -59,6 +59,24 @@ def valid_pages(): f'' + f'' + " ".join(f'' for x in other)) + for guide, slugs in GUIDE_APPS.items(): + klass = "store" if guide in ("quick-games", "daily-habits") else "play" + articles = "".join( + '
' + f'

{slug}

' + f'
' + 'See on Google Play' + f'' + 'Features & FAQs
' + for slug in slugs + ) + pages[f"/guides/{guide}/"] = ( + f'' + + " guide_store_click download_click app_detail_click " + + articles + ) pages["/robots.txt"] = "User-agent: *\\nAllow: /icons/\\n" pages["/sitemap.xml"] = ( "".join( @@ -99,6 +117,41 @@ def test_missing_recent_sitemap_page_fails(self): ) self.assertFalse(inspect(data)["passed"]) + def test_missing_guide_support_link_fails(self): + pages = valid_pages() + path = "/guides/quick-games/" + pages[path] = pages[path].replace('data-guide-detail="instant-judge"', "") + checks = inspect(pages)["checks"] + self.assertIn( + {"path": path, "check": "linked_instant-judge", "passed": False}, + checks, + ) + + def test_missing_guide_unified_store_event_fails(self): + pages = valid_pages() + path = "/guides/ai-tools/" + pages[path] = pages[path].replace("download_click", "") + checks = inspect(pages)["checks"] + self.assertIn( + {"path": path, "check": "guide_event_contract", "passed": False}, + checks, + ) + + def test_unlinked_new_guide_card_fails(self): + pages = valid_pages() + path = "/guides/daily-habits/" + pages[path] += ( + '

New app

' + '' + 'See on Google Play
' + ) + checks = inspect(pages)["checks"] + self.assertIn( + {"path": path, "check": "all_guide_cards_linked", "passed": False}, + checks, + ) + def test_missing_related_link_fails(self): data = valid_pages() data["/support/future-me/"] = data["/support/future-me/"].replace(