From 7206dcc848e7ae218223442d6e5e40c263000c5e Mon Sep 17 00:00:00 2001 From: Rob Hogan <2590098+robhogan@users.noreply.github.com> Date: Mon, 26 Oct 2026 08:05:19 -0700 Subject: [PATCH] Assert switch state before the toggled visual screenshot (#59413) Summary: The custom-colors switch flow takes its `toggled` screenshot without checking the taps landed, so a dropped tap captures the wrong state. That spoiled a baseline on `main` and failed https://github.com/react/react-native/issues/59390. This asserts each switch's `checked` state before the screenshot, so a dropped tap fails the flow and it's retried instead. Changelog: [Internal] Pull Request resolved: https://github.com/react/react-native/pull/59413 Test Plan: Ran the section on the iOS 26 visual simulator: passes as written, and fails when asserting the wrong state. Android runs in this PR's CI. Reviewed By: cipolleschi Differential Revision: D127577122 Pulled By: cortinico fbshipit-source-id: 59bed882d9f1f7cdb553c170e2d897fc39f22e41 --- packages/rn-tester/visual-tests/flows/switch.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/rn-tester/visual-tests/flows/switch.yml b/packages/rn-tester/visual-tests/flows/switch.yml index 9572f34a354..3aa256fde6e 100644 --- a/packages/rn-tester/visual-tests/flows/switch.yml +++ b/packages/rn-tester/visual-tests/flows/switch.yml @@ -80,6 +80,12 @@ appId: ${APP_ID} id: 'initial-false-switch' - tapOn: id: 'initial-true-switch' +- assertVisible: + id: 'initial-false-switch' + checked: true +- assertVisible: + id: 'initial-true-switch' + checked: false - waitForAnimationToEnd: timeout: 5000 - takeScreenshot: