Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Update Android UI test instructions #7579

Merged
merged 5 commits into from
Sep 26, 2019
Merged

Conversation

adrianknight89
Copy link
Contributor

Added instructions for running Android UI tests on Windows.

@PureWeen @jfversluis @samhouts When I debug the test project on Windows, ApkPath isn't correct for me. We go 3 folders up from the current directory and append a substring to point to the Apk file, but I noticed my current directory does not point to the solution directory. It points to the Temp folder instead.

static IApp InitializeAndroidApp()
{
	var directory = Directory.GetCurrentDirectory(); // added this line for testing

	var app = ConfigureApp.Android.ApkFile(AppPaths.ApkPath).Debug().StartApp();

	if (bool.Parse((string)app.Invoke("IsPreAppCompat")))
	{
		IsFormsApplicationActivity = true;
	}

	return app;
}

directory returns C:\Users\[user]\AppData\Local\Temp for me. So, when we go 3 levels up and then append the rest of ApkPath, I end up with

C:/Users/[user]/Xamarin.Forms.ControlGallery.Android/bin/Debug/AndroidControlGallery.AndroidControlGallery-Signed.apk which is not correct because it's missing the parent folder I checked out XF solution to. Any of you saw this issue before?

Temporarily, I hard-coded the path to the Apk in local, but I'd like to know the root cause of this issue if possible.

@rmarinho
Copy link
Member

Hum, yeah I have the same issue, but it does work fine on the Mac no ?

@adrianknight89
Copy link
Contributor Author

adrianknight89 commented Sep 21, 2019

@rmarinho I develop on Windows, so I saw it there. Not sure about Mac.

@rmarinho rmarinho merged commit 3d68318 into xamarin:master Sep 26, 2019
rookiejava pushed a commit to rookiejava/Xamarin.Forms that referenced this pull request Oct 7, 2019
* update readme file for Android ui tests

* added extra pounds

* added UI word

* fix error

* removed word
alanag13 pushed a commit to alanag13/Xamarin.Forms that referenced this pull request Oct 20, 2019
* update readme file for Android ui tests

* added extra pounds

* added UI word

* fix error

* removed word
@samhouts samhouts added this to the 4.4.0 milestone Oct 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants