Description
I'm trying to implement a new action based in this issue, I'm following the expect_environment_text example on the examples project, but, when I run this new action I'm getting
Steps To Reproduce
- Clone example project from Fluttium repo
- Copy and paste
expect_environment_text in order to create a new action with alt_write_text as name.
- Rename files according to the action.
- Replace
writeText with altWriteText
- Run
fluttium test flows/text_flow.yaml --flavor development --target lib/main_development.dart
- See error.
Expected Behavior
The fluttium action should work.
Screenshots

Additional Context
Here's the version of AltWriteText that I'm using:
import 'package:flutter/services.dart';
import 'package:fluttium/fluttium.dart';
import 'package:fluttium/src/text_input_controller.dart';
/// {@template alt_write_text}
/// workaround for typing in a textField.
///
/// This action can be invoked using the short-hand version:
///
/// ```yaml
/// - altWriteText:
/// ```
/// {@endtemplate}
class AltWriteText extends Action {
/// {@macro alt_write_text}
AltWriteText({
required this.text,
});
final _textInputController = TextInputController();
final String text;
Future<void> _enterText(Tester tester, String text) async {
_textInputController.value = _textInputController.value.copyWith(
text: text,
selection: TextSelection.collapsed(offset: text.length),
);
tester.emitPlatformMessage(
SystemChannels.textInput.name,
SystemChannels.textInput.codec.encodeMethodCall(
MethodCall(
'TextInputClient.updateEditingState',
[-1, _textInputController.value.toJSON()],
),
),
);
}
/// Called when it executes the action in a flow file.
@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();
return true;
}
@override
String description() => 'Some text to write "$text"';
}
Description
I'm trying to implement a new action based in this issue, I'm following the
expect_environment_textexample on theexamplesproject, but, when I run this new action I'm gettingSteps To Reproduce
expect_environment_textin order to create a new action withalt_write_textas name.writeTextwithaltWriteTextfluttium test flows/text_flow.yaml --flavor development --target lib/main_development.dartExpected Behavior
The fluttium action should work.
Screenshots
Additional Context
Here's the version of
AltWriteTextthat I'm using: