I have Android application which communicates with device using BLE. I want to cover BLE logic with tests.
Is it possible to run unit tests (or maybe instrumentation tests) with real BLE device on real Android device?
Using only Android instrumented tests? I don't see a way of doing that.
Using external elements?
Yes, it is possible, but you need to implement your own 'framework'. I mean you need a way to control the BLE device, a library on CLI for example, this would be done outside the Android instrumentation test so you would integrate the framework to instrumented tests.
Related
My intention is to use Cypress with browserstack to connect to real devices to test web application. I want to run the Cypress tests on iOS and Android devices.
Is it possible to do so? Any help is appreciated.
BrowserStack list supported for running test on cypress https://www.browserstack.com/docs/automate/cypress/browsers-and-os
Cypress itself does not support running tests on real devices but you can set Browser dimensions: https://www.cypress.io/blog/2020/07/08/end-to-end-testing-mobile-apps-with-ionic-and-cypress/
Is it possible to simulate root access when testing without running the tests on two different devices?
I set up the automator and implemented some test cases.
I can run it via adb comandline instruction. But is there a way to run it directly in the Eclipse environment?
Like JUnit test cases?
As standard, UI Automator tests are compiled and built into a jar file, on a desktop computer, they are then deployed to the device by pushing the jar file to the device using adb. They are then run on the device, in the Android runtime by using adb shell uiautomator
I have not seen anyone else trying to run the test cases directly on the device rather than building them following the approach Google (Android) document. It might be possible, however you may have to work hard to discover whether your approach is possible or viable. UIAutomator is distinct and separate from the Android InstrumentationTestCase framework. Instead it interacts with the GUI and has the advantage of being able to interact with a wide range of apps, including things like the inbuilt Settings UI on Android devices.
I am using webdriver-user-agent to perform a automation test in rails.
The available options are:
:browser
:firefox (default)
:chrome
:agent
:iphone (default)
:ipad
:android_phone
:android_tablet
:orientation
:portrait (default)
:landscape
How can i check the automation request using real mobile devices such as android/iphone/ipad,etc.
That gem is used to mimic a device's resolution/user-agent for responsive design testing. You can't run tests on an actual device with it. If you want to test a web application on a mobile browser, webdriver-user-agent should be good enough.
For testing on a device, you'd need something like Appium.
Looking through the Android apis I found a method call isUserAMonkey(),
says it returns true if the phone is being messed with by a monkey.
Is this a joke, or what is it used for?
Look at monkeyrunner, it will give you the answer.
Quote from the document:
The monkeyrunner tool provides an API for writing programs that
control an Android device or emulator from outside of Android code.
With monkeyrunner, you can write a Python program that installs an
Android application or test package, runs it, sends keystrokes to it,
takes screenshots of its user interface, and stores screenshots on the
workstation. The monkeyrunner tool is primarily designed to test
applications and devices at the functional/framework level and for
running unit test suites, but you are free to use it for other
purposes.
So if you are running a package using Monkeyrunner, then this function will return true.