wolfenrain / fluttium

Fluttium, the user flow testing tool for Flutter
https://fluttium.dev
MIT License
361 stars 10 forks source link

fix: writeText action only writing one character on iOS and Android #387

Open k-ane opened 8 months ago

k-ane commented 8 months ago

I've only tested on iOS and Android simulator, but in both cases write text would only write one character, this was using the example provided by Fluttium as well.

The way I was able to work around this for now was to duplicate the action and write the whole text in one go instead of letter by letter, but a better solution should be found.

@override
  Future<bool> execute(Tester tester) async {
    TextInput.setInputControl(_textInputController);
    tester.emitPlatformMessage(
      SystemChannels.textInput.name,
      SystemChannels.textInput.codec.encodeMethodCall(
        const MethodCall('TextInputClient.requestExistingInputState'),
      ),
    );
    TextInput.restorePlatformInputControl();

    // Temporary workaround, enter whole text instead of character by character
    await _enterText(tester, text);
    await tester.pumpAndSettle();

    // for (final char in text.split('')) {
    //   await _enterText(tester, char);
    //   await tester.pumpAndSettle();
    // }
    return true;
  }
Dustec commented 5 months ago

Can you share the full code if this work around?

mskhan18 commented 4 months ago

@k-ane were you able to fix this issue? Because I also have this issue

alejandro-rios commented 2 weeks ago

I have the same issue in a Flutter web project, the weird thing is that I downloaded the fluttium repo, run the text_flow example and happens the same

Dustec commented 2 weeks ago

I talked to the developer by discord about this. Is a known issue that they are not going to fix soon. I would recommend you use another approach. I used patrol once and it's great 😄

https://patrol.leancode.co

alejandro-rios commented 2 weeks ago

I talked to the developer by discord about this. Is a known issue that they are not going to fix soon. I would recommend you use another approach. I used patrol once and it's great 😄

https://patrol.leancode.co

Thanks, but according to this, they are not supporting flutter web