Files
tatuchat/integration_test/flows/chat_flows.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

43 lines
1.4 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:tatchat/pages/chat_list/chat_list.dart';
import 'package:tatchat/widgets/chat_settings_popup_menu.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:material_ui/material_ui.dart';
import '../utils/tatu_chat_tester.dart';
import 'auth_flows.dart';
Future<void> archiveChats(WidgetTester widgetTester) =>
widgetTester.startTatuChatTest().then((tester) => tester._archiveChats());
extension ChatFlows on TatuChatTester {
static const String groupChatName = 'Test Group 01';
Future<void> ensureGroupChatCreated() async {
if (await isVisible(groupChatName)) return;
await tapOn(FloatingActionButton);
await tapOn('Create group');
await enterText(TextField, groupChatName);
await scrollUntilVisible('Create a group and invite users');
await tapOn('Create a group and invite users');
await waitFor('Invite contact');
await goBack();
await goBack();
}
Future<void> _archiveChats() async {
await ensureLoggedIn();
await ensureGroupChatCreated();
await tapOn(groupChatName);
await tapOn(ChatSettingsPopupMenu);
await tapOn('Leave');
await waitFor('Are you sure?');
await tapOn('Leave');
await waitFor(ChatList);
}
}