leancodepl / patrol

Flutter-first UI testing framework. Ready for action!
https://patrol.leancode.co
Apache License 2.0
814 stars 116 forks source link

The installed app does not automatically get deleted #2218

Closed ckxddd0324 closed 2 weeks ago

ckxddd0324 commented 2 weeks ago

Steps to reproduce

  1. Run the test
  2. Test Passed
  3. Simulator is closed but not deleted
  4. Rerun the same
  5. Installethe app/replace example one

Actual results

I would expect the app got automatically deleted when the test is finished

Logs

Logs ``` ```

Patrol version

3.7.1

Patrol Doctor output

Patrol Doctor output ``` Patrol doctor: Patrol CLI version: 2.7.0 Flutter command: flutter Flutter 3.19.0 • channel stable Android: • Program adb found in /Users/ss/library/Android/sdk/platform-tools/adb • Env var $ANDROID_HOME set to /Users/ss/library/Android/sdk iOS / macOS: • Program xcodebuild found in /usr/bin/xcodebuild • Program ideviceinstaller found in /opt/homebrew/bin/ideviceinstaller ```

Flutter Doctor output

Flutter Doctor output ``` [✓] Flutter (Channel stable, 3.19.0, on macOS 14.4 23E214 darwin-arm64, locale en-US) • Flutter version 3.19.0 on channel stable at /Users/ss/DevTools/flutter_3_19 • Upstream repository https://github.com/flutter/flutter.git • Framework revision bae5e49bc2 (4 months ago), 2024-02-13 17:46:18 -0800 • Engine revision 04817c99c9 • Dart version 3.3.0 • DevTools version 2.31.1 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/a820757/Library/Android/sdk • Platform android-34-ext8, build-tools 34.0.0 • ANDROID_HOME = /Users/ss/library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.4) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15F31d • CocoaPods version 1.15.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2022.3) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231) [✓] IntelliJ IDEA Ultimate Edition (version 2023.2.4) • IntelliJ at /Applications/IntelliJ IDEA.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart [✓] IntelliJ IDEA Community Edition (version 2024.1.1) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart [✓] VS Code (version 1.88.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.90.0 [✓] VS Code (version 1.85.1) • VS Code at /Applications/Visual Studio Code copy.app/Contents • Flutter extension version 3.90.0 [✓] VS Code (version 1.85.1) • VS Code at /Applications/Visual Studio Code_intel.app/Contents • Flutter extension version 3.90.0 ```
jBorkowska commented 2 weeks ago

Hi @ckxddd0324 ! By default, patrol_cli uninstalls the app from the device, unless you pass a flag --no-uninstall to a patrol command. I couldn't reproduce this issue. Please provide more details:

Also, logs from a test run would be useful for us (please use --verbose flag, so we can see if patrol attempted to uninstall the app).

ckxddd0324 commented 2 weeks ago

Hi @jBorkowska

ckxddd0324 commented 2 weeks ago

I kind of figure out the issue, but what is the correct way to run the test with specific iOS version. It seems like when I use -d {device_id} for iOS, it does not use that specific emulator. It would try to use the latest version of iOS version with that device type.

jBorkowska commented 2 weeks ago

What do you mean by "it does not use that specific emulator"? What happens instead? Which simulator is used?

In general, there are issues with the latest Xcode and running patrol tests on simulators with older iOS versions than latest, more info here: https://github.com/leancodepl/patrol/issues/2003

ckxddd0324 commented 2 weeks ago

I guess it is similar issue with the thread you shared. I was trying to use -d {device_id} but patrol is running the 17.5/the latest iOS version with the same device type on my machine instead of running the run on specific device that I added to -d

jBorkowska commented 2 weeks ago

This looks like what I sent then. There is a workaround for this issue in the comments, take a look at it. For now I'm closing the issue, feel free to reopen or create new one if there will be some more problems

github-actions[bot] commented 1 week ago

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.