Skip to content

TF-3631 E2E log out #3634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: patrol-integration-test
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions integration_test/robots/mailbox_menu_robot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,17 @@ class MailboxMenuRobot extends CoreRobot {
})
.tap();
}

Future<void> tapManageAccount() async {
await $(AppLocalizations().manage_account).tap();
}

Future<void> tapSignOut() async {
await $.scrollUntilVisible(finder: $(AppLocalizations().sign_out));
await $(AppLocalizations().sign_out).tap();
}

Future<void> confirmSignOut() async {
await $(AppLocalizations().yesLogout).tap();
}
}
26 changes: 26 additions & 0 deletions integration_test/scenarios/misc/log_out_scenario.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import 'package:tmail_ui_user/features/starting_page/presentation/twake_welcome/twake_welcome_view.dart';

import '../../base/base_test_scenario.dart';
import '../../robots/mailbox_menu_robot.dart';
import '../../robots/thread_robot.dart';

class LogOutScenario extends BaseTestScenario {
const LogOutScenario(super.$);

@override
Future<void> runTestLogic() async {
final threadRobot = ThreadRobot($);
final mailboxMenuRobot = MailboxMenuRobot($);

await threadRobot.openMailbox();
await mailboxMenuRobot.tapManageAccount();
await mailboxMenuRobot.tapSignOut();
await mailboxMenuRobot.confirmSignOut();

await _expectTwakeWelcomeViewVisible();
}

Future<void> _expectTwakeWelcomeViewVisible() async {
await expectViewVisible($(TwakeWelcomeView));
}
}
9 changes: 9 additions & 0 deletions integration_test/tests/misc/log_out_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import '../../base/test_base.dart';
import '../../scenarios/misc/log_out_scenario.dart';

void main() {
TestBase().runPatrolTest(
description: 'Should see Twake welcome screen when log out successfully',
scenarioBuilder: ($) => LogOutScenario($),
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'dart:convert';
import 'package:core/presentation/extensions/color_extension.dart';
import 'package:core/utils/app_logger.dart';
import 'package:core/utils/html/html_utils.dart';
import 'package:core/utils/platform_info.dart';
import 'package:custom_pop_up_menu/custom_pop_up_menu.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -309,7 +310,9 @@ class RichTextWebController extends BaseRichTextController {
void onClose() {
menuParagraphController.dispose();
menuOrderListController.dispose();
editorController.clear();
if (PlatformInfo.isWeb || editorController.editorController != null) {
editorController.clear();
}
super.onClose();
}
}
Loading