-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TW-2206 added patrol test for sending text message
- Loading branch information
1 parent
febdb8c
commit 5d7c9fc
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
24
integration_test/scenarios/send_text_message_scenario.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}, | ||
); | ||
} |