Skip to content

Commit 1ea7dc6

Browse files
authored
Set automatic simulator rotation in scenario test (flutter#24985)
1 parent 04b0451 commit 1ea7dc6

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

testing/scenario_app/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ platform channel.
3030
For PlatformView tests on iOS, you'll also have to edit the dictionaries in
3131
[AppDelegate.m](https://github.com/flutter/engine/blob/5d9509ae056b04c30295df27f201f31af9777842/testing/scenario_app/ios/Scenarios/Scenarios/AppDelegate.m#L29) and [PlatformViewGoldenTestManager.m](https://github.com/flutter/engine/blob/5d9509ae056b04c30295df27f201f31af9777842/testing/scenario_app/ios/Scenarios/ScenariosUITests/PlatformViewGoldenTestManager.m#L24) so that the correct golden image can be found. Also, you'll have to add a [GoldenPlatformViewTests](https://github.com/flutter/engine/blob/5d9509ae056b04c30295df27f201f31af9777842/testing/scenario_app/ios/Scenarios/ScenariosUITests/GoldenPlatformViewTests.h#L18) in [PlatformViewUITests.m](https://github.com/flutter/engine/blob/af2ffc02b72af2a89242ca3c89e18269b1584ce5/testing/scenario_app/ios/Scenarios/ScenariosUITests/PlatformViewUITests.m).
3232

33+
If `PlatformViewRotation` is failing, make sure Simulator app Device > Rotate Device Automatically
34+
is selected, or run:
35+
36+
```bash
37+
defaults write com.apple.iphonesimulator RotateWindowWhenSignaledByGuest -int 1
38+
```
39+
3340
### Generating Golden Images on iOS
3441

3542
Screenshots are saved as

testing/scenario_app/run_ios_tests.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ if [[ $# -eq 1 ]]; then
3333
FLUTTER_ENGINE="$1"
3434
fi
3535

36+
# Make sure simulators rotate automatically for "PlatformViewRotation" test.
37+
# Can also be set via Simulator app Device > Rotate Device Automatically
38+
defaults write com.apple.iphonesimulator RotateWindowWhenSignaledByGuest -int 1
39+
3640
cd ios/Scenarios
3741
set -o pipefail && xcodebuild -sdk iphonesimulator \
3842
-scheme Scenarios \

0 commit comments

Comments
 (0)