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

Merge Patrol and PatrolTester #274

Closed
3 tasks done
bartekpacia opened this issue Sep 13, 2022 · 3 comments
Closed
3 tasks done

Merge Patrol and PatrolTester #274

bartekpacia opened this issue Sep 13, 2022 · 3 comments
Labels
package: patrol Related to the patrol package (native automation, test bundling) tech debt Something needs a refactor

Comments

@bartekpacia
Copy link
Contributor

bartekpacia commented Sep 13, 2022

Introduction

Currently, a different object is used to interact with the OS (Patrol), and a different to interact with Flutter PatrolTester.

We'd like to embed Patrol (and rename it to NativeAutomator or something like this) in PatrolTester. At the same time, we don't want to force our users to use patrolTest instead of testWidgets, so we want to keep the current method of initializing Patrol.

Scope

Add a native bool flag to maestroTest which, if true, will initialize PatrolTester.native:

Currently:

"the old way" (but by no means deprecated – we want to let users use only the native automator, without having to use patrolTest().

void main() {
  final patrol = Patrol.forTest();

  patrolTest(
    'taps around',
    config: patrolConfig,
    ($) async {
      await patrol.openQuickSettings();
      await patrol.pressBack();

      await $('Something').tap();
    },
  );
}

We're aiming for:

"the new way"

void main() {
  patrolTest(
    'taps around',
    config: patrolConfig,
    native: true,
    ($) async {
      await $.native.openQuickSettings();
      await $.native.pressBack();

      await $('Something').tap();
    },
  );
}

To do

@bartekpacia bartekpacia added package: patrol Related to the patrol package (native automation, test bundling) tech debt Something needs a refactor and removed package: patrol Related to the patrol package (native automation, test bundling) labels Sep 13, 2022
@bartekpacia
Copy link
Contributor Author

bartekpacia commented Sep 15, 2022

cc @mateuszwojtczak @jakubfijalkowski - just please say what you think

@bartekpacia
Copy link
Contributor Author

This has been done.

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
package: patrol Related to the patrol package (native automation, test bundling) tech debt Something needs a refactor
Projects
None yet
Development

No branches or pull requests

1 participant