Skip to content

Conversation

@thuyenh1081
Copy link
Collaborator

Ticket

this ticket include code for "Search for messages inside a chat"

Resolved

Attach screenshots or videos demonstrating the changes

Screen.Recording.2025-11-03.at.15.11.34.mov

return getTextField().$(IconButton);
}

Future<List<TwakeListItemRobot>> getListOfChatSeach() async {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Future<List<TwakeListItemRobot>> getListOfChatSeach() async {
Future<List<TwakeListItemRobot>> getListOfChatSearch() async {

Typo?

test: ($) async {
//open chat and make some messages
final receiveMessage = (await prepareTwoMessages($)).$2;
final searchPharse = receiveMessage.substring(receiveMessage.indexOf("sent"), receiveMessage.length);
Copy link
Member

Choose a reason for hiding this comment

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

Pharse ? Is it english?

await ChatGroupDetailRobot($).getSearchIcon().tap();
await $.waitUntilVisible($(AppBar).$(TextField));
await $(AppBar).$(TextField).enterText(searchText);
// await SearchRobot($).enterSearchText(searchText);
Copy link
Member

Choose a reason for hiding this comment

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

Why keep this commente code?

// await SearchRobot($).enterSearchText(searchText);
await ChatGroupDetailRobot($).waitForEitherVisible($: $, first: $(TwakeListItem), second: $("No Results"), timeout: const Duration(seconds: 10));
await Future.delayed(const Duration(seconds: 2));
}
Copy link
Member

Choose a reason for hiding this comment

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

Can we at least have another search with at least one result, please?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I’m not clear about your idea.
In this method, the result can contain one, more, or even zero items.
The code: await ChatGroupDetailRobot($).waitForEitherVisible($: $, first: $(TwakeListItem), second: $("No Results"), timeout: const Duration(seconds: 10));
means that before performing the next action after entering a search, we will wait until we either see the label “No Results” or at least one item displayed.

Copy link
Member

Choose a reason for hiding this comment

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

Is this a step with search input bar, you wait until no result show, then you will make a search? Am I right? If I am right, the method name so confused

Copy link
Collaborator

@tddang-linagora tddang-linagora left a comment

Choose a reason for hiding this comment

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

Please run this command before you commit your changes in integration_test directory:

dart format integration_test

},
);

TestBase().runPatrolTest(
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I want to run this test only, how can I do that?

@tddang-linagora
Copy link
Collaborator

When run multiple tests, the app isn't logged out between each test, so running the same set-up for every test, where there's login step, doesn't make sense, which also makes the following tests after the first test fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants