Network provided date and time (Ionic 2) - ionic2

I am developing an android app in ionic 2, is there a way I can determine if the time that I am getting is network provided or if the time was set manually.
Thanks!

Related

Can I launch protractor mobile test on the AWS Device Farm

Can I run my e2e test developed using Protractor on the AWS device farm?
Because I want to complete mobile testing of my project using the AWS device farm, and do not really understand can I do that or not. I found 3 types about that on the AWS forum, but it is too old from 2018.
First forum discussion
Second forum discussion
Third forum discussion
Maybe something changed?
I have protractor e2e tests written for the desktop browser and want to use those ones for the mobile browser too.
I will answer this for both mobile browsers and desktop testing.
Mobile Browsers
AWS Device Farm has 2 execution modes: Standard Mode and Custom Mode.
Standard mode gives you granular reporting if you don't generate a report for your tests locally. This splits up the artifacts for each test.
Custom mode gives you as close as possible execution state and results as you would get locally. It does not give you the granular reporting which is fine for most as you already get reports locally which will be available on Device Farm as well. It is recommended for customers to use custom mode as that is the one that is most up to date and adds supports for latest frameworks unless of course they absolutely need granular reporting.
Protractor on Device Farm
It is not officially support today.
However, Device Farm supports Appium Nodejs in custom mode. You get a yaml file where you can run shell commands on the host machine where the tests will be executed. So in case of protractor you could select this test type (Appium Nodejs), install the missing dependencies needed for the tests, start your server, and run your tests.
The points to evaluate: Since Device Farm takes your tests as inputs, you will have to upload the zip file of your tests. I would highly recommend checking the instructions for nodejs tests and using the same. Alternatively, you can also download your tests on the fly using the yaml file.
Desktop Browsers
Device Farm has a selenium grid that you can connect to from your local machine and run your tests. The browsers Chrome and Firefox run on Windows platform and Safari is not supported today. If you use a selenium grid on your local machine for your tests, then you most likely should be able to run the same tests using the Selenium grid on Device Farm. Of course, pending validation.
If you need more help on any of these items feel free to reach out to aws-devicefarm-support#amazon.com and I can help you further.
You can test in chrome with an emulated mobile mode:
You can add "mobileEmulation" in a new protractor.conf-mobile.js
chromeOptions: {
args: ['--disable-infobars', '--headless', '--disable-gpu', '--window-size=1920,1080'],
'mobileEmulation' : { 'deviceName': 'Galaxy S5' },

How to use a single PostGreSQL while having two Django Apps accessing it that are running in Google App Engine and Google App Engine Flexible

I have a Django Application (first application) running on Google App Engine.
There is another time consuming application (second application) running in Google App Engine Flex.
Both applications are connected to the same PostGreSQL Database.
When the second application finishes its execution it needs to write the results to the database and first application can access the data.
What is the correct path to achieve this ?
Should I use exact same models and expect everything to be straightforward ?
When you want to synchronize 2 applications, the best pattern is to use PubSub for asynchronous requirement. The application post a message into pubsub at the end of the process and you can plug a subscription (pull ou push, all depends of your design and requirements) to trigger a process in another application.
However, having 2 applications using the same schema is not recommended, you will have difficulties when you would like to improve the schema: both applications will need to be update in the same time if you don't want to have issues. Microservice pattern is a micro monolith of 1 application + 1 database!

Running Caffe2 Model on android - my model running very slow on the android device(dosen't finish the init phase)

I'm trying to run a Caffe2 model on an android device, i ran the AICameraDemo App successfully but my model init net is 7 times larger than sqeeznet model, and the load of the init net to the workspace with the predictor or with RunNetOnce takes forever.
I saw posts about this, most of them from 2018 so i'm wondering if anything change since then.
If it is not possible, is there another framework which i could run a model this big on an android device ?
Thanks for any answer.

App is getting installed for every test method in Amazon device farm.

App is getting installed for every test method in Amazon device farm. But the same code works fine on real devices. Any capabilities to be added to get rid of this issue?
There is solution for this problem. However, you need to install the app only once on the device before you start execution.
If you install the app (apk file) manually then you don't need to add the "app" desired capability. Instead you can just add two capabilities : "appActivity" and "appActivity"
capabilities.setCapability("appPackage", "com.your.app.package.name");
capabilities.setCapability("appActivity", ".ui.ActivityName");
If you use "app" capability in desired capabilities then appium tries to install the apk on the device every time when driver is initialized. Removing this capability and adding appPackage and appActivity is the best way to avoid re-installing the app every time.
AWS Device Farm does not install the app every time; however they do run each test individually rather than in bulk.

Is it possible to change my web application server date using Robot Framework & RIDE?

I am currently testing a web application & for some reason in the application business I need to change the db server & application server date so that some of the disabled fields in the web application become enabled for editing, so is there any possible way to automate the part of changing the servers date to a certain date using Robot Framework & it IDE (RIDE) ?
and if it is possible please provide any code sample as an example...
It may be possible, though that depends on whether or not your server and database allow you to change the date while its running. There's nothing built-in to robot to do this, but if you can create a program or script that does this, you can use the Process library to run that script.
In other words, the limiting factor isn't robot framework, it's your system. If your system allows you to do this at runtime, you can certainly do it from robot framework.