Skip to content

Commit aa3ed05

Browse files
stefan-niedermannAndyScherzinger
authored andcommitted
chore(e2e): Add more log output
Signed-off-by: Stefan Niedermann <info@niedermann.it>
1 parent 7e93d9a commit aa3ed05

File tree

1 file changed

+12
-1
lines changed
  • sample/src/androidTest/java/com/nextcloud/android/sso/sample

1 file changed

+12
-1
lines changed

sample/src/androidTest/java/com/nextcloud/android/sso/sample/E2ETest.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import static androidx.test.uiautomator.Until.hasObject;
55

66
import android.content.Intent;
7+
import android.content.pm.PackageManager;
78
import android.util.Log;
89
import android.webkit.WebView;
910
import android.widget.Button;
@@ -46,6 +47,16 @@ public void before() {
4647
@Test
4748
public void test_00_configureNextcloudAccount() throws UiObjectNotFoundException, InterruptedException {
4849
Log.i(TAG, "Configure Nextcloud account");
50+
51+
final var context = getInstrumentation().getContext();
52+
final var packageManager = context.getPackageManager();
53+
try {
54+
packageManager.getPackageInfo(APP_NEXTCLOUD, 0);
55+
Log.i(TAG, "Nextcloud APK is installed (checking on runtime)");
56+
} catch (PackageManager.NameNotFoundException e) {
57+
Log.e(TAG, "Nextcloud APK is NOT installed (checking on runtime");
58+
}
59+
4960
launch(APP_NEXTCLOUD);
5061

5162
final var loginButton = mDevice.findObject(new UiSelector().textContains("Log in"));
@@ -82,7 +93,7 @@ public void test_00_configureNextcloudAccount() throws UiObjectNotFoundException
8293
// Log.d(TAG, "Scroll to bottom of WebView…");
8394
// mDevice.findObject(By.clazz(WebView.class)).swipe(Direction.UP, 1f);
8495
// Log.d(TAG, "Finished scrolling");
85-
webViewLoginButton.dragTo(0,0, 40);
96+
webViewLoginButton.dragTo(0, 0, 40);
8697

8798
webViewLoginButton.click();
8899

0 commit comments

Comments
 (0)