Mobile App testing with Appium with WebdriverIO with Flutter - flutter

My company is creating a new mobile app and it seems that part of the tech stack will involve the use of flutter.
I want to use appium with webdriverIO because it a great tool to run my automated tests.
Is this possible with flutter?
Has anyone used flutter before and what were your opinions?

So I tried using appium and various other testing platforms like Selenium or Cypress. None of them helped me with the Automation Tests.
Though, Recently came across a github project, flutter_convenient_test, I not only helped be automate the tests but also helped me with the Assertions.
Here's a way of doing it perfectly.
await t.get(find.byTooltip('Home Page')).tap();
So here, so may need to add tooltip to each widget(also custom widgets you use), and then run this on the above platform.
OR you can use the Text widget if you have a Text heavy app.
await t.get(find.text('Add Account')).should(findsOneWidget);

Related

Is there a testing Framework for web-deployed Flutter applications?

I am wanting to automate and write tests for my Flutter deployed application.
I am able to test the client side of Flutter apps on mobile using Appium & Codecept.js with no issues. (Built a testing project in VScode and used the built APK)
I have tried Playwright, Puppeteer, WebDriver, and Selenium with no luck on the deployed code for web. Piercing through <flt-glass-pane/> is possible but super messy and doesnt seem like a stable way to go about it. I am hoping to achieve this in my separate codebase that is responsible for UI testing.
I am wondering if anyone had some solid suggestions on automating a Flutter web app from the client side (UI, and clicks etc).
From the research I have done, I have not found a clear solution. I am very interested in what you have used before that works or if you know the right direction I should head toward.

Are there unit tests in flutter?

Can we able to write the automation test cases by using flutter for web application
I need answer for we can able to write the automation test cases by using flutter for web application
Yes.
docs.flutter.dev/cookbook/testing/unit/introduction goes over how Flutter does testing. That same link goes over some good CI tools to automate all of it.

FLUTTER WEB: How can we have a single codebase for the Flutter app & Web?

We have a single codebase for Android & iOS in Flutter.
We tried to use the same codebase for Web in Flutter too, but it hadn't gone well.
As of some libraries/plugins, currently unsupported by Flutter SDK.
To mitigate these issues, we are maintaining two separate repositories, one for Android-iOS and other for Web.
Also, to add up here, for separate repositories because each Flutter product has a unique pubspec.yaml file. Now there are a few plugins that are currently supported in App but Not yet on Flutter Web, namely Awesome Notifications, Clevertap plugin, etc.
Integrating those plugins on the web, stops the web to run. So keeping the same codebase for both is getting technically complicated as the app has many many functions.
It takes so much time in simultaneously testing, debugging and resolving issues in Web.
So, how we can maintain same code for all platforms i.e., Android, iOS & Web, without doing it in other repository for Web and gaining advantage in streamlining our codebase into one for all platforms?
For Ex. If I commented the package awesome_notifications for Web in pubspec file, the issue arises (as shown in the screenshot) in code wherever we used its functionalities.
For successfully working on both Mobile & Web, are there any methods available we can use packages for both (Mobile & Web)?
Ideally you’d want to use a single codebase to host both the web and mobile versions, to minimise code maintenance and improve efficiency. To do this, you’ll need to be able to find the platform the code is running on, so that code can be called programmatically.
You can use the constant kIsWeb to check if the application is compiled for the web, and you can then use that condition to only run platform-specific code (such as the awesome_notifications package) if you’re on a platform that supports it. That way you’ll still be able to import the required packages, but only call them when the app is running on the mobile version of your app.
That should allow you to condense your codebase into one repository without sacrificing any functionality that may not work across all platforms.

Do iOS and Android Flutter widgets also work on Flutter Web(PWA)

I'm interested in using Flutter primarily for my startup MVP on Web and possibly Android. I see the flutter community has made a lot of widgets but a lot of them are tagged iOS or Android. Since Futter is all about using one codebase is it wrong to assume that these widgets would work on web too? I imagine the setup would be different but similar with a Flutter web app as opposed to a Flutter Android app.
I couldn't find a whole lot about this on the Flutter site. I also know that web is still beta but by the time I'm done with the MVP it'll probably be at stable release or close enough.
Well... It depends. If the widget has some sort of native code the answer is no. In Flutter there are two type of packages: the "normal" package, and the plugin.
The packages are made only of dart code, so there are no bounds to native, and you can use everywhere dart (and Flutter) can run.
The plugins are packages with native code and you can use only on the platform supported by that plugin.
For example the package provider, it's a package, and you can use in every supported platform where dart (and Flutter) can run. But url_launcher, it's a plugin, so you can run only on Android, iOS, and web, but for example on desktop, it will no work.
If the package if you found it's only a widget, you should be able to use on the web.
TLDR: No,a PWA it's a web app, so it can't run Android or iOS specific code.

How to pitch test automation technology for Flutter app

Our team is building a new store management app using Flutter.
In order to make our CI process better, I want to start building automated tests for it.
I want to make sure that our core features like adding products, purchasing goods, calculating reports and others work.
I was told that I can do such tests only in Dart. However, I haven't ever worked with it (I've originally built tests in Python) and curious if there any other ways to build test automation for Flutter apps except Dart.
Please advise if you have ideas about it!
Thanks!
I'd recommend using appium for Flutter App !
Look for appium-flutter-driver and appium-uiautomator2-driver and how you can integrate them in your automation project !