-
Notifications
You must be signed in to change notification settings - Fork 564
[Xamarin.Android.Build.Tests] Add support for testing the UI #2855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
83d7e15 to
3da30ec
Compare
f13fd74 to
efdfb57
Compare
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DeploymentTest.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DeploymentTest.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DeploymentTest.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs
Outdated
Show resolved
Hide resolved
d8857ba to
2044732
Compare
|
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
bc6ba03
Compare
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/DeviceTest.cs
Outdated
Show resolved
Hide resolved
0bca494 to
5e6d395
Compare
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/BaseTest.cs
Outdated
Show resolved
Hide resolved
5a05ee3 to
953ebc5
Compare
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/DeviceTest.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/DeviceTest.cs
Show resolved
Hide resolved
tests/MSBuildDeviceIntegration/MSBuildDeviceIntegration.targets
Outdated
Show resolved
Hide resolved
tests/MSBuildDeviceIntegration/MSBuildDeviceIntegration.targets
Outdated
Show resolved
Hide resolved
|
953ebc5 to
13e6f67
Compare
|
Test failures are as follows |
That is a very very weird crash. Maybe its from the nunit runner... Its an actual test crash. |
a87c8db to
acfd213
Compare
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 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
fb81f6a
Compare
|
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. |
|
Commercial build failure is looks like that java version problem |
|
@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. :-( |
|
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.