widget_test.dart 1.1 KB

12345678910111213141516171819202122232425262728
  1. // This is a basic Flutter widget test.
  2. //
  3. // To perform an interaction with a widget in your test, use the WidgetTester
  4. // utility in the flutter_test package. For example, you can send tap and scroll
  5. // gestures. You can also use WidgetTester to find child widgets in the widget
  6. // tree, read text, and verify that the values of widget properties are correct.
  7. import 'package:flutter/material.dart';
  8. import 'package:flutter_test/flutter_test.dart';
  9. import 'package:flutter_riverpod/flutter_riverpod.dart';
  10. import 'package:sino_med_cloud/app/app.dart';
  11. void main() {
  12. testWidgets('App launches successfully', (WidgetTester tester) async {
  13. // Build our app and trigger a frame.
  14. await tester.pumpWidget(const ProviderScope(child: SinoMedApp()));
  15. await tester.pumpAndSettle();
  16. // Verify that the login page is displayed with app name and subtitle.
  17. expect(find.text('SinoMed Cloud'), findsOneWidget);
  18. expect(find.text('中方诊药云'), findsOneWidget);
  19. // Verify that login tabs are displayed.
  20. expect(find.text('密码登录'), findsOneWidget);
  21. expect(find.text('验证码登录'), findsOneWidget);
  22. });
  23. }