mirror of
https://github.com/linagora/tmail-flutter.git
synced 2026-12-05 16:08:46 +00:00
TF-5022 T-07 Add web e2e for stand-alone avatar switcher flows
This commit is contained in:
1 parent
4ab72e5672
commit
0e95997dfd
18 files changed
+550
-2
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import 'package:tmail_ui_user/features/manage_account/presentation/model/account_menu_item.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
import '../base/base_test_scenario.dart';
|
||||
import '../robots/web/web_account_switcher_robot.dart';
|
||||
|
||||
/// Shared stand-alone web setup for T-07 account-switcher scenarios.
|
||||
mixin DelegationStandaloneScenarioMixin on BaseTestScenario {
|
||||
static const ownerAddress = 'alice@example.com';
|
||||
static const ownAddress = 'bob@example.com';
|
||||
|
||||
WebAccountSwitcherRobot get accountSwitcher => WebAccountSwitcherRobot($);
|
||||
|
||||
/// Turns Delegation on in Preferences and returns to the mailbox chrome.
|
||||
Future<void> enableDelegationAndReturnToMailbox() async {
|
||||
final l10n = AppLocalizations();
|
||||
final settingsRobot = robots.settingsRobot();
|
||||
final preferencesRobot = settingsRobot.preferencesRobot;
|
||||
|
||||
await robots.commonRobot().waitForMailboxReady();
|
||||
await accountSwitcher.assertion.expectSwitcherInactive();
|
||||
|
||||
await robots.mailboxMenuRobot().openSetting();
|
||||
await settingsRobot.openSettingsDetail(AccountMenuItem.preferences);
|
||||
await preferencesRobot.ensureDelegationPreferenceReady();
|
||||
await preferencesRobot.togglePreferenceOption(l10n.delegation);
|
||||
await preferencesRobot.expectPreferenceOption(
|
||||
l10n.delegation,
|
||||
switchedOn: true,
|
||||
);
|
||||
await settingsRobot.closeSettings();
|
||||
await robots.commonRobot().waitForMailboxReady();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
abstract class AbstractAccountSwitcherAssertionRobot {
|
||||
Future<void> expectSwitcherInactive();
|
||||
|
||||
Future<void> expectViewing(String ownerAddress);
|
||||
|
||||
Future<void> expectMenuShowsDelegated(String ownerAddress);
|
||||
|
||||
Future<void> expectSwitcherOnMine();
|
||||
|
||||
Future<void> expectSwitchSettled(String ownerAddress);
|
||||
|
||||
Future<void> expectLoadingDialogVisible(String ownerAddress);
|
||||
|
||||
Future<void> expectLoadingDialogGone();
|
||||
|
||||
Future<void> expectCouldNotOpenToast(String ownerAddress);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'abstract_account_switcher_assertion_robot.dart';
|
||||
|
||||
abstract class AbstractAccountSwitcherRobot {
|
||||
AbstractAccountSwitcherAssertionRobot get assertion;
|
||||
|
||||
Future<void> openMenu();
|
||||
|
||||
/// Opens the menu and picks a row by its visible address.
|
||||
Future<void> selectByAddress(String emailAddress);
|
||||
|
||||
/// Picks a row when the avatar menu is already open (does not toggle the menu).
|
||||
Future<void> selectAddressWhenMenuOpen(String emailAddress);
|
||||
|
||||
/// Opens the menu, picks [emailAddress], and waits for the loading dialog.
|
||||
///
|
||||
/// Does not pump-and-settle after the tap so an in-flight switch stays visible.
|
||||
Future<void> selectByAddressAwaitingLoading(String emailAddress);
|
||||
|
||||
Future<void> tapCancelOnLoadingDialog();
|
||||
|
||||
/// Cancels an in-flight switch via the loading dialog Cancel, or via the
|
||||
/// notifier during the show-delay window before the dialog appears.
|
||||
Future<void> cancelInFlightSwitch();
|
||||
|
||||
Future<void> dismissViewingBanner();
|
||||
}
|
||||
@@ -12,4 +12,7 @@ abstract class AbstractSettingsRobot {
|
||||
Future<void> openSettingsDetail(AccountMenuItem accountMenuItem);
|
||||
|
||||
Future<void> leaveSettingsDetail();
|
||||
|
||||
/// Leave Settings back to the mailbox dashboard.
|
||||
Future<void> closeSettings();
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:tmail_ui_user/features/base/model/ui_keys.dart';
|
||||
import 'package:tmail_ui_user/features/delegation/presentation/notifier/account_switch_notifier.dart';
|
||||
import 'package:tmail_ui_user/features/delegation/presentation/notifier/active_account_notifier.dart';
|
||||
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
|
||||
|
||||
import '../../base/core_robot.dart';
|
||||
import '../../utils/wait_for_condition.dart';
|
||||
import '../abstract/abstract_account_switcher_assertion_robot.dart';
|
||||
|
||||
class WebAccountSwitcherAssertionRobot extends CoreRobot
|
||||
implements AbstractAccountSwitcherAssertionRobot {
|
||||
WebAccountSwitcherAssertionRobot(super.$);
|
||||
|
||||
ProviderContainer _appContainer() {
|
||||
final element = $.tester.element(find.byType(MaterialApp));
|
||||
return ProviderScope.containerOf(element, listen: false);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> expectSwitcherInactive() async {
|
||||
await $.pumpAndTrySettle();
|
||||
// Mailbox chrome must be up so findsNothing is not vacuously true.
|
||||
await $(const ValueKey(UiKeys.userAvatar)).waitUntilVisible();
|
||||
expect(
|
||||
find.byKey(const ValueKey(UiKeys.viewingOwnerBanner)),
|
||||
findsNothing,
|
||||
);
|
||||
expect(
|
||||
find.byKey(const ValueKey(UiKeys.accountSwitcherMenu)),
|
||||
findsNothing,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> expectViewing(String ownerAddress) async {
|
||||
final label = AppLocalizations().viewingOwnerMailbox(ownerAddress);
|
||||
await $(const ValueKey(UiKeys.viewingOwnerBanner)).waitUntilVisible();
|
||||
await $(label).waitUntilVisible();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> expectMenuShowsDelegated(String ownerAddress) async {
|
||||
await $(AppLocalizations().delegatedToYou).waitUntilVisible();
|
||||
await $(ownerAddress).waitUntilVisible();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> expectSwitcherOnMine() async {
|
||||
await waitForCondition(
|
||||
() {
|
||||
final container = _appContainer();
|
||||
final active = container.read(activeAccountProvider);
|
||||
return active != null &&
|
||||
!active.isDelegated &&
|
||||
!container.read(accountSwitchProvider).isSwitching;
|
||||
},
|
||||
reason: 'showing mine and switch idle',
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> expectSwitchSettled(String ownerAddress) async {
|
||||
await waitForCondition(
|
||||
() {
|
||||
final container = _appContainer();
|
||||
if (container.read(accountSwitchProvider).isSwitching) return false;
|
||||
final active = container.read(activeAccountProvider);
|
||||
return active != null && active.ownerEmailAddress == ownerAddress;
|
||||
},
|
||||
reason: 'switched to $ownerAddress and idle',
|
||||
);
|
||||
await expectLoadingDialogGone();
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
await $.pumpAndTrySettle();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> expectLoadingDialogVisible(String ownerAddress) async {
|
||||
await waitForCondition(
|
||||
() async {
|
||||
// Zero show-delay opens the dialog on the next frame after switchStarted.
|
||||
await $.pump();
|
||||
return $(const ValueKey(UiKeys.accountSwitchLoadingDialog))
|
||||
.evaluate()
|
||||
.isNotEmpty;
|
||||
},
|
||||
reason: 'account switch loading dialog visible',
|
||||
);
|
||||
// Owner is inside Text.rich spans. find.text(owner) does not match that.
|
||||
await $(const ValueKey(UiKeys.accountSwitchLoadingCancel))
|
||||
.waitUntilVisible();
|
||||
expect(
|
||||
find.descendant(
|
||||
of: find.byKey(const ValueKey(UiKeys.accountSwitchLoadingDialog)),
|
||||
matching: find.textContaining(ownerAddress, findRichText: true),
|
||||
),
|
||||
findsOneWidget,
|
||||
reason: 'loading dialog copy names $ownerAddress',
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> expectLoadingDialogGone() async {
|
||||
await waitForCondition(
|
||||
() => $(const ValueKey(UiKeys.accountSwitchLoadingDialog))
|
||||
.evaluate()
|
||||
.isEmpty,
|
||||
reason: 'account switch loading dialog closed',
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> expectCouldNotOpenToast(String ownerAddress) async {
|
||||
final message =
|
||||
AppLocalizations().couldNotOpenOwnerMailbox(ownerAddress);
|
||||
await waitForCondition(
|
||||
() => $(message).evaluate().isNotEmpty,
|
||||
reason: 'could not open mailbox toast visible',
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:linagora_design_flutter/linagora_design_flutter.dart';
|
||||
import 'package:model/extensions/session_extension.dart';
|
||||
import 'package:patrol/patrol.dart';
|
||||
import 'package:tmail_ui_user/features/base/model/ui_keys.dart';
|
||||
import 'package:tmail_ui_user/features/delegation/domain/extensions/session_delegation_extension.dart';
|
||||
import 'package:tmail_ui_user/features/delegation/presentation/notifier/account_switch_notifier.dart';
|
||||
import 'package:tmail_ui_user/features/delegation/presentation/notifier/active_account_notifier.dart';
|
||||
|
||||
import '../../base/core_robot.dart';
|
||||
import '../../utils/wait_for_condition.dart';
|
||||
import '../abstract/abstract_account_switcher_assertion_robot.dart';
|
||||
import '../abstract/abstract_account_switcher_robot.dart';
|
||||
import 'web_account_switcher_assertion_robot.dart';
|
||||
|
||||
/// Web stand-alone avatar menu.
|
||||
class WebAccountSwitcherRobot extends CoreRobot
|
||||
implements AbstractAccountSwitcherRobot {
|
||||
@override
|
||||
final AbstractAccountSwitcherAssertionRobot assertion;
|
||||
|
||||
WebAccountSwitcherRobot(super.$)
|
||||
: assertion = WebAccountSwitcherAssertionRobot($);
|
||||
|
||||
bool get _isMenuOpen =>
|
||||
$(const ValueKey(UiKeys.accountSwitcherMenu)).evaluate().isNotEmpty;
|
||||
|
||||
ProviderContainer _appContainer() {
|
||||
final element = $.tester.element(find.byType(MaterialApp));
|
||||
return ProviderScope.containerOf(element, listen: false);
|
||||
}
|
||||
|
||||
AccountId _accountIdForAddress(String emailAddress) {
|
||||
final session = _appContainer().read(activeAccountProvider)?.session;
|
||||
if (session == null) {
|
||||
throw StateError('no active session for account switcher select');
|
||||
}
|
||||
if (session.getOwnEmailAddressOrEmpty() == emailAddress) {
|
||||
return session.accountId;
|
||||
}
|
||||
for (final entry in session.delegatedAccounts) {
|
||||
if (entry.value.name.value == emailAddress) return entry.key;
|
||||
}
|
||||
throw StateError('no account listed for $emailAddress');
|
||||
}
|
||||
|
||||
Future<void> _tapMenuItem(
|
||||
String emailAddress, {
|
||||
SettlePolicy? settlePolicy,
|
||||
}) async {
|
||||
final itemKey = LinagoraAccountMenu.itemKey(_accountIdForAddress(emailAddress));
|
||||
final row = $(const ValueKey(UiKeys.accountSwitcherMenu)).$(itemKey);
|
||||
if (settlePolicy == null) {
|
||||
await row.tap();
|
||||
} else {
|
||||
await row.tap(settlePolicy: settlePolicy);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> openMenu() async {
|
||||
if (_isMenuOpen) return;
|
||||
await $(const ValueKey(UiKeys.userAvatar)).tap();
|
||||
await $.pumpAndTrySettle();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> selectByAddress(String emailAddress) async {
|
||||
await openMenu();
|
||||
await selectAddressWhenMenuOpen(emailAddress);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> selectAddressWhenMenuOpen(String emailAddress) async {
|
||||
await _tapMenuItem(emailAddress);
|
||||
await $.pumpAndTrySettle();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> selectByAddressAwaitingLoading(String emailAddress) async {
|
||||
await openMenu();
|
||||
// Keep the switch in flight: trySettle would wait out showDelay + load and
|
||||
// hide the loading dialog before the assertion runs.
|
||||
await _tapMenuItem(emailAddress, settlePolicy: SettlePolicy.noSettle);
|
||||
await assertion.expectLoadingDialogVisible(emailAddress);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> tapCancelOnLoadingDialog() async {
|
||||
await $(
|
||||
const ValueKey(UiKeys.accountSwitchLoadingCancel),
|
||||
).tap(settlePolicy: SettlePolicy.noSettle);
|
||||
await assertion.expectLoadingDialogGone();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> cancelInFlightSwitch() async {
|
||||
await waitForCondition(
|
||||
() => _appContainer().read(accountSwitchProvider).isSwitching,
|
||||
reason: 'account switch in flight',
|
||||
);
|
||||
|
||||
final cancelButton = $(
|
||||
const ValueKey(UiKeys.accountSwitchLoadingCancel),
|
||||
);
|
||||
if (cancelButton.evaluate().isNotEmpty) {
|
||||
await cancelButton.tap(settlePolicy: SettlePolicy.noSettle);
|
||||
} else {
|
||||
// Still inside SwitchLoadingDialogTiming.showDelay — same cancel as the
|
||||
// dialog Cancel / Android back interceptor.
|
||||
_appContainer().read(accountSwitchProvider.notifier).cancel();
|
||||
await $.pump();
|
||||
}
|
||||
await assertion.expectLoadingDialogGone();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> dismissViewingBanner() async {
|
||||
await $(const ValueKey(UiKeys.viewingOwnerBannerDismiss)).tap();
|
||||
await $.pumpAndTrySettle();
|
||||
}
|
||||
}
|
||||
@@ -23,4 +23,10 @@ class WebSettingsRobot extends MobileSettingsRobot {
|
||||
// Web: the menu stays on screen, so leaving a detail means opening another one.
|
||||
await openSettingsDetail(AccountMenuItem.languageAndRegion);
|
||||
}
|
||||
|
||||
/// Web desktop (incl. Workplace) uses the sidebar Back, not the mobile close.
|
||||
@override
|
||||
Future<void> closeSettings() async {
|
||||
await $(#back_to_dashboard_button).tap();
|
||||
}
|
||||
}
|
||||
@@ -48,6 +48,12 @@ class WebThreadRobot extends ThreadRobot implements AbstractThreadRobot {
|
||||
viewport: WebThreadViewportRobot($),
|
||||
);
|
||||
|
||||
@override
|
||||
Future<void> openComposer() async {
|
||||
// ComposeButtonWidget wraps LinagoraSidebarPrimaryAction (no InkWell).
|
||||
await $(const ValueKey(UiKeys.composeEmailPrimaryAction)).tap();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> openAppGrid() async {
|
||||
await $(const ValueKey(UiKeys.toggleAppGridButton)).tap();
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
import '../../base/base_test_scenario.dart';
|
||||
import '../../mixin/delegation_standalone_scenario_mixin.dart';
|
||||
|
||||
/// Switch to owner, then return to mine via the avatar menu (not Viewing ✕).
|
||||
class SwitchBackToMineViaAvatarMenuStandaloneScenario extends BaseTestScenario
|
||||
with DelegationStandaloneScenarioMixin {
|
||||
const SwitchBackToMineViaAvatarMenuStandaloneScenario(super.$, super.robots);
|
||||
|
||||
@override
|
||||
Future<void> runTestLogic() async {
|
||||
final switcher = accountSwitcher;
|
||||
const owner = DelegationStandaloneScenarioMixin.ownerAddress;
|
||||
const mine = DelegationStandaloneScenarioMixin.ownAddress;
|
||||
|
||||
await enableDelegationAndReturnToMailbox();
|
||||
|
||||
await switcher.selectByAddress(owner);
|
||||
await switcher.assertion.expectSwitchSettled(owner);
|
||||
|
||||
await switcher.openMenu();
|
||||
await switcher.assertion.expectMenuShowsDelegated(owner);
|
||||
await switcher.selectAddressWhenMenuOpen(mine);
|
||||
await switcher.assertion.expectSwitcherOnMine();
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
import '../../base/base_test_scenario.dart';
|
||||
import '../../mixin/delegation_standalone_scenario_mixin.dart';
|
||||
|
||||
/// Cancel mid-switch → "Couldn't open [Owner]'s mailbox" toast.
|
||||
///
|
||||
/// Server-side failure is hard to force in Patrol web. Cancelling an in-flight
|
||||
/// switch yields [AccountSwitchCancelled], which uses the same toast copy as
|
||||
/// failed / timed-out opens (unit-tested in account_switch_failure_toast_test).
|
||||
///
|
||||
/// Patrol web scripts set `ACCOUNT_SWITCH_LOADING_SHOW_DELAY_MS=0` so the
|
||||
/// dialog appears even when local James finishes the load quickly.
|
||||
class SwitchDelegatedMailboxFailureToastStandaloneScenario
|
||||
extends BaseTestScenario with DelegationStandaloneScenarioMixin {
|
||||
const SwitchDelegatedMailboxFailureToastStandaloneScenario(
|
||||
super.$,
|
||||
super.robots,
|
||||
);
|
||||
|
||||
@override
|
||||
Future<void> runTestLogic() async {
|
||||
final switcher = accountSwitcher;
|
||||
const owner = DelegationStandaloneScenarioMixin.ownerAddress;
|
||||
|
||||
await enableDelegationAndReturnToMailbox();
|
||||
|
||||
await switcher.selectByAddressAwaitingLoading(owner);
|
||||
// cancelInFlightSwitch taps Cancel when painted, else cancels the notifier
|
||||
// while still inside showDelay (zero-delay builds show sync, so Cancel wins).
|
||||
await switcher.cancelInFlightSwitch();
|
||||
await switcher.assertion.expectCouldNotOpenToast(owner);
|
||||
await switcher.assertion.expectSwitcherOnMine();
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
import '../../base/base_test_scenario.dart';
|
||||
import '../../mixin/delegation_standalone_scenario_mixin.dart';
|
||||
|
||||
/// Asserts the switch loading dialog (and Cancel) appear while switching.
|
||||
class SwitchDelegatedMailboxLoadingDialogStandaloneScenario
|
||||
extends BaseTestScenario with DelegationStandaloneScenarioMixin {
|
||||
const SwitchDelegatedMailboxLoadingDialogStandaloneScenario(
|
||||
super.$,
|
||||
super.robots,
|
||||
);
|
||||
|
||||
@override
|
||||
Future<void> runTestLogic() async {
|
||||
final switcher = accountSwitcher;
|
||||
const owner = DelegationStandaloneScenarioMixin.ownerAddress;
|
||||
|
||||
await enableDelegationAndReturnToMailbox();
|
||||
|
||||
await switcher.selectByAddressAwaitingLoading(owner);
|
||||
await switcher.assertion.expectLoadingDialogVisible(owner);
|
||||
// Let the switch finish. Dialog must dismiss once idle.
|
||||
await switcher.assertion.expectSwitchSettled(owner);
|
||||
}
|
||||
}
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/base/model/ui_keys.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/widgets/web/from_composer_drop_down_widget.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart';
|
||||
|
||||
import '../../base/base_test_scenario.dart';
|
||||
import '../../mixin/delegation_standalone_scenario_mixin.dart';
|
||||
import '../../utils/wait_for_condition.dart';
|
||||
|
||||
/// Bob has alice's mailbox delegated (reset-server seed). Stand-alone web only.
|
||||
class SwitchDelegatedMailboxStandaloneScenario extends BaseTestScenario
|
||||
with DelegationStandaloneScenarioMixin {
|
||||
const SwitchDelegatedMailboxStandaloneScenario(super.$, super.robots);
|
||||
|
||||
@override
|
||||
Future<void> runTestLogic() async {
|
||||
final switcher = accountSwitcher;
|
||||
|
||||
await enableDelegationAndReturnToMailbox();
|
||||
|
||||
await switcher.openMenu();
|
||||
await switcher.assertion.expectMenuShowsDelegated(
|
||||
DelegationStandaloneScenarioMixin.ownerAddress,
|
||||
);
|
||||
// Menu is already open. selectByAddress must not re-tap the avatar (the
|
||||
// dismiss barrier makes userAvatar not hit-testable while the menu is up).
|
||||
await switcher.selectAddressWhenMenuOpen(
|
||||
DelegationStandaloneScenarioMixin.ownerAddress,
|
||||
);
|
||||
await switcher.assertion.expectViewing(
|
||||
DelegationStandaloneScenarioMixin.ownerAddress,
|
||||
);
|
||||
await robots.commonRobot().waitForMailboxReady();
|
||||
await _waitForIdentityEmail(
|
||||
DelegationStandaloneScenarioMixin.ownerAddress,
|
||||
);
|
||||
|
||||
await robots.threadRobot().openComposer();
|
||||
await $(const ValueKey('prefix_to_recipient_from_button')).tap();
|
||||
await $(FromComposerDropDownWidget).waitUntilVisible();
|
||||
await waitForCondition(
|
||||
() => $(FromComposerDropDownWidget)
|
||||
.which<FromComposerDropDownWidget>(
|
||||
(widget) =>
|
||||
widget.itemSelected?.email ==
|
||||
DelegationStandaloneScenarioMixin.ownerAddress,
|
||||
)
|
||||
.evaluate()
|
||||
.isNotEmpty,
|
||||
reason:
|
||||
'composer From selection is ${DelegationStandaloneScenarioMixin.ownerAddress}',
|
||||
);
|
||||
await $(const ValueKey(UiKeys.closeComposerButton)).tap();
|
||||
await $.pumpAndTrySettle();
|
||||
|
||||
await switcher.dismissViewingBanner();
|
||||
await switcher.assertion.expectSwitcherOnMine();
|
||||
}
|
||||
|
||||
Future<void> _waitForIdentityEmail(String email) async {
|
||||
await waitForCondition(
|
||||
() {
|
||||
final dashboard = Get.find<MailboxDashBoardController>();
|
||||
return dashboard.listIdentities
|
||||
.any((identity) => identity.email == email);
|
||||
},
|
||||
reason: 'dashboard identities include $email',
|
||||
);
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import '../../base/test_base.dart';
|
||||
import '../../models/test_tags.dart';
|
||||
import '../../scenarios/delegation/switch_back_to_mine_via_avatar_menu_standalone_scenario.dart';
|
||||
|
||||
void main() {
|
||||
TestBase().runPatrolTest(
|
||||
description:
|
||||
'Should switch back to mine from the avatar menu while Viewing a delegated mailbox',
|
||||
scenarioBuilder: ($, robots) =>
|
||||
SwitchBackToMineViaAvatarMenuStandaloneScenario($, robots),
|
||||
tags: [TestTags.web],
|
||||
);
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import '../../base/test_base.dart';
|
||||
import '../../models/test_tags.dart';
|
||||
import '../../scenarios/delegation/switch_delegated_mailbox_failure_toast_standalone_scenario.dart';
|
||||
|
||||
void main() {
|
||||
TestBase().runPatrolTest(
|
||||
description:
|
||||
"Should toast Couldn't open owner's mailbox when the switch is cancelled",
|
||||
scenarioBuilder: ($, robots) =>
|
||||
SwitchDelegatedMailboxFailureToastStandaloneScenario($, robots),
|
||||
tags: [TestTags.web],
|
||||
);
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import '../../base/test_base.dart';
|
||||
import '../../models/test_tags.dart';
|
||||
import '../../scenarios/delegation/switch_delegated_mailbox_loading_dialog_standalone_scenario.dart';
|
||||
|
||||
void main() {
|
||||
TestBase().runPatrolTest(
|
||||
description:
|
||||
'Should show the account-switch loading dialog while opening a delegated mailbox',
|
||||
scenarioBuilder: ($, robots) =>
|
||||
SwitchDelegatedMailboxLoadingDialogStandaloneScenario($, robots),
|
||||
tags: [TestTags.web],
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import '../../base/test_base.dart';
|
||||
import '../../models/test_tags.dart';
|
||||
import '../../scenarios/delegation/switch_delegated_mailbox_standalone_scenario.dart';
|
||||
|
||||
void main() {
|
||||
TestBase().runPatrolTest(
|
||||
description:
|
||||
'Should switch to a delegated mailbox from the stand-alone avatar menu',
|
||||
scenarioBuilder: ($, robots) =>
|
||||
SwitchDelegatedMailboxStandaloneScenario($, robots),
|
||||
tags: [TestTags.web],
|
||||
);
|
||||
}
|
||||
@@ -159,7 +159,8 @@ patrol test -v \
|
||||
--dart-define=ADDITIONAL_MAIL_RECIPIENT="$ALICE@$DOMAIN" \
|
||||
--dart-define=BASIC_AUTH_EMAIL="$BOB@$DOMAIN" \
|
||||
--dart-define=BASIC_AUTH_URL="$BASIC_AUTH_URL" \
|
||||
--dart-define=RESET_SERVER_URL="http://localhost:$RESET_PORT" 2>&1 \
|
||||
--dart-define=RESET_SERVER_URL="http://localhost:$RESET_PORT" \
|
||||
--dart-define=ACCOUNT_SWITCH_LOADING_SHOW_DELAY_MS=0 2>&1 \
|
||||
| perl -MPOSIX -ne 'BEGIN { open(LOG, ">", shift) or die "$!\n"; select((select(LOG), $| = 1)[0]); $| = 1 } print LOG strftime("%T ", localtime), $_; print' "$PATROL_LOG" \
|
||||
| perl scripts/ci-console-filter.pl "ci-logs/patrol-console.log.gz"
|
||||
TEST_EXIT_CODE=${PIPESTATUS[0]}
|
||||
|
||||
@@ -67,4 +67,5 @@ patrol test -v \
|
||||
--dart-define=ADDITIONAL_MAIL_RECIPIENT="$ALICE@$DOMAIN" \
|
||||
--dart-define=BASIC_AUTH_EMAIL="$BOB@$DOMAIN" \
|
||||
--dart-define=BASIC_AUTH_URL="$BASIC_AUTH_URL" \
|
||||
--dart-define=RESET_SERVER_URL="http://localhost:$RESET_PORT"
|
||||
--dart-define=RESET_SERVER_URL="http://localhost:$RESET_PORT" \
|
||||
--dart-define=ACCOUNT_SWITCH_LOADING_SHOW_DELAY_MS=0
|
||||
Reference in new issue
Block a user