Files
tatuchat/integration_test/flows/multi_account.dart
Welton Moura 0037b0b9cf
Some checks failed
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled
Initial commit
2026-09-11 15:59:56 -03:00

38 lines
1.2 KiB
Dart

// SPDX-FileCopyrightText: 2019-Present Christian Kußowski
// SPDX-FileCopyrightText: 2019-Present Contributors to FluffyChat
//
// SPDX-License-Identifier: AGPL-3.0-or-later
import 'package:flutter_test/flutter_test.dart';
import 'package:material_ui/material_ui.dart';
import '../data/environment_constants.dart';
import '../utils/tatu_chat_tester.dart';
import 'auth_flows.dart';
Future<void> multiAccount(WidgetTester widgetTester) => widgetTester
.startTatuChatTest()
.then((tester) => tester._multiAccountAndNotifications());
extension on TatuChatTester {
Future<void> _multiAccountAndNotifications() async {
await ensureLoggedIn();
// Login user 2
await tapOn(Key('accounts_and_settings_buttons'));
await tapOn('Add account');
await login(username: user2Name, password: user2Pw);
await initCryptoIdentity(username: user2Name);
// Logout user 2
await tapOn(Key('accounts_and_settings_buttons'));
await tapOn(user2Name);
await tapOn(Key('accounts_and_settings_buttons'));
await tapOn('Settings');
await scrollUntilVisible('Logout');
await tapOn('Logout');
await tapOn(Key('ok_cancel_alert_dialog_ok_button'));
await waitFor('One of your clients has been logged out');
}
}