Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The test doesn't start on device Patrol v 2.0.1 - Windows #1456

Closed
victoria24a opened this issue Jul 3, 2023 · 7 comments
Closed

The test doesn't start on device Patrol v 2.0.1 - Windows #1456

victoria24a opened this issue Jul 3, 2023 · 7 comments

Comments

@victoria24a
Copy link

Steps to reproduce

  1. Run test on device using command-Windows: patrol test -t integration_test\patrol_test.dart
  2. Simple function:
 void main() async {
  
    patrolTest('Buy Subscription', nativeAutomation: true, ( PatrolTester tester) async {
      await app.main();
      await tester.pumpAndSettle();
      await tester(ElevatedButton).tap();
      await tester.native.tap(Selector(pkg:'com.android.vending',className: 'android.widget.Button'));
    });
  1. Terminal:
    • Building apk with entrypoint test_bundle.dart...
    ✓ Completed building apk with entrypoint test_bundle.dart (17.7s)
    • Executing tests of apk with entrypoint test_bundle.dart on device RF8NB1E5QSH...

  2. Device: blue screen- freezes:

log_out.txt - Note: test was run around 14:18 and discontinued at 14:20

Actual results

No able to run any partol test, another integration tests works correctly on the same project and device.

Logs

Logs
<!-- Replace this line with your logs. Do not remove the backticks! -->

Patrol version

[patrol](patrol: ^2.0.1)

Patrol Doctor output

Patrol Doctor output
patrol doctor
You're using Patrol CLI 2.0, which has breaking changes.
Read the migration guide at https://patrol.leancode.co/v2.
Disable this warning by setting the PATROL_MIGRATED environment variable.
Patrol CLI version: 2.0.1
Program adb found in c:\Users\ratha\AppData\Local\Android\Sdk\platform-tools\adb.exe
Env var $ANDROID_HOME is not set

Flutter Doctor output

Flutter Doctor output
flutter doctor --verbose
[√] Flutter (Channel stable, 3.10.4, on Microsoft Windows [Version 10.0.19045.3086], locale en-US)
    • Flutter version 3.10.4 on channel stable at D:\Flutter_agata\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 682aa387cf (4 weeks ago), 2023-06-05 18:04:56 -0500
    • Engine revision 2a3401c9bb
    • Dart version 3.0.3
    • DevTools version 2.23.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\ratha\AppData\Local\Android\sdk
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[!] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.5)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.7.30523.141
    X Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop development with C++" workload, and include these components:
        MSVC v142 - VS 2019 C++ x64/x86 build tools
         - If there are multiple build tool versions available, install the latest
        C++ CMake tools for Windows
        Windows 10 SDK

[√] Android Studio (version 4.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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 1.8.0_242-release-1644-b01)

[√] Android Studio (version 2022.2)
    • Android Studio at D:\Program Files\Android\Android Studio1
    • 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-b2043.56-9586694)

[√] Android Studio (version 4.1)
    • Android Studio at D:\android-studio
    • 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 1.8.0_242-release-1644-b01)

[√] Android Studio (version 2020.3)
    • Android Studio at D:\android-studio-arctic-fox
    • 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 11.0.9.1+0-b77-7246554)

[√] Android Studio (version 4.2)
    • Android Studio at D:\android-studio4.2
    • 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 11.0.8+10-b944.6842174)

[√] IntelliJ IDEA Community Edition (version 2021.3)
    • IntelliJ at D:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.3.1
    • Flutter plugin version 72.1.1
    • Dart plugin version 213.5744.122

[√] Connected device (4 available)
    • SM N980F (mobile) • RF8NB1E5QSH • android-arm64  • Android 12 (API 31)
    • Windows (desktop) • windows     • windows-x64    • Microsoft Windows [Version 10.0.19045.3086]
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 114.0.5735.199
    • Edge (web)        • edge        • web-javascript • Microsoft Edge 114.0.1823.67

[√] Network resources
    • All expected network resources are available
@victoria24a victoria24a changed the title The test don't start on device Patrol v 2.0.1 - Windows The test doesn't start on device Patrol v 2.0.1 - Windows Jul 3, 2023
@bartekpacia
Copy link
Contributor

Hi, thanks for reporting this problem.

These logcat entries look relevant:

java.lang.RuntimeException: android.os.RemoteException: No packages for uid
Crash of app com.company.framework.test running instrumentation ComponentInfo{com.company.framework.test.test/pl.leancode.patrol.PatrolJUnitRunner}

@bartekpacia
Copy link
Contributor

Are you sure you got the setup correctly? A sample project that I can clone and reproduce the issue would help a lot.

@victoria24a
Copy link
Author

@bartekpacia Hi, simple project where I reproduce this issue https://github.com/victoria24a/1456_sample_patrol

@bartekpacia
Copy link
Contributor

@victoria24a There are a few problems with your project:

  1. It's missing some of the necessary native setup, as described here.
  2. The main function is async, which is forbidden. See also Patrol 2.0 shortcomings #1341.

I made a PR that makes integration_test/patrol_test.dart run. It still fails but I guess that's not the problem here

@bartekpacia
Copy link
Contributor

I'm going to close this issue since it's not a problem with Patrol.

@bartekpacia bartekpacia closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2023
@findms
Copy link

findms commented Sep 7, 2023

@bartekpacia
It's missing some of the necessary native setup, [as described here](https://patrol.leancode.co/getting-started/native#integrate-with-native-side).
This document is not accessible, it says 404.

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants