You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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}classAltWriteTextextendsAction {
/// {@macro alt_write_text}AltWriteText({
requiredthis.text,
});
final _textInputController =TextInputController();
finalString 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.@overrideFuture<bool> execute(Tester tester) async {
TextInput.setInputControl(_textInputController);
tester.emitPlatformMessage(
SystemChannels.textInput.name,
SystemChannels.textInput.codec.encodeMethodCall(
constMethodCall('TextInputClient.requestExistingInputState'),
),
);
TextInput.restorePlatformInputControl();
// Temporary workaround, enter whole text instead of character by characterawait_enterText(tester, text);
await tester.pumpAndSettle();
returntrue;
}
@overrideStringdescription() =>'Some text to write "$text"';
}
The text was updated successfully, but these errors were encountered:
Description
I'm trying to implement a new action based in this issue, I'm following the
expect_environment_text
example on theexamples
project, but, when I run this new action I'm gettingSteps To Reproduce
expect_environment_text
in order to create a new action withalt_write_text
as name.writeText
withaltWriteText
fluttium test flows/text_flow.yaml --flavor development --target lib/main_development.dart
Expected Behavior
The fluttium action should work.
Screenshots
Additional Context
Here's the version of
AltWriteText
that I'm using:The text was updated successfully, but these errors were encountered: