Upgrade Patrol to 4.5.0 (#4446)
This commit is contained in:
@@ -85,7 +85,6 @@ class HtmlContentViewState extends State<HtmlContentViewer> with AutomaticKeepAl
|
|||||||
|
|
||||||
String? _htmlData;
|
String? _htmlData;
|
||||||
|
|
||||||
@visibleForTesting
|
|
||||||
InAppWebViewController get webViewController => _webViewController;
|
InAppWebViewController get webViewController => _webViewController;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -6,4 +6,6 @@ abstract class CoreRobot {
|
|||||||
CoreRobot(this.$);
|
CoreRobot(this.$);
|
||||||
|
|
||||||
dynamic ignoreException() => $.tester.takeException();
|
dynamic ignoreException() => $.tester.takeException();
|
||||||
|
|
||||||
|
MobileAutomator get native => $.platformAutomator.mobile;
|
||||||
}
|
}
|
||||||
@@ -28,8 +28,8 @@ class TestBase {
|
|||||||
visibleTimeout: Duration(seconds: 30),
|
visibleTimeout: Duration(seconds: 30),
|
||||||
printLogs: true,
|
printLogs: true,
|
||||||
),
|
),
|
||||||
nativeAutomatorConfig: const NativeAutomatorConfig(
|
platformAutomatorConfig: PlatformAutomatorConfig.fromOptions(
|
||||||
findTimeout: Duration(seconds: 10),
|
findTimeout: const Duration(seconds: 10),
|
||||||
),
|
),
|
||||||
framePolicy: LiveTestWidgetsFlutterBindingFramePolicy.benchmarkLive,
|
framePolicy: LiveTestWidgetsFlutterBindingFramePolicy.benchmarkLive,
|
||||||
($) async {
|
($) async {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'dart:io' hide HttpClient;
|
|||||||
|
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:core/utils/app_logger.dart';
|
import 'package:core/utils/app_logger.dart';
|
||||||
|
import 'package:core/utils/platform_info.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:jmap_dart_client/http/http_client.dart';
|
import 'package:jmap_dart_client/http/http_client.dart';
|
||||||
@@ -17,6 +18,7 @@ import 'package:jmap_dart_client/jmap/mail/mailbox/mailbox.dart';
|
|||||||
import 'package:labels/extensions/list_label_extension.dart';
|
import 'package:labels/extensions/list_label_extension.dart';
|
||||||
import 'package:model/model.dart';
|
import 'package:model/model.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
import 'package:patrol/patrol.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/domain/state/upload_attachment_state.dart';
|
import 'package:tmail_ui_user/features/composer/domain/state/upload_attachment_state.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/domain/usecases/create_new_and_send_email_interactor.dart';
|
import 'package:tmail_ui_user/features/composer/domain/usecases/create_new_and_send_email_interactor.dart';
|
||||||
import 'package:tmail_ui_user/features/composer/domain/usecases/upload_attachment_interactor.dart';
|
import 'package:tmail_ui_user/features/composer/domain/usecases/upload_attachment_interactor.dart';
|
||||||
@@ -287,4 +289,14 @@ mixin ScenarioUtilsMixin {
|
|||||||
void hideKeyboard() {
|
void hideKeyboard() {
|
||||||
FocusManager.instance.primaryFocus?.unfocus();
|
FocusManager.instance.primaryFocus?.unfocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> mobileBack(PatrolIntegrationTester $) async {
|
||||||
|
if (PlatformInfo.isIOS) {
|
||||||
|
await $.platformAutomator.ios.swipeBack();
|
||||||
|
} else if (PlatformInfo.isAndroid) {
|
||||||
|
await $.platformAutomator.android.pressBack();
|
||||||
|
} else {
|
||||||
|
throw UnsupportedError('mobileBack() is only supported on Android/iOS');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,9 +86,9 @@ class ComposerRobot extends CoreRobot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> grantContactPermission() async {
|
Future<void> grantContactPermission() async {
|
||||||
if (await $.native
|
if (await native
|
||||||
.isPermissionDialogVisible(timeout: const Duration(seconds: 5))) {
|
.isPermissionDialogVisible(timeout: const Duration(seconds: 5))) {
|
||||||
await $.native.grantPermissionWhenInUse();
|
await native.grantPermissionWhenInUse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:patrol/patrol.dart';
|
|
||||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||||
|
|
||||||
import '../base/core_robot.dart';
|
import '../base/core_robot.dart';
|
||||||
@@ -10,9 +9,9 @@ class LoginRobot extends CoreRobot {
|
|||||||
|
|
||||||
LoginRobot(super.$);
|
LoginRobot(super.$);
|
||||||
|
|
||||||
Future<void> grantNotificationPermission(NativeAutomator nativeAutomator) async {
|
Future<void> grantNotificationPermission() async {
|
||||||
if (await nativeAutomator.isPermissionDialogVisible(timeout: const Duration(seconds: 1))) {
|
if (await native.isPermissionDialogVisible(timeout: const Duration(seconds: 1))) {
|
||||||
await nativeAutomator.grantPermissionWhenInUse();
|
await native.grantPermissionWhenInUse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ class MailboxMenuRobot extends CoreRobot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> closeMenu() async {
|
Future<void> closeMenu() async {
|
||||||
await $.native.swipe(from: const Offset(0.9, 0.5), to: const Offset(0, 0.5));
|
await native.swipe(from: const Offset(0.9, 0.5), to: const Offset(0, 0.5));
|
||||||
}
|
}
|
||||||
|
|
||||||
int getCurrentInboxCount() {
|
int getCurrentInboxCount() {
|
||||||
@@ -130,8 +130,8 @@ class MailboxMenuRobot extends CoreRobot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> tapConfirmRecoverDeletedMessages() async {
|
Future<void> tapConfirmRecoverDeletedMessages() async {
|
||||||
if (await $.native.isPermissionDialogVisible(timeout: const Duration(seconds: 2))) {
|
if (await native.isPermissionDialogVisible(timeout: const Duration(seconds: 2))) {
|
||||||
await $.native.grantPermissionWhenInUse();
|
await native.grantPermissionWhenInUse();
|
||||||
}
|
}
|
||||||
await $(AppLocalizations().restore).tap();
|
await $(AppLocalizations().restore).tap();
|
||||||
await $.pumpAndSettle();
|
await $.pumpAndSettle();
|
||||||
|
|||||||
@@ -35,19 +35,20 @@ class AppGridScenario extends BaseTestScenario {
|
|||||||
await Future.delayed(const Duration(seconds: 2));
|
await Future.delayed(const Duration(seconds: 2));
|
||||||
|
|
||||||
if (PlatformInfo.isAndroid) {
|
if (PlatformInfo.isAndroid) {
|
||||||
await $.native.pressHome();
|
final native = $.platformAutomator.android;
|
||||||
await $.native.openApp();
|
await native.pressHome();
|
||||||
|
await native.openApp();
|
||||||
|
|
||||||
await appGridRobot.openAppInAppGridByAppName('Twake Sync');
|
await appGridRobot.openAppInAppGridByAppName('Twake Sync');
|
||||||
await Future.delayed(const Duration(seconds: 2));
|
await Future.delayed(const Duration(seconds: 2));
|
||||||
|
|
||||||
await $.native.pressBack();
|
await native.pressBack();
|
||||||
|
|
||||||
await appGridRobot.openAppInAppGridByAppName('Twake Chat');
|
await appGridRobot.openAppInAppGridByAppName('Twake Chat');
|
||||||
await Future.delayed(const Duration(seconds: 2));
|
await Future.delayed(const Duration(seconds: 2));
|
||||||
|
|
||||||
await $.native.pressBack();
|
await native.pressBack();
|
||||||
await $.native.pressBack();
|
await native.pressBack();
|
||||||
|
|
||||||
await _expectMailboxViewVisible();
|
await _expectMailboxViewVisible();
|
||||||
} else if (PlatformInfo.isIOS) {
|
} else if (PlatformInfo.isIOS) {
|
||||||
|
|||||||
@@ -45,6 +45,6 @@ class DownloadAllAttachmentsScenario extends BaseTestScenario {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _expectNativeSaveButtonVisible() async {
|
Future<void> _expectNativeSaveButtonVisible() async {
|
||||||
await expectLater($.native.tap(Selector(text: 'SAVE')), completes);
|
await expectLater($.platformAutomator.tap(Selector(text: 'SAVE')), completes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -42,7 +42,7 @@ class ExportAttachmentScenario extends BaseTestScenario {
|
|||||||
await emailRobot.onTapAttachmentItem();
|
await emailRobot.onTapAttachmentItem();
|
||||||
await $.pumpAndSettle();
|
await $.pumpAndSettle();
|
||||||
|
|
||||||
await $.native.pressBack();
|
await mobileBack($);
|
||||||
_expectEmailViewVisible();
|
_expectEmailViewVisible();
|
||||||
_expectExportDialogLoadingInvisible(appLocalizations);
|
_expectExportDialogLoadingInvisible(appLocalizations);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class LoginWithBasicAuthScenario extends BaseScenario {
|
|||||||
|
|
||||||
await loginRobot.loginBasicAuth();
|
await loginRobot.loginBasicAuth();
|
||||||
|
|
||||||
await loginRobot.grantNotificationPermission($.native);
|
await loginRobot.grantNotificationPermission();
|
||||||
|
|
||||||
await _expectThreadViewVisible();
|
await _expectThreadViewVisible();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class SendEmailWithReadReceiptEnabledScenario extends BaseTestScenario {
|
|||||||
await threadRobot.openEmailWithSubject(emailSubject);
|
await threadRobot.openEmailWithSubject(emailSubject);
|
||||||
await _expectReadReceiptRequestDialog(appLocalizations);
|
await _expectReadReceiptRequestDialog(appLocalizations);
|
||||||
|
|
||||||
await $.native.pressBack();
|
await mobileBack($);
|
||||||
await emailRobot.onTapBackButton();
|
await emailRobot.onTapBackButton();
|
||||||
|
|
||||||
await $.pumpAndSettle(duration: seconds(5));
|
await $.pumpAndSettle(duration: seconds(5));
|
||||||
|
|||||||
+6
-6
@@ -1730,26 +1730,26 @@ packages:
|
|||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: patrol
|
name: patrol
|
||||||
sha256: "782988d05af24427296e48417c36c520598656e00ba73c401a19ecd65262ee0b"
|
sha256: "7825a6e96a8f0755f68eec600a91a08b19bd0975488a70885b3696f6b65ffc0f"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.19.0"
|
version: "4.5.0"
|
||||||
patrol_finders:
|
patrol_finders:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: patrol_finders
|
name: patrol_finders
|
||||||
sha256: "4a658d7d560de523f92deb3fa3326c78747ca0bf7e7f4b8788c012463138b628"
|
sha256: "9970eac0669a90b20ec7e1bcaabd0475655655998068ca656f4df9f6ec84f336"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.9.0"
|
version: "3.2.0"
|
||||||
patrol_log:
|
patrol_log:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
name: patrol_log
|
name: patrol_log
|
||||||
sha256: "9fed4143980df1e3bbcfa00d0b443c7d68f04f9132317b7698bbc37f8a5a58c5"
|
sha256: a2360db165c34692665c0de146e5157887d6b584fdccca8f141f947a5acf1b2e
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.0"
|
version: "0.8.0"
|
||||||
pattern_formatter:
|
pattern_formatter:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
+4
-3
@@ -295,11 +295,11 @@ dev_dependencies:
|
|||||||
|
|
||||||
http_mock_adapter: 0.4.2
|
http_mock_adapter: 0.4.2
|
||||||
|
|
||||||
patrol: 3.19.0
|
patrol: 4.5.0
|
||||||
|
|
||||||
patrol_log: 0.5.0
|
patrol_log: 0.8.0
|
||||||
|
|
||||||
patrol_finders: 2.9.0
|
patrol_finders: 3.2.0
|
||||||
|
|
||||||
plugin_platform_interface: 2.1.8
|
plugin_platform_interface: 2.1.8
|
||||||
|
|
||||||
@@ -444,6 +444,7 @@ cider:
|
|||||||
tag: https://github.com/linagora/tmail-flutter/releases/tag/v%tag% # initial release link template
|
tag: https://github.com/linagora/tmail-flutter/releases/tag/v%tag% # initial release link template
|
||||||
|
|
||||||
patrol:
|
patrol:
|
||||||
|
test_directory: integration_test
|
||||||
app_name: Twake Mail
|
app_name: Twake Mail
|
||||||
android:
|
android:
|
||||||
package_name: com.linagora.android.teammail
|
package_name: com.linagora.android.teammail
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/tru
|
|||||||
|
|
||||||
# Install patrol CLI
|
# Install patrol CLI
|
||||||
echo "Installing patrol CLI..."
|
echo "Installing patrol CLI..."
|
||||||
dart pub global activate patrol_cli 3.6.0
|
dart pub global activate patrol_cli 4.3.1
|
||||||
flutter build apk --config-only
|
flutter build apk --config-only
|
||||||
|
|
||||||
# Forward traffic to tmail-backend
|
# Forward traffic to tmail-backend
|
||||||
|
|||||||
Reference in New Issue
Block a user