Skip to content
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

Improve Android device type check and improve UI Test cake scripts #24495

Merged
merged 5 commits into from
Sep 6, 2024

Conversation

BretJohnson
Copy link
Member

@BretJohnson BretJohnson commented Aug 28, 2024

Description of Change

For Android visual tests, they should be run with the right device image. However, there's no easy way to check the device type for Appium. The check that was there before works on CI since the DEVICE_SKIN environment variable is set there (set by the android.cake script). And it can work locally if folks run android.cake then launch VS from that console session to get the env variable - but it doesn't work if VS is run separately (normal case). So update this with a different check, matching on the API level / screen size / screen density capabilities. Also update the failure message to give good instructions.

Also update the android.cake and ios.cake scripts to:

  • Have a new uitest-prepare target, which creates the image, launches the emulator/simulator, installs the apps, but doesn't run any tests nor does it stop the device when existing, just leaving things running. You can use this script to launch and then run individual tests in VS Test Explorer
  • Validate that JAVA_HOME is set for android.cake

Issues Fixed

Fixes #

For Android visual tests, they should be run with the right
device image (currently a Nexus 5X API 30). However,
there's no easy way to check the device type for Appium.
The check that was there before works on CI
since the DEVICE_SKIN environment variable is set there
(set by the android.cake script). And it can work locally if
folks run android.cake then launch VS from that console
session to get the env variable - but it doesn't work if VS
is run separately (normal case).

So update this with a different check. Getting the actual
Android device type requires using adb. We might eventually
do that, but for now just use a screen size check as a proxy
for the device type. Also update the failure message to give
good instructions.
@BretJohnson BretJohnson requested a review from a team as a code owner August 28, 2024 18:47
uitest-prepare will build the test app, launch
the emulator, and deploy the test app. But
it won't actually run any tests.
Also display the Android image name
@BretJohnson BretJohnson changed the title Improve Android device type check to use screen size Improve Android device type check Aug 29, 2024
@rmarinho rmarinho requested review from PureWeen and mattleibow and removed request for Eilon August 29, 2024 15:48
@samhouts samhouts added the area-testing Unit tests, device tests label Aug 29, 2024
@BretJohnson BretJohnson changed the title Improve Android device type check Improve Android device type check and UI Test cake scripts Aug 30, 2024
@BretJohnson BretJohnson force-pushed the dev/bretjohn/validate-android-device-type branch from e0e45b6 to d26219c Compare August 30, 2024 22:40
@BretJohnson BretJohnson changed the title Improve Android device type check and UI Test cake scripts Improve Android device type check and improve UI Test cake scripts Aug 30, 2024
@PureWeen PureWeen merged commit 566b859 into main Sep 6, 2024
97 checks passed
@PureWeen PureWeen deleted the dev/bretjohn/validate-android-device-type branch September 6, 2024 14:32
@samhouts samhouts added the fixed-in-net9.0-nightly This may be available in a nightly release! label Oct 1, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing Unit tests, device tests fixed-in-net9.0-nightly This may be available in a nightly release!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants