Testing framework for ionic angular cordova app real devices with continuous integration? - angularjs

Our team is starting a project and we would like to have an automated testing server that tests our app on real devices, instead of emulators or just browser.
Its an Ionic framework app, so Cordova+AngularJS.
I am going to research this and give the best answer I have, but in the meantime if anyone is familiar with it, I'd love to hear all about it!

I'm interested on that point too.
For instance, I manage to code very few tests with APPIUM but seems to do the job for tests using Selenium webserver
Looking forward for other user feedback

The intel xkd provides on device testing via the intel xkd preview app and on device debugging via the adb with debugger. Also comes with build services for android, ios, windows, tizen, amazon, nook, webapp, chrome, facebook, and firefox. This is the easiest way I have found for testing on device to make sure Cordova plug ins work and to get live JavaScript debugging. https://software.intel.com/en-us/intel-xdk

Another option is to run the ionic app in phantomjs and run integration tests using your server-side framework. This allows you to quite easily test across the entire stack. Theres a blog post about how to do it with rails at http://www.dovetaildigital.io/blog/2015/10/28/rails-and-ionic-make-love-part-three

Related

How to use chromium engine inside google chrome to render my application

I wonder if it is possible to use chromium engine inside google chrome or the google chrome itself to render a web page inside my WPF application instead of using traditional WebView (because it's the IE engine and it's awful -_-) or implementing CEFSharp (because it uses about 200 MB of space only for the chromium engine)
so in this case I need the target pc to has installed google chrome or any other(firefox or ...)
Soooo ... is there any solution?
thanks in advance
EDIT
I want to create applications based on web UI, - because of being easy and powerful - I know some providing this feature, e.g. CEF Sharp WPF or electron js but they include a full chromium engine with the app. I don't want this.
I want to create my app as light as possible, and my idea is to use chromium engine of a modern browser, that almost everyone has one.
For example, imagine that the user has installed google chrome.
first I locate the installation folder
I use chromium.exe -render path/to/file.html(imaginary) command to render my application UI.
finally bind the UI events to my native code. (e.g. c#(wpf) or any language that you can create desktop apps with it)
One solution is creating web apps by installing a website with the browser. but with that you cannot for example create or read some files in user pc, or any similar operation.
I'm looking for the most light-weight solution...
There is a new Chromium based WebView2 control that you can use to embed modern web content in your WPF application.
Please refer to the docs for more information about the prerequisites and how to use it:
Getting started with WebView2 in WPF
Explanation
So, let's say that you want your UI to be rendered in a chromium environment(aka a browser)… right?
let's take a look at electron js:
it uses NodeJS as backend.
it uses an embedded browser for frontend.
the language used is JavaScript due to NodeJS.
So, you want to use the client's browser to render your frontend instead of embedding a browser inside it.
well, don't embed it!!
you can create a web application(e.g. opened by typing localhost:<port> in browser1) using NodeJS and handle your IPC(between frontend and backend) using ajax calls or a socket connection.
that way you are doing exactly what an electron app does, except that, electron uses a bundled browser.
now you made your app lighter, also if your client do have NodeJS installed, you don't need to bundle NodeJS!
--- inspired by jupyter notebooks ---
Possible Solutions
use NodeJS as backend.
use python and combine it with Flask or Django as backend. (I think this would be the most lightweight solution)
use PHP as backend. (the best, personal opinion)
use ASP.NET/Blazor as backend. (as mentioned in the comments; but doesn't seem to be a lightweight solution)
or use any language that you can create a web application with that!
make a runApp.bat or runApp.sh to simply run your server and open the browser automatically.

Web Test framework for Mobile as well as Server browsers

Is there any framework available where I can write single set of test code for both Server browsers as well as Mobile browsers.
eg. test.py runs with Chrome on Android as well as Windows
I am planning to use browserstack for my testing until I figure out the infrastructure handling is possible with browserstack or not.
Please help me figure out a way for deciding over the infrastructure as well.
You can try TestCafe. It's an open source project.
TestCafe allows to run tests on desktop and mobile browsers without any additional installations and plugins.
Here you can see how easy to run tests on a mobile phone with TestCafe: https://twitter.com/DXTestCafe/status/804368394569052160.
Also it's easy to setup testing on mobile browsers in a cloud service (like BrowserStack or Saucelabs). For example you can find the "testcafe-browser-provider-saucelabs" plugin on GitHub to run tests on Saucelabs out-of-the box.
Selenium + Appium should be able to cover what you need to be done. To share code however, you'll need use a mobile browser (Chrome or Safari) or have an app that uses webviews that are the same as the browser version.
The Selenium bindings will handle driving the automation for the browsers. By itself, you could test the desktop browser with a normal size screen, as well as a mobile size, and test various browsers as well (Chrome, Firefox, etc).
Appium will allow you to open the browser (or app) on the mobile device or simulator, and if the web view is the same as the browser, the same locator strategies you used with the desktop browsers and Selenium will work with Appium as well (Appium extends the Selenium spec with browser capabilities).
If you code the framework using the Selenium Grid, you can then almost drop replace a remote managed grid setup (via Saucelabs or Browserstack) to run the browsers for you (otherwise you'd need to setup a local grid or run the tests with a local Selenium server set up)
All this is quite possible
framework available where I can write single set of test code for both Server browsers as well as Mobile browsers
We have build it in our company, since we have a vast diversity of different platforms and browsers to support.
We use combination of Selenium based frameworks on NodeJS
webdriverIO
cucumberJS
appium
... etc.
The main concept we try to follow is JAVA's WORA. To achieve all this you need a good understanding of DSLs, Application driver layer and design patterns (e.g. Strategy).
It is not that hard to put all this together, since Selenium supports pretty much every binding you need. Just pick the language you are most comfortable with and use it.

How to automate a Silverlight based web application using selenium?

I am trying to automate a web application using selenium, however that application is developed using Silverlight. Hence, i am not able to inspect the elements in the web page. Could anyone please suggest on how to tackle this problem?
Out of the box, selenium won't natively support testing a Silverlight-based web app. There is https://code.google.com/archive/p/silverlight-selenium/, but it doesn't look like that project is currently being maintained. Beyond that, Silverlight itself is not longer under development, and it won't run on recent versions of Chrome or Edge (or Android or iOS).

compile angularjs ionic app with Phonegap Build

is it ok to compile a AngularJS+ Ionic app using Phonegap Build or Steroids ?
Or should I use another platform ?
I would like your feedback!
Thanks
To answer your question, yes you can use PhoneGap Build to build your application. We are using it to build our AngularJS + Onsen UI app, but it should also suitable for Ionic. The question isn't really about which front-end techniques you use, whether it is about your other needs such as platform support (PhoneGap Build supports "only" iOS, Android and Windows Phone 8) and plugins needed (again, PhoneGap Build doesn't automatically support every plugin there exists, but ~400 they support should be enough in most of the cases). If there limitations are okay for you, go ahead and try it. It is easy to setup and has quick builds almost out-of-box for your Cordova application.
About Steroids, I can't say anything as haven't used it.
yes you can use PhoneGap Build to build your application on android and window phone but ios you need key Provisioning profile good luck

Debugging in in emulator with Ionic framework

I'm very new to Ionic framework and trying to find a way to debug my app. My problem is, I want to check if my Angularjs function call is working in the js file.
As a web developer what I used to do is with Chrome Dev tools by adding some breakpoints and etc..
I'm wondering that is the approach in Ionic framework to check/ debug my Angularjs code? and please note I'm testing a Cordova plugin and it does not support web browser testing.
So is there anyway of adding breakpoints / debug in Ionic apps with emulators (iOS)?
You can connect your device to chrome dev tools and debug your app. It works for Android and iOS. You may also use GapDebug, which is a free tool encapsulating chrome dev tools.

Resources