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

Keyboard Submit #3

Closed
mjmarrazzo opened this issue Aug 25, 2020 · 2 comments
Closed

Keyboard Submit #3

mjmarrazzo opened this issue Aug 25, 2020 · 2 comments

Comments

@mjmarrazzo
Copy link
Contributor

Testing an app for work, and we have a search bar and there isn't a search button, cause you would typically press enter after the search term. We are using both autopilot to handle all flutter things and appium for handling system dialog and permissions. We could do a workaround with appium, but we're trying to use it as least as possible.

So I'm looking for a way to send a keyboard submit with autopilot. Have tried adding in various line endings, but nothing seems to work. Still looking into ways to do this, but if you have any input, that would be great.

@mjmarrazzo
Copy link
Contributor Author

mjmarrazzo commented Aug 25, 2020

 void submit() {
    ServicesBinding.instance.defaultBinaryMessenger.handlePlatformMessage(
      SystemChannels.textInput.name,
      SystemChannels.textInput.codec.encodeMethodCall(
        MethodCall('TextInputClient.performAction',
            <dynamic>[_clientId, TextInputAction.done.toString()]),
      ),
      (ByteData data) {},
    );
  }

So I did happen to find some stuff for TextInputClient.performAction, and I don't mind submitting a pull request, but was curious on your thoughts on this. There are other actions that others might need.
Edit: fix code formatting

@ajinasokan
Copy link
Owner

This will be really useful. You can add another method next to TextInputDriver.type that accepts a string corresponding to the enum value and forward it like in your snippet.

And in the API you can add POST /keyboard for receiving this value from the test script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants