TF-3691 Add integration test for case search snippets with html escape
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import '../../base/base_test_scenario.dart';
|
||||
import '../../models/provisioning_email.dart';
|
||||
import '../../robots/search_robot.dart';
|
||||
import '../../robots/thread_robot.dart';
|
||||
|
||||
class SearchSnippetsWithHtmlEscapeScenario extends BaseTestScenario {
|
||||
SearchSnippetsWithHtmlEscapeScenario(super.$);
|
||||
|
||||
@override
|
||||
Future<void> runTestLogic() async {
|
||||
const email = String.fromEnvironment('BASIC_AUTH_EMAIL');
|
||||
const subject = '<Search snippets html escape>';
|
||||
|
||||
final threadRobot = ThreadRobot($);
|
||||
final searchRobot = SearchRobot($);
|
||||
|
||||
await provisionEmail(
|
||||
[ProvisioningEmail(toEmail: email, subject: subject, content: subject)],
|
||||
requestReadReceipt: false,
|
||||
);
|
||||
await $.pumpAndSettle();
|
||||
|
||||
await threadRobot.tapOnSearchField();
|
||||
await searchRobot.enterKeyword(subject);
|
||||
await searchRobot.tapOnShowAllResultsText();
|
||||
await $.pumpAndSettle();
|
||||
|
||||
await _expectEmailWithSubjectUnescapedVisible(subject);
|
||||
}
|
||||
|
||||
Future<void> _expectEmailWithSubjectUnescapedVisible(String subject) async {
|
||||
await expectViewVisible($(find.text(subject)));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import '../../base/test_base.dart';
|
||||
import '../../scenarios/search/search_snippets_with_html_escape_scenario.dart';
|
||||
|
||||
void main() {
|
||||
TestBase().runPatrolTest(
|
||||
description: 'Should see email with subject escaped when search email successfully',
|
||||
scenarioBuilder: ($) => SearchSnippetsWithHtmlEscapeScenario($),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user