TF-4236 Set setUp and tearDown for Patrol
This commit is contained in:
@@ -10,15 +10,9 @@ abstract class BaseTestScenario extends BaseScenario
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> execute() async {
|
Future<void> execute() async {
|
||||||
await setupPreLogin();
|
|
||||||
await executeLoginScenario();
|
await executeLoginScenario();
|
||||||
await runTestLogic();
|
await runTestLogic();
|
||||||
await disposeAfterTest();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> setupPreLogin() async {}
|
|
||||||
|
|
||||||
Future<void> runTestLogic();
|
Future<void> runTestLogic();
|
||||||
|
|
||||||
Future<void> disposeAfterTest() async {}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:core/utils/platform_info.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:patrol/patrol.dart';
|
import 'package:patrol/patrol.dart';
|
||||||
@@ -15,6 +16,10 @@ class TestBase {
|
|||||||
required String description,
|
required String description,
|
||||||
required BaseScenario Function(PatrolIntegrationTester $) scenarioBuilder,
|
required BaseScenario Function(PatrolIntegrationTester $) scenarioBuilder,
|
||||||
}) {
|
}) {
|
||||||
|
patrolSetUp(_setupAll);
|
||||||
|
|
||||||
|
patrolTearDown(_tearDown);
|
||||||
|
|
||||||
patrolTest(
|
patrolTest(
|
||||||
description,
|
description,
|
||||||
config: const PatrolTesterConfig(
|
config: const PatrolTesterConfig(
|
||||||
@@ -41,4 +46,12 @@ class TestBase {
|
|||||||
originalOnError(details);
|
originalOnError(details);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> _setupAll() async {
|
||||||
|
PlatformInfo.isIntegrationTesting = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _tearDown() async {
|
||||||
|
PlatformInfo.isIntegrationTesting = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:core/utils/platform_info.dart';
|
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:labels/labels.dart';
|
import 'package:labels/labels.dart';
|
||||||
import 'package:tmail_ui_user/features/mailbox/presentation/widgets/labels/label_list_view.dart';
|
import 'package:tmail_ui_user/features/mailbox/presentation/widgets/labels/label_list_view.dart';
|
||||||
@@ -14,11 +13,6 @@ class DisplayEmptyViewWhenOpenTagScenario extends BaseTestScenario
|
|||||||
with ProvisioningLabelScenarioMixin {
|
with ProvisioningLabelScenarioMixin {
|
||||||
const DisplayEmptyViewWhenOpenTagScenario(super.$);
|
const DisplayEmptyViewWhenOpenTagScenario(super.$);
|
||||||
|
|
||||||
@override
|
|
||||||
Future<void> setupPreLogin() async {
|
|
||||||
PlatformInfo.isIntegrationTesting = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> runTestLogic() async {
|
Future<void> runTestLogic() async {
|
||||||
const emailUser = String.fromEnvironment('BASIC_AUTH_EMAIL');
|
const emailUser = String.fromEnvironment('BASIC_AUTH_EMAIL');
|
||||||
@@ -89,9 +83,4 @@ class DisplayEmptyViewWhenOpenTagScenario extends BaseTestScenario
|
|||||||
$(find.text(AppLocalizations().youDoNotHaveAnyEmailTaggedWithThis)),
|
$(find.text(AppLocalizations().youDoNotHaveAnyEmailTaggedWithThis)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
Future<void> disposeAfterTest() async {
|
|
||||||
PlatformInfo.isIntegrationTesting = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:core/utils/platform_info.dart';
|
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:labels/labels.dart';
|
import 'package:labels/labels.dart';
|
||||||
import 'package:tmail_ui_user/features/mailbox/presentation/widgets/labels/label_list_view.dart';
|
import 'package:tmail_ui_user/features/mailbox/presentation/widgets/labels/label_list_view.dart';
|
||||||
@@ -13,11 +12,6 @@ class DisplayViewWithAllEmailWithTagScenario extends BaseTestScenario
|
|||||||
with ProvisioningLabelScenarioMixin {
|
with ProvisioningLabelScenarioMixin {
|
||||||
const DisplayViewWithAllEmailWithTagScenario(super.$);
|
const DisplayViewWithAllEmailWithTagScenario(super.$);
|
||||||
|
|
||||||
@override
|
|
||||||
Future<void> setupPreLogin() async {
|
|
||||||
PlatformInfo.isIntegrationTesting = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> runTestLogic() async {
|
Future<void> runTestLogic() async {
|
||||||
const emailUser = String.fromEnvironment('BASIC_AUTH_EMAIL');
|
const emailUser = String.fromEnvironment('BASIC_AUTH_EMAIL');
|
||||||
@@ -74,9 +68,4 @@ class DisplayViewWithAllEmailWithTagScenario extends BaseTestScenario
|
|||||||
|
|
||||||
expect(listEmailTileWithTag.length, greaterThanOrEqualTo(emailCount));
|
expect(listEmailTileWithTag.length, greaterThanOrEqualTo(emailCount));
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
Future<void> disposeAfterTest() async {
|
|
||||||
PlatformInfo.isIntegrationTesting = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user