This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
APK_URL="" ###### UPDATE THIS WITH THE URL TO THE ARCHIVED LAST SUCCESSFUL BUILD ARTIFACT ON JENKINS FOR EXAMPLE | |
FILEPATH="" | |
## MAKE SURE ADB IS RUNNING ## | |
adb version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SDK=`adb shell getprop ro.build.version.sdk | tr -d '\r'` | |
echo "Device SDK level is: " $SDK | |
if (( "$SDK" >= 23 )) ; then | |
echo "Enabling read and write external storage permissions before running tests on Android 6.0+" | |
adb shell pm grant com.replace.with.your.app.package android.permission.WRITE_EXTERNAL_STORAGE | |
adb shell pm grant com.replace.with.your.app.package android.permission.READ_EXTERNAL_STORAGE | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.testexample.RunListeners | |
import android.support.test.InstrumentationRegistry; | |
import android.support.test.uiautomator.UiDevice; | |
import org.junit.runner.Description; | |
import org.junit.runner.notification.Failure; | |
import org.junit.runner.notification.RunListener; | |
import java.io.File; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.factorypatterndemo.utils.interfaces; | |
import java.io.IOException; | |
import java.util.Calendar; | |
import com.android.uiautomator.core.UiObjectNotFoundException; | |
public interface SystemUiDateTimeViewHelperInterface { | |
void setSystemTime(Calendar calendar) throws UiObjectNotFoundException, IOException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.factorypatterndemo.utils.factories; | |
import android.os.Build; | |
import com.factorypatterndemo.utils.helpers.AsusNexus72012sdk21SystemDateTimeViewHelper; | |
import com.factorypatterndemo.utils.helpers.SamsungGalaxyS5sdk19SystemDateTimeViewHelper; | |
import com.factorypatterndemo.utils.interfaces.SystemUiDateTimeViewHelperInterface; | |
public class SystemUiDateTimeViewHelperFactory { | |
static String galaxyS5_sdk19_fingerprint = "samsung/kltedx/klte:4.4.2/KOT49H/G900FDXU1ANG4:user/release-keys"; |