feat(android): align native preview with measured PWA design
Android validation / emulator (37.0) (push) Failing after 3s
Android validation / emulator (35) (push) Failing after 4s
iOS validation / simulator (push) Successful in 59s
Android validation / build (push) Successful in 5m30s

This commit is contained in:
Yuvomi Mobile Contributors committed 2026-10-21 10:45:16 +02:00
1 parent bd0e4cc4fb
commit 7ac9882307
30 files changed
+2793 -750

No files matched your search

+37
View File
@@ -2,6 +2,7 @@
"""Regressions for AGP screenshot output collection, not visual parity tests."""
import base64
import importlib.util
import json
from pathlib import Path
import tempfile
import unittest
@@ -57,6 +58,42 @@ class ScreenshotEvidenceTests(unittest.TestCase):
self.assertFalse((self.screenshots / image.name).exists())
self.assertEqual(unrelated.read_text(), "preserve")
def gallery(self):
parent = self.fixture().parent
for name in HARNESS.SCREENSHOTS:
(parent / name).write_bytes(PNG)
(parent / "viewport.json").write_text(json.dumps({"widthPx": 720, "heightPx": 1184, "density": 2}))
return parent
def test_collects_complete_allowlisted_gallery(self):
parent = self.gallery()
(parent / "private.txt").write_text("not exported")
HARNESS.collect_native_screenshot(self.additional, self.screenshots, gallery=True)
self.assertEqual({p.name for p in self.screenshots.iterdir()}, set(HARNESS.VISUAL_OUTPUTS))
def test_partial_gallery_is_not_exported(self):
parent = self.gallery()
(parent / "notes-dark.png").unlink()
with self.assertRaisesRegex(AssertionError, "Missing or ambiguous"):
HARNESS.collect_native_screenshot(self.additional, self.screenshots, gallery=True)
self.assertFalse(self.screenshots.exists())
def test_clears_every_known_gallery_file_but_preserves_unrelated(self):
parent = self.gallery()
HARNESS.collect_native_screenshot(self.additional, self.screenshots, gallery=True)
(parent / "other.png").write_bytes(PNG)
HARNESS.prepare_android_screenshots(self.output)
self.assertEqual([p.name for p in parent.iterdir()], ["other.png"])
self.assertEqual(list(self.screenshots.iterdir()), [])
def test_rejects_gallery_split_across_devices(self):
parent = self.gallery()
other = parent.with_name("second")
other.mkdir()
(parent / "notes-dark.png").rename(other / "notes-dark.png")
with self.assertRaisesRegex(AssertionError, "Mixed-device"):
HARNESS.collect_native_screenshot(self.additional, self.screenshots, gallery=True)
if __name__ == "__main__":
unittest.main()