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

Simple selector engine #1

Closed
Tracked by #30
kubawojtczakLC opened this issue May 25, 2022 · 3 comments
Closed
Tracked by #30

Simple selector engine #1

kubawojtczakLC opened this issue May 25, 2022 · 3 comments

Comments

@kubawojtczakLC
Copy link
Member

No description provided.

@bartekpacia
Copy link
Contributor

bartekpacia commented Jun 15, 2022

I'll assume this issue is about the part of API surface of package:maestro_test concerned with finding native widgets. Probably this comment would fit better into #30.

From what I understand, we want to provide both:

  • basic functionality

    Similar to what package:flutter_test offers (but for the underlying native platform). Example of how I image it to look like:

    // example/lib/integration_test/app_test.dart
    import 'package:maestro_test/maestro_test.dart';
    
    
    final maestro = Maestro.forTest();
    const notificationBodyText = 'Notification body sent by Maestro example app';
    // ...
    
    // Send notification by tapping on a button
    await tester.tap(find.text("Show notification"));
    
    // Verify that our counter starts at 0.
    maestro.openNotifications();
    
     // "native"-kind methods are provided by Maestro
    expectLater( 
      await nativeFind.text(notificationBodyText),
      findsOneNativeWidget, 
    );
    
    // Open the notification by tapping on the text that is it
    await maestro.tap(nativeFind.text(notificationBodyText));
    
    expect(nativeFind.text('cuba voytchack'), findsNoNativeWidgets); // provided by Maestro as well
    
    await maestro.pressBack(); // hide notification shade
    
    await maestro.tap(nativeFind.byIcon(Icons.add)); // problem – how to map icon names from Flutter to native platform?
  • convenience functionlity

    Such as signInWithFacebook(email, password) (which automatically sign in using the default Facebook WebView) or resetPassword(senderEmail) (which opens Gmail app, finds the mail from senderEmail and clicks the reset password link). They encapsulate whole flows into a single, simple method call and are composed using basic functionalities.

I think that we should implement the basic functionality first and then figure how to create whole flows out of them. We have to encode native finders into a JSON, send it to the instrumentation server, and then recreate it somehow into calls to native BySelector.

This was referenced Jun 29, 2022
@bartekpacia
Copy link
Contributor

Kind of done for now.

The paragraph and code snippet about native selectors might be useful in the future.

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