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

Test Runner class missing error while running the Patrol tests both in firebase and in local #1935

Closed
ashwinichannaveerappa opened this issue Nov 21, 2023 · 8 comments
Assignees
Labels
waiting for response Waiting for user's response

Comments

@ashwinichannaveerappa
Copy link

Steps to reproduce

void main() {
//class objects
final BaseClass baseClass = BaseClass();
final SignInScreen signInScreenObject = SignInScreen();
final SettingScreenObject settingsScreenObject = SettingScreenObject();
const timeout = Duration(seconds: 10); // to avoid timeouts on CI
patrol("Check Login functionality with multiple Scenarios", ($) async {
//load l10n
await loadLocalization();

//initialize app
await baseClass.initializeApp();

//login with valid credentials
await baseClass.loginWithValidCredentials($);
await $.tester.pumpAndSettle();

//logout
await settingsScreenObject.logOut($);

await $.pump();
await Future.delayed(timeout);

//login with empty username and password
await signInScreenObject.loginEmptyUserNameAndPassword($);
await Future.delayed(timeout);

//login with invalid credentials
await signInScreenObject.loginWithInValidCredentials($);
await $.native.pressBack();

});
}

command used :

patrol test android -v--target integration_test\tests\login_test.dart --flavor dev

firebase

patrol build android -v--target integration_test\tests\login_test.dart --flavor prod -

Actual results

Uploading [build/app/outputs/apk/dev/debug/app-dev-debug.apk] to Firebase Test Lab...

Uploading [build/app/outputs/apk/androidTest/dev/debug/app-dev-debug-androidTest.apk] to Firebase Test Lab...

Raw results will be stored in your GCS bucket at [https://console.developers.google.com/storage/browser/test-lab-ma19xusart4nw-kcjj1vq5t80ha/2023-11-21_16:36:25.919382_IVau/]

Test [matrix-2dvlltmj2toch] has been created in the Google Cloud.

Creating individual test executions...failed.

ERROR: (gcloud.firebase.test.android.run)

Matrix [matrix-2dvlltmj2toch] failed during validation: The test APK does not contain the test runner class specified by the user or the manifest file. The test runner class name may be incorrect, or the class may be mislocated in the app APK..

Logs

Instrumentation did not complete:
Instrumentation code: 0
Instrumentation result bundle:

Patrol version

patrol: ^3.0.1
patrol_finders: ^2.0.1

Patrol Doctor output

Patrol CLI version: 2.3.1+1
Program adb found in C:\Users\achannav\scoop\shims\adb.exe
Env var $ANDROID_HOME set to C:\Users\achannav\AppData\Local\Android\sdk

Flutter Doctor output

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.16.0, on Microsoft Windows [Version 10.0.19045.3693], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[√] Chrome - develop for the web
[X] Visual Studio - develop Windows apps
X Visual Studio not installed; this is necessary to develop Windows apps.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2022.3)
[√] IntelliJ IDEA Community Edition (version 2021.3)
[√] VS Code (version 1.83.0)
[√] Connected device (4 available)
[√] Network resources

! Doctor found issues in 1 category.

@jBorkowska jBorkowska self-assigned this Nov 23, 2023
@jBorkowska
Copy link
Collaborator

jBorkowska commented Nov 23, 2023

Hi @ashwinichannaveerappa! I can't find how you start your aqpp in this test, probably you do this inside baseClass.initializeApp(). Please provide the body of this method or the code that runs the app inside the test.
In general, you should use $pumpWidgetAndSettle(your_apps_root_widget) to run app inside the patrolTest. If you use runApp() method instead, it may cause problems with test execution.

@jBorkowska jBorkowska added the waiting for response Waiting for user's response label Nov 23, 2023
@ashwinichannaveerappa
Copy link
Author

ashwinichannaveerappa commented Nov 27, 2023

Hi @jBorkowska, this issue we started observing upon upgrading to latest version of patrol and cli

Future initializeApp(PatrolIntegrationTester $) async {
await app.main();
}

final desiredLocale = String.fromEnvironment('locale', defaultValue: 'en'); //.split(',');

Future loadLocalization() async {
await S.load(Locale(desiredLocale));
}

@github-actions github-actions bot removed the waiting for response Waiting for user's response label Nov 27, 2023
@jBorkowska
Copy link
Collaborator

I tried to reproduce it in my project, though unsuccessfully. The last thing that comes to my mind is how you call patrol method - precisely what does it do, bc I guess it is some kind of wrapper on patrolTest. Please provide what it contains

@jBorkowska jBorkowska added the waiting for response Waiting for user's response label Nov 27, 2023
@ashwinichannaveerappa
Copy link
Author

@jBorkowska please find the below code snippet for the reference.

void patrol( String description, Future<void> Function(PatrolIntegrationTester ) callback, { bool? skip, NativeAutomatorConfig? nativeAutomatorConfig, LiveTestWidgetsFlutterBindingFramePolicy framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.fadePointers, }) { patrolTest( description, config: _patrolTesterConfig, nativeAutomatorConfig: nativeAutomatorConfig ?? _nativeAutomatorConfig, framePolicy: framePolicy, skip: skip, callback, ); }

@github-actions github-actions bot removed the waiting for response Waiting for user's response label Nov 29, 2023
@jBorkowska
Copy link
Collaborator

Hello @ashwinichannaveerappa, I am sorry for not responding for so long, if the problem still persists, it can be problem with native setup. Please provide build.gradle from android/app folder and MainActivityTest.java (or .kt) file

Also I encourage you to join our Discord server (link in our documentation), we help to solve problems with setup, maybe you'll find a solution there

@jBorkowska jBorkowska added the waiting for response Waiting for user's response label Dec 11, 2023
@trenslow
Copy link

@jBorkowska I had the same issue and was able to solve it by setting shrinkResources and minifyEnabled to false in the build.grade file. Maybe that helps to find the source of the issue, but it still would be nice to be able to run the tests on minified builds, as that's what will eventually end up going to the end-user.

Copy link

Without additional information, we can't resolve this issue. We're therefore reluctantly going to close it.
Feel free to open a new issue with all the required information provided, including a [minimal, reproducible sample]. Make sure to diligently fill out the issue template.
Thanks for your contribution.
[minimal, reproducible sample]: https://stackoverflow.com/help/minimal-reproducible-example

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 Dec 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
waiting for response Waiting for user's response
Projects
None yet
Development

No branches or pull requests

3 participants