Uh oh!
There was an error while loading. Please reload this page.
[Xamarin.Android.Build.Tests] Add support for testing the UI - #2855
Conversation
83d7e15 to
3da30ecComparef13fd74 to
efdfb57CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
d8857ba to
2044732Comparejonpryor
commented
Apr 3, 2019
Conceptual question: for this to work, there needs to be an Android device available on which to run the test and manipulate the UI. Currently, unless I've forgotten something, Perhaps we're just really lucky so far? |
b7b1dd7 to
bc6ba03CompareUh oh!
There was an error while loading. Please reload this page.
0bca494 to
5e6d395CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
5a05ee3 to
953ebc5CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jonpryor
commented
Apr 11, 2019
|
953ebc5 to
13e6f67Comparedellis1972
commented
Apr 11, 2019
Test failures are as follows |
dellis1972
commented
Apr 11, 2019
That is a very very weird crash. Maybe its from the nunit runner... Its an actual test crash. |
a87c8db to
acfd213CompareThis commit adds support for testing that the app launches on device AND can be interacted with. It does this by making use of a few features of `adb`. First is `adb input`. This allow us to send taps and clicks to the device. It simulates user input. So we can use this to say click a button. Next up is the `uiautomator` this allows use to get the complete ui layout for the active activity. Using exec-out uiautomator dump /dev/tty we can send this data to the console. As it is xml we can then parse it looking for our ui element we want. We can then get the bounds of the control and pass that information to `adb input tap`. This commit also adds support for testing that the timezone set on a device is correctly picked up by mono. And finally we add support for testing that the debugger can actaully connect to the application. These tests are only run if the commerial parts of the product are available. Seeing as all of these new tests REQUIRE the emulator or device they have been split out into a new `MSBuildDeviceIntegration` project. This is built as part of the main solution. However it is run as part of the `make run-apk-tests` call. This is so we can be sure the emulator is running. In future any MSBuild related tests that REQUIRE a device should be placed in this new project.
acfd213 to
fb81f6aComparedellis1972
commented
Apr 15, 2019
Not sure why this test failed https://jenkins.mono-project.com/job/xamarin-android-pr-pipeline-release/569/testReport/junit/Mono/Android_TestsMultiDex/Possible_Crash___Release/ It does not seem to be related to this PR. |
dellis1972
commented
Apr 15, 2019
Commercial build failure is looks like that java version problem |
jonpryor
commented
Apr 16, 2019
@dellis1972 asked:
The problem is described in commit a972624:
If you download xa-test-results-v9.2.99.163_Darwin-x86_64_pr_07dd6aee-Release.zip, then i.e. adb is "not running" when it most certainly should have already been running, i.e. it crashed. Looks like bumping to platform-tools 28.0.2 didn't entirely fix things. :-( |
jonathanpeppers
commented
Apr 16, 2019
Ah! we merged this and it breaks the Windows build... |
Commit 66d0165 [broke the macOS build][0]: …/xamarin-android/tests/MSBuildDeviceIntegration/MSBuildDeviceIntegration.targets(18,5): error MSB3030: Could not copy the file "../../bin/TestRelease/Xamarin.Android.Cecil.Mdb.dll" because it was not found. This was probably "overlooked" because the builds for PR #2980 didn't include bf58a88/PR #2855. Update the paths used for `Xamarin.Android.Cecil*.dll` so that `MSBuildDeviceIntegration.targets` can run without error. [0]: https://jenkins.mono-project.com/view/Xamarin.Android/job/xamarin-android/463/
Context #2608
This commit adds support for testing that the
app launches on device AND can be interacted
with. It does this by making use of a few features
of
adb.First is
adb input. This allow us to send taps andclicks to the device. It simulates user input. So
we can use this to say click a button.
Next up is the
uiautomatorthis allows use to getthe complete ui layout for the active activity.
Using
we can send this data to the console. As it is
xml we can then parse it looking for our ui element
we want. We can then get the bounds of the control
and pass that information to
adb input tap.This commit also adds support for testing that
the timezone set on a device is correctly picked
up by mono.
And finally we add support for testing that the
debugger can actaully connect to the application.
These tests are only run if the commerial parts
of the product are available.
Seeing as all of these new tests REQUIRE the
emulator or device they have been split out into
a new
MSBuildDeviceIntegrationproject. Thisis built as part of the main solution. However
it is run as part of the
make run-apk-testscall. This is so we can be sure the emulator is
running.
In future any MSBuild related tests that REQUIRE
a device should be placed in this new project.