Skip to content

Commit b246ba3

Browse files
committed
fix(ci): wait for the Simulator window
1 parent 91ac745 commit b246ba3

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎scripts/mobile-showcase.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,8 +793,18 @@ async function setIosSimulatorOrientation(
793793
"-e",
794794
'tell application "System Events" to tell process "Simulator"',
795795
"-e",
796+
"set simulatorWindows to {}",
797+
"-e",
798+
"repeat 40 times",
799+
"-e",
796800
'set simulatorWindows to menu items of menu "Window" of menu bar item "Window" of menu bar 1 whose name starts with simulatorName',
797801
"-e",
802+
"if (count of simulatorWindows) is greater than 0 then exit repeat",
803+
"-e",
804+
"delay 0.25",
805+
"-e",
806+
"end repeat",
807+
"-e",
798808
'if (count of simulatorWindows) is not 1 then error "Expected exactly one Simulator window for " & simulatorName',
799809
"-e",
800810
"click item 1 of simulatorWindows",

0 commit comments

Comments
 (0)