TF-3493 Upgrade Patrol to version 3.14.0 and Patrol_CLI to version 3.5.0
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -17,16 +17,30 @@ class ComposerRobot extends CoreRobot {
|
||||
ComposerRobot(super.$);
|
||||
|
||||
Future<void> addRecipient(String email) async {
|
||||
await $(RecipientComposerWidget)
|
||||
.which<RecipientComposerWidget>((widget) => widget.prefix == PrefixEmailAddress.to)
|
||||
.enterText(email);
|
||||
final finder = $(RecipientComposerWidget)
|
||||
.which<RecipientComposerWidget>((widget) => widget.prefix == PrefixEmailAddress.to);
|
||||
final isTextFieldFocused = finder
|
||||
.which<RecipientComposerWidget>((view) => view.focusNode?.hasFocus ?? false)
|
||||
.exists;
|
||||
if (!isTextFieldFocused) {
|
||||
await finder.tap();
|
||||
}
|
||||
await finder.enterText(email);
|
||||
|
||||
await $(RecipientSuggestionItemWidget)
|
||||
.which<RecipientSuggestionItemWidget>((widget) => widget.emailAddress.email?.contains(email) ?? false)
|
||||
.tap();
|
||||
}
|
||||
|
||||
Future<void> addSubject(String subject) async {
|
||||
await $(SubjectComposerWidget).enterText(subject);
|
||||
final finder = $(SubjectComposerWidget);
|
||||
final isTextFieldFocused = finder
|
||||
.which<SubjectComposerWidget>((view) => view.focusNode?.hasFocus ?? false)
|
||||
.exists;
|
||||
if (!isTextFieldFocused) {
|
||||
await finder.tap();
|
||||
}
|
||||
await finder.enterText(subject);
|
||||
}
|
||||
|
||||
Future<void> addContent(String content) async {
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import 'package:core/presentation/views/text/type_ahead_form_field_builder.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patrol/patrol.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/model/recent_login_username.dart';
|
||||
import 'package:tmail_ui_user/features/login/presentation/login_view.dart';
|
||||
import 'package:tmail_ui_user/features/login/presentation/widgets/login_text_input_builder.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
import '../base/core_robot.dart';
|
||||
|
||||
class LoginRobot extends CoreRobot {
|
||||
final appLocalizations = AppLocalizations();
|
||||
|
||||
LoginRobot(super.$);
|
||||
|
||||
Future<void> grantNotificationPermission(NativeAutomator nativeAutomator) async {
|
||||
@@ -18,37 +16,58 @@ class LoginRobot extends CoreRobot {
|
||||
}
|
||||
|
||||
Future<void> tapOnUseCompanyServer() async {
|
||||
await $.pumpAndSettle();
|
||||
await $(AppLocalizations().useCompanyServer).tap();
|
||||
await $(appLocalizations.useCompanyServer).tap();
|
||||
}
|
||||
|
||||
Future<void> enterEmail(String email) async {
|
||||
final finder = $(LoginView).$(TextField);
|
||||
final finder = $(#dns_lookup_input_form).$(TextField);
|
||||
final isTextFieldFocused = finder
|
||||
.which<TextField>((view) => view.focusNode?.hasFocus ?? false)
|
||||
.exists;
|
||||
if (!isTextFieldFocused) {
|
||||
await finder.tap();
|
||||
}
|
||||
await finder.enterText(email);
|
||||
await $('Next').tap();
|
||||
}
|
||||
|
||||
Future<void> enterHostUrl(String url) async {
|
||||
final finder = $(LoginView).$(TextField);
|
||||
final finder = $(#base_url_form).$(TextField);
|
||||
final isTextFieldFocused = finder
|
||||
.which<TextField>((view) => view.focusNode?.hasFocus ?? false)
|
||||
.exists;
|
||||
if (!isTextFieldFocused) {
|
||||
await finder.tap();
|
||||
}
|
||||
await finder.enterText(url);
|
||||
await $('Next').tap();
|
||||
}
|
||||
|
||||
Future<void> tapOnNextButton() async {
|
||||
await $(appLocalizations.next).tap();
|
||||
}
|
||||
|
||||
Future<void> enterBasicAuthEmail(String email) async {
|
||||
await $(LoginView)
|
||||
.$(TypeAheadFormFieldBuilder<RecentLoginUsername>)
|
||||
.$(TextField)
|
||||
.enterText(email);
|
||||
final finder = $(#login_username_input).$(TextField);
|
||||
final isTextFieldFocused = finder
|
||||
.which<TextField>((view) => view.focusNode?.hasFocus ?? false)
|
||||
.exists;
|
||||
if (!isTextFieldFocused) {
|
||||
await finder.tap();
|
||||
}
|
||||
await finder.enterText(email);
|
||||
}
|
||||
|
||||
Future<void> enterBasicAuthPassword(String password) async {
|
||||
await $(LoginView)
|
||||
.$(LoginTextInputBuilder)
|
||||
.$(TextField)
|
||||
.enterText(password);
|
||||
final finder = $(#login_password_input).$(TextField);
|
||||
final isTextFieldFocused = finder
|
||||
.which<TextField>((view) => view.focusNode?.hasFocus ?? false)
|
||||
.exists;
|
||||
if (!isTextFieldFocused) {
|
||||
await finder.tap();
|
||||
}
|
||||
await finder.enterText(password);
|
||||
}
|
||||
|
||||
Future<void> loginBasicAuth() async {
|
||||
await $(Container).$(ElevatedButton).tap();
|
||||
await $(#loginSubmitForm).tap();
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,14 @@ class SearchRobot extends CoreRobot {
|
||||
SearchRobot(super.$);
|
||||
|
||||
Future<void> enterQueryString(String queryString) async {
|
||||
await $(#search_email_text_field).enterText(queryString);
|
||||
final finder = $(#search_email_text_field).$(TextField);
|
||||
final isTextFieldFocused = finder
|
||||
.which<TextField>((view) => view.focusNode?.hasFocus ?? false)
|
||||
.exists;
|
||||
if (!isTextFieldFocused) {
|
||||
await finder.tap();
|
||||
}
|
||||
await finder.enterText(queryString);
|
||||
}
|
||||
|
||||
Future<void> scrollToEndListSearchFilter() async {
|
||||
@@ -33,7 +40,14 @@ class SearchRobot extends CoreRobot {
|
||||
}
|
||||
|
||||
Future<void> enterKeyword(String keyword) async {
|
||||
await $(SearchEmailView).$(TextFieldBuilder).enterText(keyword);
|
||||
final finder = $(SearchEmailView).$(TextFieldBuilder);
|
||||
final isTextFieldFocused = finder
|
||||
.which<TextFieldBuilder>((view) => view.focusNode?.hasFocus ?? false)
|
||||
.exists;
|
||||
if (!isTextFieldFocused) {
|
||||
await finder.tap();
|
||||
}
|
||||
await finder.enterText(keyword);
|
||||
}
|
||||
|
||||
Future<void> tapOnShowAllResultsText() async {
|
||||
@@ -59,7 +73,7 @@ class SearchRobot extends CoreRobot {
|
||||
await $.pump(const Duration(seconds: 2));
|
||||
}
|
||||
|
||||
Future<void> openEmail(String subject) async {
|
||||
Future<void> openEmailWithSubject(String subject) async {
|
||||
await $(find.byType(EmailTileBuilder)).first.tap();
|
||||
await $.pump(const Duration(seconds: 2));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import 'package:core/presentation/views/search/search_bar_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:tmail_ui_user/features/base/widget/compose_floating_button.dart';
|
||||
import 'package:tmail_ui_user/features/thread/presentation/thread_view.dart';
|
||||
import 'package:tmail_ui_user/features/thread/presentation/widgets/email_tile_builder.dart';
|
||||
|
||||
import '../base/core_robot.dart';
|
||||
|
||||
@@ -21,8 +23,8 @@ class ThreadRobot extends CoreRobot {
|
||||
}
|
||||
|
||||
Future<void> openEmailWithSubject(String subject) async {
|
||||
await $.scrollUntilVisible(finder: $(subject));
|
||||
await $(subject).tap();
|
||||
await $(find.byType(EmailTileBuilder)).first.tap();
|
||||
await $.pump(const Duration(seconds: 2));
|
||||
}
|
||||
|
||||
Future<void> openMailbox() async {
|
||||
|
||||
Reference in New Issue
Block a user