-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathlanguage_test.dart
39 lines (31 loc) · 1.28 KB
/
language_test.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import 'package:flutter/material.dart';
import 'package:flutter_template/presentation/intl/translations/translation_keys.dart';
import 'package:flutter_template/presentation/intl/translations/translation_loader.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:patrol/patrol.dart';
import 'app_setup.dart';
import 'test_actions.dart';
void main() {
patrolTest(
"users are able to change the language of the app",
(patrol) async {
await setupApp(patrol);
expect(find.text(CodegenLoader.en_US[LocaleKeys.homePageTitle]),
findsOneWidget);
await navigateToSearch(patrol);
expect(find.text(CodegenLoader.en_US[LocaleKeys.searchPageTitle]),
findsOneWidget);
expect(find.text(CodegenLoader.en_US[LocaleKeys.searchResultsAppearHere]),
findsOneWidget);
await patrol.tap(find.byIcon(Icons.arrow_back));
await patrol.tap(find.byIcon(Icons.language));
expect(find.text(CodegenLoader.hi_IN[LocaleKeys.homePageTitle]),
findsOneWidget);
await navigateToSearch(patrol);
expect(find.text(CodegenLoader.hi_IN[LocaleKeys.searchPageTitle]),
findsOneWidget);
expect(find.text(CodegenLoader.hi_IN[LocaleKeys.searchResultsAppearHere]),
findsOneWidget);
},
);
}