NativeScript Unit Testing keep disconnecting - unit-testing

Why tns test closes blank NativeScript app?
I have initialized a jasmine test from example in Unit Testing NativeScript Docs.
After I run
tns test android
First App launches and shows correct test pass screen, but after 4-5 seconds just closes and gives following error in shell.
DisconnectedClient disconnected from CONNECTED state (transport error)
All dependencies match the latest package versions :)
Things I have already tried:
connecting over wi-fi and USB.
two different android mobiles but they closed app after showing successful test screen

Related

How to run multiple instances of console app with VS2019?

I am following networking tutorial series and I need to run both Server and Client projects. When I click ServerProject->Debug->Start New Instance everything is fine, but the option becomes unavailable for ClientProject while Server is running. How can I enable this option and run them both? There is also a third project with winsock stuff set as Startup Project and both Server and Client depend on it.

Live Unit testing is not working "Failed to initialize client proxy: could not connect to test process."

When Trying to activate live unit testing on VS 2017 I get this error:
[TestRunner 1] Failed to initialize client proxy: could not connect to test process.
FatalError - System.AggregateException: One or more errors occurred. ---> Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Failed to initialize client proxy: could not connect to test process.
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyOperationManager.SetupChannel(IEnumerable`1 sources)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.InitializeExtensions(IEnumerable`1 sources)
at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Client.ProxyExecutionManager.StartTestRun(TestRunCriteria testRunCriteria, ITestRunEventsHandler eventHandler)
Other similar solutions to this error say it might be permissions so I've already tried running VS2017 as administrator, but that didn't work. and other solutions say tat I need to run the test in a different way but this is for live unit testing so I don't think they a viable options. I've even created a new unit test project from the one that already existed but I still get this error.
Update:
The Tests are located in a MsTest V2 test project running on a VS2017 enterprise Edition and it is testing an MVC webpage project under .Net framework 4.5.2 using Git version controls.
In my case issue was caused because of wrong configuration of my runsettings file.
If you use testsettings , try to execute tests without using it.

The stream was unable to connect due to a network error. Make sure your connection isn't blocked by a firewall - Tokbox error

The application that we have is developed in Angular 2.
To make use of tokbox we have 2 parts:
mobile part developed in Angular 2 (Ionic 2) that is the one that makes the call.
Web part developed in .Net what is the one that answers the call.
When we execute both projects on the web the call is executed correctly, but, when we run the part of Angular on a mobile device(iPhone), the error: "The stream was unable to connect due to a network error. Make sure your connection isn't blocked by a firewall" is presented, on the device and on the web, only the camera corresponding to that participant is opened ( To the web that is the one that answers the call).

Python Code Coverage over XMLRPC connection

I am working on an Automation project which has some xmlrpc calls integrated with it, as my setup is based on client server model.
I want to get an end to end code coverage details for the complete project while running automation tests.
I am wondering if there is any way through which we can determined code coverage over xmlrpc calls ? I have tried working with coverage.py but it works fine for local code only. Seems it can not go beyond rpc.

How to disable WiFi on Glass for testing?

I want to develop a receiver for Google Glass which will detect the WiFi state of Glass and depending on that state show some information to user.
The receiver will listen for android.net.wifi.WIFI_STATE_CHANGED so that I can catch the event and after that check the status of the internet. It will not only detect the internet availability but will also show if Glass is timing out when pinging any specific IP address from any apps of glass.
I have tested the receiver on another Android device and it's working fine. But now I want to test the app on Glass. In order to test, I want to disable WiFi; however, Glass only shows options in settings for forgetting the current WiFi network and connecting to a nearby network.
How can I disable WiFi on Glass temporarily?
From default settings of glass its not possible to disable WiFi. To do the things you have to follow some instructions and install android default launcher and settings so that you can get the settings UI as your android device and do the rest of the desire works.
I am describing the whole process here :
At first you have to download these two apk.
Settings.apk - http://goo.gl/EqV8u
Launcher2.apk - http://goo.gl/ytfSn
After that you have to install these two apps into your glass by ADB :
1. adb install Settings.apk 2. adb install Launcher2.apk
Please be careful not to check the “Use as Default” box or you will not be able to access your Glass Settings until you uninstall Launcher2.apk.
After complete installing go to your settings and select launcher. After selecting android default launcher you will get the setting UI as like as your android device. Now you can do whatever you want like WiFi enable/disable, Bluetooth enable/disable and etc. But there have some issues which not working like Bluetooth Tethering, Data Usage , Airplane Mode and some more features.
Details process of using the settings and launcher and not working features.
If you want to uninstall the installed app at first see your app packages name and delete the app from the devices using below script :
adb shell pm list packages [see all of your installed app list]
abd shell pm uninstall -k com.packagename [your app by specific package name]
After above script you will get your previous glass settings.
Here is the excellent video where all these process has been described in nice way.
Voiding Your Warranty: Hacking Glass
Well as you already know we cannot disable/enable wifi and bluetooth through the native settings application(and I really don't know why). But what we know is that Google Glasses is a bit special Android device on which we can do a lot of stuff that can be done on a regular android device(such as a phone). Among "the stuffs" that can be done is enabling/disabling wifi and bluetooth programatically! In order to do that you must create your own small project and include the following lines:
WifiManager wifiManager = (WifiManager) this.getSystemService(Context.WIFI_SERVICE);
wifiManager.setWifiEnabled(true);
wifiManager.setWifiEnabled(false);
boolean wifiEnabled = wifiManager.isWifiEnabled();
//Disable bluetooth
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (mBluetoothAdapter.isEnabled()) {
mBluetoothAdapter.disable();
}
after running your small application that disables wifi and bluetooth you can navigate to your glass settings and see that both wifi and bluetooth are OFF. If you access one of them it asks you to turn them back on. At least it works for Google Glass 19.1 (this is my current version).
I made an app that should let you toggle wifi on and off right from the menu.
Either say "okay glass, power options" or navigate to the card under the "okay glass" menu structure.
Working on bluetooth for later. Based the app on the link below.
my app
https://github.com/afzaman/Power-Options-GoogleGlass
resources:
http://javatechig.com/android/how-to-turn-off-turn-on-wifi-in-android-using-code