How do you setup automated-tests for Capacitor native apps? - ionic-framework

Capacitor allows us to code once then generate web, Android and iOS applications. Most people using Capacitor will generate native Android and iOS applications.
But strange enough, I can't find any documentation about how to create automated-tests for the two native applications. I can easily test the web application using protractor, jasmine or whatever. But when it comes to native apps, I can't hardly rely on native tooling (Android Studio and XCode) as there are other issues preventing me from testing it easily (ex: no possibility to set Accessibility ID through the views markup, etc).
Where are we at with Capacitor native apps automated-tests ?

I believe this is what you are looking for Ionic/capacitor Integrations for Testing
As far as the community/forums and official docs go there are only 3 ways you can test your apks
Native [Andriod Studio / Xcode] [Emulated versions]
Real Devices
3rd party Integration listed in the link above..
Even on google there very less info on this topic.. most of the blogs/ articles only say that Ionic/Capacitors can be tested just like a normal WEB App

Related

Third-party apps allowed in Android Automotive

The official documentation describes two kind of applications that can be implemented for Android Automotive, Media applications and Messaging applications. Also when creating a new project in Android Studio, the IDE prompts to select a template from those options.
My question is specific to third-party apps. Is Android Automotive limited to build one of these flavors? That is, interact with the user only through the native media UI of the vehicle or the messaging/notifications mechanism. Or as a third-party application developer I can build any other kind of applications (like generic phone/tablet android apps) with custom activities/screens? In case that any kind of applications are allowed, are they limited to run when the vehicle is parked?
Android Automotive is Android so you could build whatever android app you like and run it on Automotive. The catch is that Google is, as per now, only allowing Media/Messaging apps into Play Store and has quite specific design guidelines that developers need to follow.
When your app follows Googles Driver Distraction Guidelines then it can run when a vehicle is moving.

Does Ionic compile the Code to Native?

I've searched some times here but could't find an Answer to this.
Does someone know this and can explain how Ionic handles it?
Does Ionic compile the Code to Native? NO
Ionic is for developing Hybrid apps.
What are Hybrid apps?
Hybrid apps are essentially websites embedded in a mobile app through
what we call a webview. They are developed using HTML5, CSS, and
Javascript, and execute the same code regardless of the platform in
which they run. They can, with tools like PhoneGap and Cordova, use
the native features of a device, like GPS or camera.
What are Native apps?
Native apps are developed in the language required by the platform it
targets, Objective-C or Swift for iOS, Java for Android, etc. The code
written is not shared across platforms and their behavior varies. They
have direct access to all features offered by the platform without any
restriction.
Here is a nice article about it.
Cordova converts the project into a native which has only ONE Page, that is a WebView (WKV WEB View in iOS, etc). And all of the ionic code is run on that webview. Basically an ionic/cordova app is a website which looks like an app!

Building app, mobile web app and desktop web app using Ionic

We will develop an app that we would like to distribute in through the following channels:
Android and iOS apps through Google Play and iTunes (the app will
use notifications extensively and presence in Google Play and App store is required)
Web app to run in web browsers on mobile devices
Web app to run in web browsers on laptop and desktop computers. We would like to support Chrome, Internet Explorer (starting from IE9),
Firefox and Safari browsers.
Our understanding is that Ionic is developed targeting primarily 1. and that the web apps in 2. and 3. above are not really what Ionic is intended for. We have looked around to try to understand if Ionic likely works for 2. and 3. and also made some quick tests ourselves.
From one of the links at the end: "Your webapp will run in desktop browsers yes, as it is made of html, css and javascript. The phonegap specific javascript calls (accelerometer, compass, file, etc) won't. Basically, if you stick to standard yes you will be able to port relatively easily your app to most browser, the job at this point being mostly a work of theming."
From another one: "I do know that FireFox is simply not supported. I don't know how well Ionic works in IE X."
To try it out we have built a limited version of our app in Ionic. From what we can see the app works for 1, 2 and 3. For example, it runs without issues on FireFox that is mentioned as not supported in the quote above. This means that to us it looks like the first quote saying that the web app will work in desktop browsers is correct.
I understand that this is a fairly generic question and might be hard to answer, but since we have found contradicting information when looking we are trying to understand more before making a decision.
Any feedback would be appreciated.
Thanks,
Markus
Is it a good idea to use ionic to build mobile web version of a website?
Can Ionic Framework run in desktop web browser like Chrome, Mozilla, IE9+?
http://forum.ionicframework.com/t/ionic-components-on-ie/1826
Phonegap web app in regular desktop browsers
http://ionicframework.com/docs/overview/#css-sass
Ionic is tested for mobile only. Internet Explorer for example is not tested and does not properly handle a number of features in Ionic. Desktop browsers act differently than mobile browsers.
Ionic is focused on building native/hybrid mobile apps rather than
mobile websites.
As such, our browser support tends to be whatever Web View API is
available to native apps on a given platform. For Ionic 1.1.0
"xenon-xerus", that means UIWebView for iOS 7+, and Android 4.1 and
up. Windows Phone and FirefoxOS support is on our roadmap.
If it's cheaper for you to test everything on all different desktop browsers than to develop a version for it sharing the same controllers and services --- go ahead but it won't come "out of the box".
Also, I recommend looking at Electron to build desktop apps from webapps.
ionic is targting mobile apps only , but you can develop your desktop app using node webkit and angular material for example and share some code between your apps

Titanium and PhoneGap

I'm new to Titanium and PhoneGap and analyzing a bit the two is not possible to develop iPhone with a PC with windows using either of the two right? Well I mean in PhoneGap in the most current versions is only possible to develop without publication.
I wonder if this is actually correct and whether there is a way to make an application to one of these two technologies (Titanium and PhoneGap) Fragment as a view of the native Android devices for both Android and iPhone / iPad. Improving question, make an application to view the devices can be adapted for smartphones and tablets for better use of the screen?
If yes there is some example code and/or source of research?
PhoneGap has an offering called PhoneGap build which just came out of beta. It lets you build your apps in the cloud without a Mac.
You might still need a Mac for certificate (p12 bundle) generation or you can use a service like Mobundler.
For Titanium, a recent service called Foundry22 lets you build your apps without a Mac or any native SDKs installed locally. You just need Titanium Studio and a hosted Git repo.

Cross Platform Apps

I am not much clear with the "Cross Platform Apps." Can we really built up some apps which can run on iPhone/iPad , Android Phones/Tabs , Blackberry , Nokia (Any platform or more than one platform at least) ?
I have heard something like WAC , Titanium but really not clear with all these. Please help me out.
There are some good frameworks out there to build cross-platform mobile applications:
Titanium: It is a framework to build Android, IPhone (and BlackBerry, still in beta it seems) using javascript, that will compile to native applications for the platforms specified.
Rhodes: A ruby framework, that supports almost all the mobile platforms out there (recently they added support to WP7). It has an MVC structure, and can use RhoSync to synchronize the data to a server side application.
PhoneGap: Another javascript framework, but it supports more platforms than Titanium, because it doesn't compile to native applications, but it embeds a web application inside a native application (web apps/web views are supported in each platform, so it's easier to handle the portability this way).
The apps will have access to the hardware, like the camera/gps, through some generic apis.
In some case you can build specific native module to integrate them in just one application platform if you need to.
These frameworks are useful to build cross-platform application writing just one application, without having to write each single application with the platforms sdks.
They have some (or many) limitations. If your application are simple enough you can consider using one of those framework. But for more complex ones, sometimes, if you target only a couple of plaforms, it could take less time to build each one with native sdks individually than using one of this cross-platform framework, because of their limitations (I highly prefer using the Android SDK than using Titanium).