You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flutter Web, there is no explanation for testing, README.md #7779
I can see that they use the flutter_web_test package in the flutter_web package, however when I try to use the same package in my tests, it fails from the start when using the command 'flutter test' because it complains about the missing the flutter_test (not web) dependency.
How can the tests in the flutter_web package be run?
And if I'm using the flutter_web_test package on my own project, what would be the steps to take?
All these strange paths to use stuff should be clear in the documentation of the project. It would be great if they can add a Readme of some sort to explain how to do things.
Imagine you are someone that wants to try or modify stuff on the library, how you would be able to deduce that?
All steps should be crystal clear on the documentation to be "welcoming" to newcomers.
I believe the tests in the flutter web repo can be run with flutter pub run test -p chrome
This command work only for import 'package:test/test.dart'; but not with this package import 'package:flutter_web_test/flutter_web_test.dart'; this generate this error :
>flutter pub run test -p chrome
00:00 +0: compiling test\core\base_core_test.dart
../../../../../../../flutter/.pub-cache/git/flutter_web-1b9477bd041f3667445c1cb0a202972fe234ba86/packages/flutter_web_test/lib/src/window.dart:288:3:
Error: Type 'TimingsCallback' not found.
TimingsCallback onReportTimings;
^^^^^^^^^^^^^^^
../../../../../../../flutter/.pub-cache/git/flutter_web-1b9477bd041f3667445c1cb0a202972fe234ba86/packages/flutter_web_test/lib/src/window.dart:288:3:
Error: 'TimingsCallback' isn't a type.
TimingsCallback onReportTimings;
^^^^^^^^^^^^^^^
Error: Compilation failed.
00:00 +0 -1: compiling test\core\base_core_test.dart [E]
Failed to load "test\core\base_core_test.dart": dart2js failed.
00:00 +0 -1: Some tests failed.
Activity
jonahwilliams commentedon Jul 12, 2019
I believe the tests in the flutter web repo can be run with
flutter pub run test -p chromeicatalud commentedon Jul 12, 2019
And if I'm using the flutter_web_test package on my own project, what would be the steps to take?
All these strange paths to use stuff should be clear in the documentation of the project. It would be great if they can add a Readme of some sort to explain how to do things.
Imagine you are someone that wants to try or modify stuff on the library, how you would be able to deduce that?
All steps should be crystal clear on the documentation to be "welcoming" to newcomers.
sandros06 commentedon Jul 26, 2019
This command work only for
import 'package:test/test.dart';but not with this packageimport 'package:flutter_web_test/flutter_web_test.dart';this generate this error :yjbanov commentedon Sep 13, 2019
Flutter for web app are tested the same way as explained in flutter.dev/testing. What's missing today is FlutterDriver support.
However, in addition to the regular mock environment, you can run tests in actual Chrome like this:
Perhaps we should update https://flutter.dev/docs/cookbook/testing/unit/introduction to mention that?
/cc @sfshaza2
PavelPZ commentedon Nov 21, 2019
Was anybody successfull with testing flutter web project from command line?
None of these possibilities work for me (on newest flutter dev channel, 1.12.6):
flutter pub run test -p chromeflutter test --platform chromeflutter pub run build_runner test -- -p "chrome"See flutter/flutter#44583.
PavelPZ commentedon Nov 21, 2019
Looks like
flutter pub run test -p chromeis dead, see official @jonahwilliams statement.jonahwilliams commentedon Nov 22, 2019
This was only ever for the forked flutter_web repo
PavelPZ commentedon Nov 22, 2019
Okay, but the flutter_web repo fork is also dead (the flutter for the web is now part of the flutter SDK repo, I hope).
atsansone commentedon Jun 3, 2023
Flutter web testing is explained on the integration testing page. Closing this issue.