Skip to content
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

TW-2206 added patrol tests for sending message #2210

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions integration_test/robots/send_text_message_robot.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import '../base/core_robot.dart';

class SendTextMessageRobot extends CoreRobot {
SendTextMessageRobot(super.$);
}
24 changes: 24 additions & 0 deletions integration_test/scenarios/send_text_message_scenario.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import 'package:fluffychat/pages/chat/chat_input_row_send_btn.dart';
import 'package:fluffychat/pages/chat/chat_view.dart';
import 'package:fluffychat/pages/chat/input_bar/input_bar.dart';
import 'package:fluffychat/pages/chat_list/chat_list_item.dart';
import 'package:flutter_test/flutter_test.dart';
import '../base/base_scenario.dart';
import 'login_scenario.dart';

class SendTextMessageScenario extends BaseScenario {
LoginScenario loginScenario;
SendTextMessageScenario(
super.$, {
required this.loginScenario,
});

@override
Future<void> execute() async {
await loginScenario.execute();
await $.tap($(ChatListItem));
await $.waitUntilVisible($(ChatView));
await $.enterText($(InputBar), "test message");
await $.tap($(ChatInputRowSendBtn));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should have a way to verify it work? For example:

  • verify sending status
  • verify sent status

}
}
24 changes: 24 additions & 0 deletions integration_test/tests/chat/send_text_message_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import 'package:patrol/patrol.dart';

import '../../base/test_base.dart';
import '../../scenarios/login_scenario.dart';
import '../../scenarios/send_text_message_scenario.dart';

void main() {
TestBase().runPatrolTest(
description: 'Should see Message bubble after sending text message',
test: ($) async {
final loginScenario = LoginScenario(
$,
username: const String.fromEnvironment('USERNAME'),
serverUrl: const String.fromEnvironment('SERVER_URL'),
password: const String.fromEnvironment('PASSWORD'),
);
final sendTextMessageScenario = SendTextMessageScenario(
$,
loginScenario: loginScenario,
);
await sendTextMessageScenario.execute();
},
);
}
Loading