Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 43 additions & 1 deletion scripts/check_growth_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand All @@ -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):
Expand Down Expand Up @@ -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'<link rel="canonical" href="https://appdevelopsk.com{path}">' 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'<article class="app">([\s\S]*?)</article>', html)
records = {}
valid_articles = True
for article in article_blocks:
stores = re.findall(r'<a class="(?:store|play)" data-app="([^"]+)"', article)
details = re.findall(
r'<a class="app-detail" href="/support/([^/"]+)/" '
r'data-guide-detail="([^"]+)" aria-label="Features and FAQs for ([^"]+)"',
article,
)
headings = re.findall(r'<h3>([^<]+)</h3>', 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)
Expand Down
55 changes: 54 additions & 1 deletion scripts/test_growth_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -59,6 +59,24 @@ def valid_pages():
f'<a href="{play}&amp;utm_source=test" data-position="hero">' +
f'<a href="{play}&amp;utm_source=test" data-position="details">' +
" ".join(f'<a href="/support/{x}/" data-related-app="{x}">' for x in other))
for guide, slugs in GUIDE_APPS.items():
klass = "store" if guide in ("quick-games", "daily-habits") else "play"
articles = "".join(
'<article class="app">'
f'<h3>{slug}</h3>'
f'<a class="{klass}" data-app="{slug}" '
f'href="https://play.google.com/store/apps/details?id=com.test.{slug}">'
'See on Google Play</a>'
f'<a class="app-detail" href="/support/{slug}/" '
f'data-guide-detail="{slug}" aria-label="Features and FAQs for {slug}">'
'Features &amp; FAQs</a></article>'
for slug in slugs
)
pages[f"/guides/{guide}/"] = (
f'<link rel="canonical" href="https://appdevelopsk.com/guides/{guide}/">'
+ " guide_store_click download_click app_detail_click "
+ articles
)
pages["/robots.txt"] = "User-agent: *\\nAllow: /icons/\\n"
pages["/sitemap.xml"] = (
"".join(
Expand Down Expand Up @@ -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] += (
'<article class="app"><h3>New app</h3>'
'<a class="store" data-app="new-app" '
'href="https://play.google.com/store/apps/details?id=com.test.new-app">'
'See on Google Play</a></article>'
)
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(
Expand Down