TF-3552 Add expect email view scrollable with long content
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -8,12 +8,18 @@ abstract class PlatformInfo {
|
|||||||
static bool isIntegrationTesting = false;
|
static bool isIntegrationTesting = false;
|
||||||
|
|
||||||
static bool get isWeb => kIsWeb || isTestingForWeb;
|
static bool get isWeb => kIsWeb || isTestingForWeb;
|
||||||
static bool get isLinux => !isWeb && defaultTargetPlatform == TargetPlatform.linux;
|
static bool get isLinux =>
|
||||||
static bool get isWindows => !isWeb && defaultTargetPlatform == TargetPlatform.windows;
|
!isWeb && defaultTargetPlatform == TargetPlatform.linux;
|
||||||
static bool get isMacOS => !isWeb && defaultTargetPlatform == TargetPlatform.macOS;
|
static bool get isWindows =>
|
||||||
static bool get isFuchsia => !isWeb && defaultTargetPlatform == TargetPlatform.fuchsia;
|
!isWeb && defaultTargetPlatform == TargetPlatform.windows;
|
||||||
static bool get isIOS => !isWeb && defaultTargetPlatform == TargetPlatform.iOS;
|
static bool get isMacOS =>
|
||||||
static bool get isAndroid => !isWeb && defaultTargetPlatform == TargetPlatform.android;
|
!isWeb && defaultTargetPlatform == TargetPlatform.macOS;
|
||||||
|
static bool get isFuchsia =>
|
||||||
|
!isWeb && defaultTargetPlatform == TargetPlatform.fuchsia;
|
||||||
|
static bool get isIOS =>
|
||||||
|
!isWeb && defaultTargetPlatform == TargetPlatform.iOS;
|
||||||
|
static bool get isAndroid =>
|
||||||
|
!isWeb && defaultTargetPlatform == TargetPlatform.android;
|
||||||
static bool get isMobile => isAndroid || isIOS;
|
static bool get isMobile => isAndroid || isIOS;
|
||||||
static bool get isDesktop => isLinux || isWindows || isMacOS;
|
static bool get isDesktop => isLinux || isWindows || isMacOS;
|
||||||
static bool get isCanvasKit => isRendererCanvasKit;
|
static bool get isCanvasKit => isRendererCanvasKit;
|
||||||
|
|||||||
+22
@@ -1,6 +1,9 @@
|
|||||||
|
|
||||||
import 'package:core/presentation/views/html_viewer/html_content_viewer_widget.dart';
|
import 'package:core/presentation/views/html_viewer/html_content_viewer_widget.dart';
|
||||||
|
import 'package:core/utils/platform_info.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:tmail_ui_user/features/email/presentation/widgets/email_subject_widget.dart';
|
||||||
import 'package:tmail_ui_user/features/thread/presentation/widgets/email_tile_builder.dart';
|
import 'package:tmail_ui_user/features/thread/presentation/widgets/email_tile_builder.dart';
|
||||||
|
|
||||||
import '../../base/base_test_scenario.dart';
|
import '../../base/base_test_scenario.dart';
|
||||||
@@ -18,6 +21,8 @@ class DisplayAndScrollEmailWithLongContentScenario extends BaseTestScenario {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> runTestLogic() async {
|
Future<void> runTestLogic() async {
|
||||||
|
PlatformInfo.isIntegrationTesting = true;
|
||||||
|
|
||||||
const emailUser = String.fromEnvironment('BASIC_AUTH_EMAIL');
|
const emailUser = String.fromEnvironment('BASIC_AUTH_EMAIL');
|
||||||
final provisioningEmail = ProvisioningEmail(
|
final provisioningEmail = ProvisioningEmail(
|
||||||
toEmail: emailUser,
|
toEmail: emailUser,
|
||||||
@@ -35,6 +40,9 @@ class DisplayAndScrollEmailWithLongContentScenario extends BaseTestScenario {
|
|||||||
await $.pumpAndSettle(duration: const Duration(seconds: 3));
|
await $.pumpAndSettle(duration: const Duration(seconds: 3));
|
||||||
|
|
||||||
await _expectEmailViewWithLongContent();
|
await _expectEmailViewWithLongContent();
|
||||||
|
await _expectEmailViewScrollableWithLongContent();
|
||||||
|
|
||||||
|
PlatformInfo.isIntegrationTesting = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _expectDisplayedEmailWithSubject() async {
|
Future<void> _expectDisplayedEmailWithSubject() async {
|
||||||
@@ -54,4 +62,18 @@ class DisplayAndScrollEmailWithLongContentScenario extends BaseTestScenario {
|
|||||||
findsOneWidget,
|
findsOneWidget,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> _expectEmailViewScrollableWithLongContent() async {
|
||||||
|
expect($(EmailSubjectWidget).visible, isTrue);
|
||||||
|
|
||||||
|
await $.scrollUntilVisible(
|
||||||
|
finder: $(#integration_testing_email_detailed_divider),
|
||||||
|
scrollDirection: AxisDirection.down,
|
||||||
|
delta: 150,
|
||||||
|
maxScrolls: 100,
|
||||||
|
);
|
||||||
|
await $.pumpAndSettle();
|
||||||
|
|
||||||
|
expect($(EmailSubjectWidget).visible, isFalse);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -427,6 +427,12 @@ class EmailView extends GetWidget<SingleEmailController> {
|
|||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
if (PlatformInfo.isIntegrationTesting)
|
||||||
|
const Divider(
|
||||||
|
key: Key('integration_testing_email_detailed_divider'),
|
||||||
|
height: 5,
|
||||||
|
color: Colors.transparent,
|
||||||
|
),
|
||||||
Obx(() {
|
Obx(() {
|
||||||
if (controller.attachments.isNotEmpty) {
|
if (controller.attachments.isNotEmpty) {
|
||||||
return EmailAttachmentsWidget(
|
return EmailAttachmentsWidget(
|
||||||
|
|||||||
Reference in New Issue
Block a user