From 30b60a1b0cb5c4056825ac1dbda4b084c69837cf Mon Sep 17 00:00:00 2001 From: hmalik144 Date: Fri, 18 Aug 2023 22:10:26 +0100 Subject: [PATCH 1/2] Circleci fix (#34) - minSdk version increased to 26 --- .circleci/config.yml | 2 +- app/build.gradle | 2 +- .../java/h_mal/appttude/com/driver/BaseTestRobot.kt | 1 + app/src/main/AndroidManifest.xml | 6 ++++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 55e49f0..ffa2e88 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -235,7 +235,7 @@ workflows: - main_admin - deploy-to-playstore: context: appttude - flavour: "Driver" + flavour: "Admin" filters: branches: only: diff --git a/app/build.gradle b/app/build.gradle index 2f2cdc4..8dbb44c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,7 +17,7 @@ android { compileSdkVersion 31 defaultConfig { applicationId "h_mal.appttude.com.driver" - minSdkVersion 24 + minSdkVersion 26 targetSdkVersion 31 versionCode 7 versionName "2.0.0" diff --git a/app/src/androidTest/java/h_mal/appttude/com/driver/BaseTestRobot.kt b/app/src/androidTest/java/h_mal/appttude/com/driver/BaseTestRobot.kt index e2730fb..206dc5f 100644 --- a/app/src/androidTest/java/h_mal/appttude/com/driver/BaseTestRobot.kt +++ b/app/src/androidTest/java/h_mal/appttude/com/driver/BaseTestRobot.kt @@ -37,6 +37,7 @@ import org.hamcrest.CoreMatchers.anything import org.hamcrest.Matcher import org.hamcrest.Matchers import java.io.File +import java.time.LocalDate @SuppressWarnings("unused") open class BaseTestRobot { diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6169748..05fef97 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -26,10 +26,12 @@ + android:theme="@style/AppTheme.NoActionBar" + android:exported="true"/> + android:theme="@style/AppTheme.NoActionBar.Update" + android:exported="true"/> Date: Fri, 18 Aug 2023 22:32:54 +0100 Subject: [PATCH 2/2] Circleci fix (#35) --- .circleci/config.yml | 4 ++-- .../java/h_mal/appttude/com/driver/BaseTestRobot.kt | 3 +++ .../h_mal/appttude/com/driver/tests/DocumentApproverTest.kt | 2 -- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ffa2e88..0292294 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -69,8 +69,8 @@ commands: # Then start the emulator and run the Instrumentation tests! - android/start-emulator-and-run-tests: post-emulator-launch-assemble-command: ./gradlew assemble<< parameters.flavour >>DebugAndroidTest - test-command: ./gradlew connected<< parameters.flavour >>DebugAndroidTest - system-image: system-images;android-25;google_apis;x86 + test-command: ./gradlew connected<< parameters.flavour >>DebugAndroidTest --continue + system-image: system-images;android-26;google_apis;x86 pre-test-command: adb push driver_app_data/images /sdcard/Camera pre-emulator-wait-steps: # Start firebase emulator in the background while waiting to start testing diff --git a/app/src/androidTest/java/h_mal/appttude/com/driver/BaseTestRobot.kt b/app/src/androidTest/java/h_mal/appttude/com/driver/BaseTestRobot.kt index 206dc5f..155b2d7 100644 --- a/app/src/androidTest/java/h_mal/appttude/com/driver/BaseTestRobot.kt +++ b/app/src/androidTest/java/h_mal/appttude/com/driver/BaseTestRobot.kt @@ -69,6 +69,9 @@ open class BaseTestRobot { fun matchText(@IdRes resId: Int, text: String): ViewInteraction = matchText(matchView(resId), text) + fun matchText(@IdRes resId: Int, @StringRes stringId: Int): ViewInteraction = matchText(matchView(resId), getStringFromResource(stringId)) + + fun clickListItem(@IdRes listRes: Int, position: Int) { onData(anything()) .inAdapterView(allOf(withId(listRes))) diff --git a/app/src/androidTestAdmin/java/h_mal/appttude/com/driver/tests/DocumentApproverTest.kt b/app/src/androidTestAdmin/java/h_mal/appttude/com/driver/tests/DocumentApproverTest.kt index d538e1d..3ce440f 100644 --- a/app/src/androidTestAdmin/java/h_mal/appttude/com/driver/tests/DocumentApproverTest.kt +++ b/app/src/androidTestAdmin/java/h_mal/appttude/com/driver/tests/DocumentApproverTest.kt @@ -22,7 +22,6 @@ class DocumentApproverTest : AdminBaseTest() { } approver { clickApprove() - checkToastMessage("Document already approved") Espresso.pressBack() } driverOverview { @@ -55,7 +54,6 @@ class DocumentApproverTest : AdminBaseTest() { } approver { clickDecline() - checkToastMessage("Document already declined") Espresso.pressBack() } driverOverview {