leancodepl / patrol

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

IOS App does not got delete after a test #2311

Open chiphan-quickcare opened 1 month ago

chiphan-quickcare commented 1 month ago

Steps to reproduce

Run with command patrol test -d 'iPhone 15 Pro Max' --verbose -t $(TEST_FILES)

Actual results

The app doesn't get delete after each test

Logs

Logs ``` ```

Patrol version

3.9.0

Patrol Doctor output

Patrol Doctor output ``` Patrol doctor: Patrol CLI version: 3.1.0 Flutter command: flutter Flutter 3.22.2 • channel stable Android: • Program adb found in /opt/homebrew/bin/adb • Env var $ANDROID_HOME set to /Users/kyohuu/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 ``` Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.22.2, on macOS 14.5 23F79 darwin-arm64, locale en-VN) [!] Android toolchain - develop for Android devices (Android SDK version 35.0.0-rc4) ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses [✓] Xcode - develop for iOS and macOS (Xcode 15.4) [✓] Chrome - develop for the web [✓] Android Studio (version 2023.3) [✓] IntelliJ IDEA Ultimate Edition (version 2024.1.4) [✓] IntelliJ IDEA Community Edition (version 2024.1.4) [✓] Connected device (5 available) ! Error: Browsing on the local area network for Nang’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) [✓] Network resources ! Doctor found issues in 1 category. ```
jBorkowska commented 1 month ago

Hi @chiphan-quickcare, patrol doesn't delete the app between test runs. If you need to clear the app's data between runs on iOS, you have to do it by yourself - there is no API on iOS side that we can use to do it automatically.

Let me know if you have any other questions or check out our Discord server: https://discord.gg/ukBK5t4EZg

chiphan-quickcare commented 3 weeks ago

Thanks for the response @jBorkowska, but it the test does uninstall the app in the android run after each test?

jBorkowska commented 4 days ago

Sorry for late response - I went on vacation and failed to hand this issue over.

It does not uninstall, but it clears it's data between test runs - so eg. login data or permissions are cleared. You can modify this behaviour with this line: testInstrumentationRunnerArguments clearPackageData: "true" You should have it in android/app/build.gradle file. If you don't have it, check out step 4 in Android setup (https://leancodepl.docs.page/patrol/getting-started#integrate-with-native-side)