-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TF-2528 Add integration test for search email with sort by sender nam…
……e ascending
- Loading branch information
Showing
27 changed files
with
591 additions
and
59 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
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
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,21 @@ | ||
|
||
extension ListDateTimeExtension on List<DateTime> { | ||
|
||
bool isSortedByMostRecent() { | ||
for (int i = 0; i < length - 1; i++) { | ||
if (this[i].isBefore(this[i + 1])) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
|
||
bool isSortedByOldestFirst() { | ||
for (int i = 0; i < length - 1; i++) { | ||
if (this[i].isAfter(this[i + 1])) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
} |
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
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
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 |
---|---|---|
@@ -1,15 +1,9 @@ | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:patrol/patrol.dart'; | ||
|
||
abstract class CoreRobot { | ||
final PatrolIntegrationTester $; | ||
|
||
CoreRobot(this.$); | ||
|
||
Future<void> ensureViewVisible(PatrolFinder patrolFinder) async { | ||
await $.waitUntilVisible(patrolFinder); | ||
expect(patrolFinder, findsWidgets); | ||
} | ||
|
||
dynamic ignoreException() => $.tester.takeException(); | ||
} |
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
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
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,30 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_test/flutter_test.dart'; | ||
|
||
import '../base/core_robot.dart'; | ||
|
||
class SearchRobot extends CoreRobot { | ||
SearchRobot(super.$); | ||
|
||
Future<void> enterQueryString(String queryString) async { | ||
await $(#search_email_text_field).enterText(queryString); | ||
} | ||
|
||
Future<void> scrollToEndListSearchFilter() async { | ||
await $.scrollUntilVisible( | ||
finder: $(#mobile_sortBy_search_filter_button), | ||
view: $(#search_filter_list_view), | ||
scrollDirection: AxisDirection.right, | ||
delta: 300, | ||
); | ||
} | ||
|
||
Future<void> openSortOrderBottomDialog() async { | ||
await $(#mobile_sortBy_search_filter_button).tap(); | ||
} | ||
|
||
Future<void> selectSortOrder(String sortOrderName) async { | ||
await $(find.text(sortOrderName)).tap(); | ||
await $.pump(const Duration(seconds: 2)); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,18 +1,17 @@ | ||
import 'package:core/presentation/views/search/search_bar_view.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:tmail_ui_user/features/base/widget/compose_floating_button.dart'; | ||
import 'package:tmail_ui_user/features/composer/presentation/composer_view.dart'; | ||
import 'package:tmail_ui_user/features/thread/presentation/thread_view.dart'; | ||
|
||
import '../base/core_robot.dart'; | ||
|
||
class ThreadRobot extends CoreRobot { | ||
ThreadRobot(super.$); | ||
|
||
Future<void> expectThreadViewVisible() => ensureViewVisible($(ThreadView)); | ||
|
||
Future<void> openComposer() async { | ||
await $(ComposeFloatingButton).$(InkWell).tap(); | ||
} | ||
|
||
Future<void> expectComposerViewVisible() => ensureViewVisible($(ComposerView)); | ||
Future<void> openSearchView() async { | ||
await $(SearchBarView).$(InkWell).tap(); | ||
} | ||
} |
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
Oops, something went wrong.