language_test.dart 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import 'package:appflowy/workspace/presentation/settings/widgets/settings_language_view.dart';
  2. import 'package:flutter_test/flutter_test.dart';
  3. import 'package:integration_test/integration_test.dart';
  4. import 'util/util.dart';
  5. void main() {
  6. IntegrationTestWidgetsFlutterBinding.ensureInitialized();
  7. group('document', () {
  8. testWidgets(
  9. 'change the language successfully when launching the app for the first time',
  10. (tester) async {
  11. await tester.initializeAppFlowy();
  12. await tester.tapLanguageSelectorOnWelcomePage();
  13. expect(find.byType(LanguageItemsListView), findsOneWidget);
  14. await tester.tapLanguageItem(languageCode: 'zh', countryCode: 'CN');
  15. tester.expectToSeeText('开始');
  16. await tester.tapLanguageItem(languageCode: 'en', scrollDelta: -100);
  17. tester.expectToSeeText('Quick Start');
  18. await tester.tapLanguageItem(languageCode: 'it', countryCode: 'IT');
  19. tester.expectToSeeText('Andiamo');
  20. });
  21. /// Make sure this test is executed after the test above.
  22. testWidgets('check the language after relaunching the app', (tester) async {
  23. await tester.initializeAppFlowy();
  24. tester.expectToSeeText('Andiamo');
  25. });
  26. });
  27. }