Open d-apps opened 3 years ago
Hi @jonataslaw, I'm having this problem when I run functional test on a Gitlab pipeline. The thing is that locally on my computer all test passed successfully but in the Gitlab CI/CD i get this error:
Running "flutter pub get" in xxxxxx-mobile... 4.9s
00:21 +13 -1: /builds/aaaaa-eeeeeeeeeee/xxxxxx/xxxxxx-mobile/test/functional/home_page_test.dart: Test Home Page is the first shown widget, and correctly navigates to CollectionFilterPage when pressing the YYY Collection button [E]
ProcessException: Failed to find "xdg-user-dir" in the search path.
Command: xdg-user-dir
package:get_storage/src/storage_impl.dart 47:7 GetStorage._init
in my test i have this code:
void main() async {
TestWidgetsFlutterBinding.ensureInitialized();
late GetStorage g;
const channel = MethodChannel('plugins.flutter.io/path_provider');
void setUpMockChannels(MethodChannel channel) {
channel.setMockMethodCallHandler((MethodCall methodCall) async {
if (methodCall.method == 'getApplicationDocumentsDirectory') {
return '.';
}
});
}
setUpAll(() async {
setUpMockChannels(channel);
});
setUp(() async {
await GetStorage.init();
g = GetStorage();
await g.erase();
});
// The test goes here...
But this doesn't work.
Yeah, but you need mock the storage driver
@jonataslaw Do you have an example? @d-apps How did you solve this issue?
@jonataslaw is there any example yet? @d-apps have you find solution?
I left same comment : https://github.com/jonataslaw/get_storage/issues/109#issuecomment-1397892672
Yeah, but you need mock the storage driver