From 528b2c7756187d736fe8ec10f7c65d3319fead83 Mon Sep 17 00:00:00 2001 From: PJ Date: Wed, 19 Aug 2026 18:50:29 +0530 Subject: [PATCH] test(sidecar): fail the build if maestro renames the call the fact comes from --- .../dev/sanderling/sidecar/SecureFactsTest.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sidecar/src/test/kotlin/dev/sanderling/sidecar/SecureFactsTest.kt b/sidecar/src/test/kotlin/dev/sanderling/sidecar/SecureFactsTest.kt index e40cf29..c20ab61 100644 --- a/sidecar/src/test/kotlin/dev/sanderling/sidecar/SecureFactsTest.kt +++ b/sidecar/src/test/kotlin/dev/sanderling/sidecar/SecureFactsTest.kt @@ -130,6 +130,22 @@ class SecureFactsTest { assertEquals(listTree, annotated) } + // The fact is read through a call maestro keeps private, so a maestro + // upgrade that renames it would leave every typed value redacted again with + // nothing failing. This fails the build instead. + @Test fun maestroStillExposesTheCallTheDeviceXmlComesFrom() { + val call = maestro.drivers.AndroidDriver::class.java + .getDeclaredMethod( + "callViewHierarchy", + Int::class.javaPrimitiveType, + ) + + assertEquals( + String::class.java, + call.returnType.getMethod("getHierarchy").returnType, + ) + } + // The rest of the tree has to survive the annotation: it is the same tree // every selector, bounds read and screen classification runs against. @Test fun theTreeIsOtherwiseUnchanged() {