Skip to content

Commit

Permalink
Enter text into composer content
Browse files Browse the repository at this point in the history
  • Loading branch information
tddang-linagora committed Jul 16, 2024
1 parent 972fefb commit 9893af9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
12 changes: 10 additions & 2 deletions integration_test/robots/composer_robot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ class ComposerRobot extends CoreRobot {
}

Future<void> addContent(String content) async {
await $(MobileEditorView).$(HtmlEditor).tap();
await $(MobileEditorView).$(HtmlEditor).enterText(content);
await $(MobileEditorView).$(HtmlEditor).$(InAppWebView).tap();

$.tester.testTextInput.register();
await $.native.enterTextByIndex(content, index: 2);
}

Future<void> sendEmail() async {
Expand All @@ -42,4 +44,10 @@ class ComposerRobot extends CoreRobot {
Future<void> expectSendEmailSuccessToast() async {
expect($('Message has been sent successfully'), findsOneWidget);
}

Future<void> grantContactPermission() async {
if (await $.native.isPermissionDialogVisible(timeout: const Duration(seconds: 5))) {
await $.native.grantPermissionWhenInUse();
}
}
}
1 change: 1 addition & 0 deletions integration_test/robots/login_robot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class LoginRobot extends CoreRobot {
final finder = $(LoginView).$(TextField);
await finder.enterText(url);
await $('Next').tap();
await $.pumpAndTrySettle(duration: const Duration(seconds: 10));
}

Future<void> enterOidcUsername(String username) async {
Expand Down
2 changes: 0 additions & 2 deletions integration_test/robots/thread_robot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import '../base/core_robot.dart';
class ThreadRobot extends CoreRobot {
ThreadRobot(super.$);

bool checkIfThreadViewVisible() => $(ThreadView).visible;

Future<void> expectThreadViewVisible() => ensureViewVisible($(ThreadView));

Future<void> openComposer() async {
Expand Down
2 changes: 2 additions & 0 deletions integration_test/scenarios/send_email.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class SendEmail extends BaseScenario {
await threadRobot.openComposer();
await threadRobot.expectComposerViewVisible();

await composerRobot.grantContactPermission();

await composerRobot.addReceipient(loginWithOidcScenario.email);
await composerRobot.addReceipient(additionalRecipient);
await composerRobot.addSubject(subject);
Expand Down

0 comments on commit 9893af9

Please sign in to comment.