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 {
|
||||
|
||||
@@ -38,7 +38,7 @@ class ForwardEmailScenario extends BaseScenario {
|
||||
await searchRobot.tapOnShowAllResultsText();
|
||||
await _expectSearchResultEmailListVisible();
|
||||
|
||||
await searchRobot.openEmail('Fwd: Forward email');
|
||||
await searchRobot.openEmailWithSubject('Fwd: Forward email');
|
||||
await _expectEmailViewVisible();
|
||||
await _expectForwardEmailButtonVisible();
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:tmail_ui_user/features/login/presentation/login_view.dart';
|
||||
import 'package:tmail_ui_user/features/starting_page/presentation/twake_welcome/twake_welcome_view.dart';
|
||||
import 'package:tmail_ui_user/features/thread/presentation/thread_view.dart';
|
||||
@@ -25,16 +26,29 @@ class LoginWithBasicAuthScenario extends BaseScenario {
|
||||
Future<void> execute() async {
|
||||
final loginRobot = LoginRobot($);
|
||||
|
||||
await $.pumpAndSettle();
|
||||
await _expectWelcomeViewVisible();
|
||||
|
||||
await loginRobot.tapOnUseCompanyServer();
|
||||
await _expectLoginViewVisible();
|
||||
|
||||
await loginRobot.enterEmail(username);
|
||||
await _expectUsernameToBeEntered();
|
||||
|
||||
await loginRobot.tapOnNextButton();
|
||||
await _expectBaseUrlFormVisible();
|
||||
|
||||
await loginRobot.enterHostUrl(hostUrl);
|
||||
await _expectHostUrlToBeEntered();
|
||||
|
||||
await loginRobot.tapOnNextButton();
|
||||
await _expectCredentialInputFormVisible();
|
||||
|
||||
await loginRobot.enterBasicAuthEmail(email);
|
||||
await _expectEmailToBeEntered();
|
||||
|
||||
await loginRobot.enterBasicAuthPassword(password);
|
||||
|
||||
await loginRobot.loginBasicAuth();
|
||||
|
||||
await loginRobot.grantNotificationPermission($.native);
|
||||
@@ -46,5 +60,29 @@ class LoginWithBasicAuthScenario extends BaseScenario {
|
||||
|
||||
Future<void> _expectLoginViewVisible() => expectViewVisible($(LoginView));
|
||||
|
||||
Future<void> _expectBaseUrlFormVisible() async {
|
||||
await expectViewVisible($(LoginView).$(#base_url_form));
|
||||
}
|
||||
|
||||
Future<void> _expectUsernameToBeEntered() async {
|
||||
await expectViewVisible($(find.text(username)));
|
||||
}
|
||||
|
||||
Future<void> _expectHostUrlToBeEntered() async {
|
||||
final urlWithoutScheme = hostUrl
|
||||
.replaceFirst('https://', '')
|
||||
.replaceFirst('http://', '');
|
||||
|
||||
await expectViewVisible($(find.textContaining(urlWithoutScheme)));
|
||||
}
|
||||
|
||||
Future<void> _expectCredentialInputFormVisible() async {
|
||||
await expectViewVisible($(LoginView).$(#credential_input_form));
|
||||
}
|
||||
|
||||
Future<void> _expectEmailToBeEntered() async {
|
||||
await expectViewVisible($(find.text(email)));
|
||||
}
|
||||
|
||||
Future<void> _expectThreadViewVisible() => expectViewVisible($(ThreadView));
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -38,6 +38,7 @@ abstract class BaseLoginView extends GetWidget<LoginController> {
|
||||
|
||||
Widget buildInputCredentialForm(BuildContext context) {
|
||||
return AutofillGroup(
|
||||
key: const Key('credential_input_form'),
|
||||
child: Padding(
|
||||
padding: const EdgeInsetsDirectional.symmetric(horizontal: 24),
|
||||
child: FocusTraversalGroup(
|
||||
|
||||
@@ -99,6 +99,7 @@ class LoginView extends BaseLoginView {
|
||||
case LoginFormType.dnsLookupForm:
|
||||
case LoginFormType.retry:
|
||||
return DNSLookupInputForm(
|
||||
key: const Key('dns_lookup_input_form'),
|
||||
textEditingController: controller.usernameInputController,
|
||||
onTextChange: controller.onUsernameChange,
|
||||
onTextSubmitted: (_) => controller.invokeDNSLookupToGetJmapUrl(),
|
||||
@@ -135,6 +136,7 @@ class LoginView extends BaseLoginView {
|
||||
|
||||
Widget _buildUrlInput(BuildContext context) {
|
||||
return Padding(
|
||||
key: const Key('base_url_form'),
|
||||
padding: const EdgeInsets.only(right: 24, left: 24, bottom: 24),
|
||||
child: TypeAheadFormFieldBuilder<RecentLoginUrl>(
|
||||
controller: controller.urlInputController,
|
||||
|
||||
+20
-4
@@ -440,6 +440,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.0.0"
|
||||
dispose_scope:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: dispose_scope
|
||||
sha256: "48ec38ca2631c53c4f8fa96b294c801e55c335db5e3fb9f82cede150cfe5a2af"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
dns_client:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -1572,18 +1580,26 @@ packages:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: patrol
|
||||
sha256: "6ac5e239384282da389a6b78d68aa86d8760ad8d5481d665937c4eb586c0b3dc"
|
||||
sha256: "2bb991db06b5e1eb2ec5c803067c41316d94d01dda93ddf16f5342073d791a20"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.11.0"
|
||||
version: "3.14.0"
|
||||
patrol_finders:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: patrol_finders
|
||||
sha256: "6bf2c3093fbccd02f80f73fafc1bd021d76410cbab6e329be220b5e3bc58f072"
|
||||
sha256: "4c6d78e00362fd15d7c21cfac110e501d08ada7d77000bad139b0c3c2e27ccaf"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
version: "2.7.0"
|
||||
patrol_log:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: patrol_log
|
||||
sha256: "98b2701400c7a00b11533ab942bdeb44c3c714746e7cdb12e6cb93b6d06361da"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.0"
|
||||
pattern_formatter:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
+1
-1
@@ -288,7 +288,7 @@ dev_dependencies:
|
||||
|
||||
http_mock_adapter: 0.4.2
|
||||
|
||||
patrol: 3.11.0
|
||||
patrol: 3.14.0
|
||||
|
||||
plugin_platform_interface: 2.1.8
|
||||
|
||||
|
||||
Reference in New Issue
Block a user