Skip to content

Commit a6e46f5

Browse files
eduardo.alonsoeduardo.alonso
authored andcommitted
New version 3.0.0. Rebranded example to cm style
1 parent 2be73f8 commit a6e46f5

File tree

279 files changed

+7384
-3632
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

279 files changed

+7384
-3632
lines changed

README.md

Lines changed: 11 additions & 7 deletions

app/build.gradle

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,25 @@
11
plugins {
22
id 'com.android.application'
33
id 'kotlin-android'
4+
id 'androidx.navigation.safeargs.kotlin'
45
id 'kotlin-kapt'
56
}
67

78
android {
8-
compileSdk 31
9+
compileSdk 33
910

1011
defaultConfig {
1112
minSdk 25
12-
targetSdk 29
13+
targetSdk 33
1314
versionCode 1
1415
versionName "2.1.0"
1516
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1617
manifestPlaceholders.launcherTheme = "@style/Base.Launcher"
1718
manifestPlaceholders.appIcon = "@mipmap/ic_launcher"
18-
19-
setProperty("archivesBaseName", "ecr-$versionName")
2019
}
2120

2221
buildTypes {
23-
debug {
24-
// minifyEnabled true
25-
// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
26-
manifestPlaceholders.appIcon = "@mipmap/ic_launcher_dev"
27-
applicationIdSuffix = ".debug"
28-
}
22+
debug { }
2923
}
3024
compileOptions {
3125
sourceCompatibility JavaVersion.VERSION_1_8
@@ -78,8 +72,9 @@ dependencies {
7872
debugImplementation "androidx.test.ext:junit:$rootProject.ext.androidx_junit"
7973
debugImplementation "androidx.test.espresso:espresso-core:$rootProject.ext.espresso_core"
8074
debugImplementation "androidx.test:runner:$rootProject.ext.espresso"
81-
debugImplementation "androidx.test:rules:$rootProject.ext.espresso"
82-
debugImplementation "androidx.test:core-ktx:$rootProject.ext.espresso"
75+
debugImplementation "androidx.test:rules:$rootProject.ext.test_rules"
76+
debugImplementation "androidx.test:core-ktx:$rootProject.ext.test_rules"
77+
implementation "com.android.support.test.espresso:espresso-idling-resource:$rootProject.ext.espresso"
8378
debugImplementation "androidx.fragment:fragment-testing:$rootProject.ext.fragment_testing"
8479
debugImplementation "androidx.navigation:navigation-testing:$rootProject.ext.nav_version"
8580

@@ -95,4 +90,7 @@ dependencies {
9590

9691
// Sunmi
9792
implementation "com.sunmi:printerlibrary:$rootProject.ext.printer"
93+
94+
// Lottie animation
95+
implementation "com.airbnb.android:lottie:$lottie_version"
9896
}

app/src/androidTest/java/com/cm/payplaza/ecr_sdk_integration/PaymentActivityTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class PaymentActivityTest: KoinComponent {
114114
activityRule.scenario.onActivity { a ->
115115
a.onSupportNavigateUp()
116116
}
117-
onView(withId(R.id.ecr_drawer)).check(matches(isDisplayed()))
118-
onView(withId(R.id.ecr_navigation)).check(matches(isDisplayed()))
117+
onView(withId(R.id.drawer)).check(matches(isDisplayed()))
118+
onView(withId(R.id.ecr_preauth_expandible_list)).check(matches(isDisplayed()))
119119
}
120120
}

app/src/androidTest/java/com/cm/payplaza/ecr_sdk_integration/RefundActivityTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ class RefundActivityTest: KoinComponent {
6464
onView(ViewMatchers.withId(R.id.keypad_button_3)).perform(ViewActions.click())
6565
onView(ViewMatchers.withId(R.id.amount_view_amount)).check(ViewAssertions.matches(ViewMatchers.withText("*****")))
6666
Thread.sleep(200)
67-
onView(ViewMatchers.withId(R.id.keypad_button_confirm)).perform(ViewActions.click())
67+
onView(ViewMatchers.withId(R.id.actionButton)).perform(ViewActions.click())
6868
Thread.sleep(200)
6969
onView(ViewMatchers.withId(R.id.keypad_button_1)).perform(ViewActions.click())
7070
onView(ViewMatchers.withId(R.id.keypad_button_0)).perform(ViewActions.click())
7171
onView(ViewMatchers.withId(R.id.keypad_button_0)).perform(ViewActions.click())
7272
onView(ViewMatchers.withId(R.id.amount_view_amount)).check(ViewAssertions.matches(ViewMatchers.withText("1.00")))
7373
Thread.sleep(200)
74-
onView(ViewMatchers.withId(R.id.keypad_button_confirm)).perform(ViewActions.click())
74+
onView(ViewMatchers.withId(R.id.actionButton)).perform(ViewActions.click())
7575
Thread.sleep(200)
7676
if("NL" != localDataRepository.getTerminalData()?.storeCountry) {
7777
onView(ViewMatchers.withId(R.id.keypad_button_1)).perform(ViewActions.click())
@@ -82,7 +82,7 @@ class RefundActivityTest: KoinComponent {
8282
onView(ViewMatchers.withId(R.id.keypad_button_6)).perform(ViewActions.click())
8383
onView(ViewMatchers.withId(R.id.amount_view_amount)).check(ViewAssertions.matches(ViewMatchers.withText("123456")))
8484
Thread.sleep(200)
85-
onView(ViewMatchers.withId(R.id.keypad_button_confirm)).perform(ViewActions.click())
85+
onView(ViewMatchers.withId(R.id.actionButton)).perform(ViewActions.click())
8686
Thread.sleep(200)
8787
onView(ViewMatchers.withId(R.id.date_component_view)).perform(ViewActions.click())
8888
}

app/src/androidTest/java/com/cm/payplaza/ecr_sdk_integration/TransactionResultActivityTest.kt

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
package com.cm.payplaza.ecr_sdk_integration
22

3-
import androidx.fragment.app.testing.FragmentScenario
43
import androidx.fragment.app.testing.launchFragmentInContainer
4+
import androidx.lifecycle.Lifecycle
55
import androidx.test.espresso.Espresso.onView
66
import androidx.test.espresso.IdlingPolicies
7-
import androidx.test.espresso.action.ViewActions
87
import androidx.test.espresso.assertion.ViewAssertions.matches
98
import androidx.test.espresso.matcher.ViewMatchers.*
109
import androidx.test.ext.junit.runners.AndroidJUnit4
1110
import com.cm.payplaza.ecr_sdk_integration.domain.repository.localData.LocalDataRepository
1211
import com.cm.payplaza.ecr_sdk_integration.entity.Transaction
1312
import com.cm.payplaza.ecr_sdk_integration.entity.TransactionError
1413
import com.cm.payplaza.ecr_sdk_integration.entity.TransactionResponse
15-
import com.cm.payplaza.ecr_sdk_integration.fragment.receiptView.ReceiptViewFragment
14+
import com.cm.payplaza.ecr_sdk_integration.fragment.receiptView.ReceiptFragment
1615
import org.junit.After
1716
import org.junit.Before
1817
import org.junit.Test
@@ -24,7 +23,7 @@ import java.util.concurrent.TimeUnit
2423

2524
@RunWith(AndroidJUnit4::class)
2625
class TransactionResultActivityTest: KoinComponent {
27-
private lateinit var fragmentScenario: FragmentScenario<ReceiptViewFragment>
26+
2827
private val localDataRepository: LocalDataRepository by inject()
2928
private val purchaseTransaction: Transaction by inject(qualifier = named("purchaseTransaction"))
3029
private val transactionResultSuccess: TransactionResponse by inject(qualifier = named("transactionResultSuccess"))
@@ -46,13 +45,10 @@ class TransactionResultActivityTest: KoinComponent {
4645

4746
@Test
4847
fun showReceiptFragment() {
49-
fragmentScenario = launchFragmentInContainer()
50-
onView(withId(R.id.receipt_view_close_button)).check(matches(isDisplayed()))
51-
onView(withId(R.id.receipt_view_close_button)).check(matches(isClickable()))
52-
onView(withId(R.id.receipt_view_button_print)).check(matches(isClickable()))
53-
onView(withId(R.id.textview_receipt)).check(matches(isDisplayed()))
54-
Thread.sleep(2000)
55-
onView(withId(R.id.receipt_view_close_button)).perform(ViewActions.click())
48+
val fragmentScenario = launchFragmentInContainer<ReceiptFragment>(
49+
initialState = Lifecycle.State.RESUMED, themeResId = R.style.AppTheme
50+
)
51+
5652
onView(withId(R.id.textview_receipt)).check(matches(isDisplayed()))
5753
Thread.sleep(2000)
5854
}
-5.89 KB
Binary file not shown.
-3 KB
Binary file not shown.
-2.67 KB
Binary file not shown.
-1.19 KB
Binary file not shown.
-3.79 KB
Binary file not shown.

0 commit comments

Comments
 (0)