Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ allprojects {
mavenLocal()

}

project.version = "1.0.0-beta03-SNAPSHOT";
project.version = "1.0.0-beta03-SNAPSHOT"
}

task clean(type: Delete) {
Expand Down
4 changes: 2 additions & 2 deletions ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dependencies {
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "androidx.recyclerview:recyclerview:1.0.0"

api 'com.hyperwallet.android:core-sdk:1.0.0-beta02'
api "com.hyperwallet.android:core-sdk:1.0.0-beta03-SNAPSHOT"

androidTestImplementation "androidx.test.ext:junit:1.1.0"
androidTestImplementation "androidx.test:runner:1.1.1"
Expand All @@ -61,7 +61,7 @@ dependencies {
androidTestImplementation "com.squareup.leakcanary:leakcanary-android-instrumentation:1.6.3"
androidTestImplementation "com.squareup.leakcanary:leakcanary-support-fragment:1.6.3"

testImplementation group: 'org.mockito', name: 'mockito-core', version: "2.23.4"
testImplementation group: 'org.mockito', name: 'mockito-core', version: "2.25.0"
testImplementation group: 'pl.pragmatists', name: 'JUnitParams', version: "1.1.1"
testImplementation "org.robolectric:robolectric:4.1"
testImplementation "com.squareup.okhttp3:mockwebserver:3.11.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void testAddTransferMethod_accountDetailsHiddenOnEmptyFeeAndProcessingRes
@Test
public void testAddTransferMethod_displaysErrorDialogOnDuplicateAccountFailure() {
mMockWebServer.mockResponse().withHttpResponseCode(HTTP_OK).withBody(sResourceManager
.getResourceContent("successful_tmc_fields_response.json")).mock();
.getResourceContent("successful_tmc_fields_bank_account_response.json")).mock();
mMockWebServer.mockResponse().withHttpResponseCode(HTTP_BAD_REQUEST).withBody(sResourceManager
.getResourceContent("bank_account_duplicate_routing_response.json")).mock();

Expand Down Expand Up @@ -159,7 +159,7 @@ public void testAddTransferMethod_displaysErrorDialogOnDuplicateAccountFailure()
@Test
public void testAddTransferMethod_displaysUnexpectedErrorDialogOnException() {
mMockWebServer.mockResponse().withHttpResponseCode(HTTP_OK).withBody(sResourceManager
.getResourceContent("successful_tmc_fields_response.json")).mock();
.getResourceContent("successful_tmc_fields_bank_account_response.json")).mock();
mMockWebServer.mockResponse().withHttpResponseCode(HTTP_BAD_REQUEST).withBody(sResourceManager
.getResourceContent("invalid_json_response.json")).mock();

Expand Down Expand Up @@ -189,7 +189,7 @@ public void testAddTransferMethod_displaysUnexpectedErrorDialogOnException() {
@Test
public void testAddTransferMethod_displaysNetworkErrorDialogOnConnectionTimeout() throws IOException {
mMockWebServer.mockResponse().withHttpResponseCode(HTTP_OK).withBody(sResourceManager
.getResourceContent("successful_tmc_fields_response.json")).mock();
.getResourceContent("successful_tmc_fields_bank_account_response.json")).mock();

mActivityTestRule.launchActivity(null);

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import static androidx.test.espresso.action.ViewActions.typeText;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withParent;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
Expand Down Expand Up @@ -35,6 +36,7 @@
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.espresso.IdlingRegistry;
import androidx.test.espresso.matcher.ViewMatchers;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.rule.ActivityTestRule;

Expand Down Expand Up @@ -98,7 +100,7 @@ public void setup() {
mMockWebServer.mockResponse().withHttpResponseCode(HTTP_OK).withBody(sResourceManager
.getResourceContent("authentication_token_response.json")).mock();
mMockWebServer.mockResponse().withHttpResponseCode(HTTP_OK).withBody(sResourceManager
.getResourceContent("successful_tmc_bank_card_fields_response.json")).mock();
.getResourceContent("successful_tmc_fields_bank_card_response.json")).mock();
}

@After
Expand All @@ -124,12 +126,14 @@ public void testAddTransferMethod_displaysElementsOnTmcResponse() {
matches(withText(R.string.title_add_bank_card)));

onView(withId(R.id.cardNumber)).check(matches(isDisplayed()));
onView(withId(R.id.cardNumberLabel)).check(matches(isDisplayed()));
onView(withId(R.id.cardNumberLabel)).check(matches(withHint(CARD_NUMBER_LABEL)));
onView(withId(R.id.dateOfExpiry)).check(matches(isDisplayed()));
onView(withId(R.id.dateOfExpiryLabel)).check(matches(isDisplayed()));
onView(withId(R.id.dateOfExpiryLabel)).check(matches(withHint(EXPIRY_DATE_LABEL)));
onView(withId(R.id.cvv)).check(matches(isDisplayed()));
onView(withId(R.id.cvvLabel)).check(
matches(withHint(CVV_LABEL)));
onView(withId(R.id.cvvLabel)).check(matches(isDisplayed()));
onView(withId(R.id.cvvLabel)).check(matches(withHint(CVV_LABEL)));

onView(withId(R.id.add_transfer_method_button)).perform(nestedScrollTo()).check(
matches(withText(R.string.button_create_transfer_method)));
Expand All @@ -139,11 +143,21 @@ public void testAddTransferMethod_displaysElementsOnTmcResponse() {
public void testAddTransferMethod_displaysFeeElementsOnTmcResponse() {
mActivityTestRule.launchActivity(null);

onView(withId(R.id.add_transfer_method_static_container)).check(
matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));

onView(withId(R.id.add_transfer_method_fee_label)).check(
matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));
onView(withId(R.id.add_transfer_method_fee_label)).check(
matches(withText(R.string.add_transfer_method_fee_label)));
onView(withId(R.id.add_transfer_method_processing_label)).check(
matches(withText(R.string.add_transfer_method_processing_time_label)));
onView(withId(R.id.add_transfer_method_fee_value)).check(matches(withText("USD 1.75")));

//TODO: Uncomment when processing time node is implemented
// onView(withId(R.id.add_transfer_method_processing_label)).check(
// matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));
// onView(withId(R.id.add_transfer_method_processing_label)).check(
// matches(withText(R.string.add_transfer_method_processing_time_label)));
// onView(withId(R.id.add_transfer_method_fee_value)).check(matches(withText("1 - 2 Business Days")));
}

@Test
Expand Down Expand Up @@ -211,11 +225,11 @@ public void testAddTransferMethod_returnsErrorOnInvalidPresence() {
onView(withId(R.id.add_transfer_method_button)).perform(nestedScrollTo(), click());

onView(withId(R.id.cardNumberLabel))
.check(matches(hasErrorText("You must provide a value for this field.")));
.check(matches(hasErrorText("You must provide a value for this field")));
onView(withId(R.id.dateOfExpiryLabel))
.check(matches(hasErrorText("You must provide a value for this field.")));
.check(matches(hasErrorText("You must provide a value for this field")));
onView(withId(R.id.cvvLabel))
.check(matches(hasErrorText("You must provide a value for this field.")));
.check(matches(hasErrorText("You must provide a value for this field")));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.RootMatchers.isDialog;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withParent;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
Expand Down Expand Up @@ -37,6 +38,7 @@
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.espresso.IdlingRegistry;
import androidx.test.espresso.matcher.ViewMatchers;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.rule.ActivityTestRule;

Expand Down Expand Up @@ -88,7 +90,7 @@ public void setup() {
mMockWebServer.mockResponse().withHttpResponseCode(HTTP_OK).withBody(sResourceManager
.getResourceContent("authentication_token_response.json")).mock();
mMockWebServer.mockResponse().withHttpResponseCode(HTTP_OK).withBody(sResourceManager
.getResourceContent("successful_tmc_paypal_fields_response.json")).mock();
.getResourceContent("successful_tmc_fields_paypal_response.json")).mock();
}

@After
Expand All @@ -114,6 +116,7 @@ public void testAddTransferMethod_displaysElementsOnTmcResponse() {
matches(withText(R.string.paypal_account)));

onView(withId(R.id.email)).check(matches(isDisplayed()));
onView(withId(R.id.emailLabel)).check(matches(isDisplayed()));
onView(withId(R.id.emailLabel)).check(matches(withHint("Email")));

onView(withId(R.id.add_transfer_method_button)).perform(nestedScrollTo()).check(
Expand All @@ -124,12 +127,22 @@ public void testAddTransferMethod_displaysElementsOnTmcResponse() {
public void testAddTransferMethod_displaysFeeElementsOnTmcResponse() {
mActivityTestRule.launchActivity(null);

onView(withId(R.id.add_transfer_method_static_container)).check(
matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));

onView(withId(R.id.add_transfer_method_fee_label)).check(
matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));
onView(withId(R.id.add_transfer_method_fee_label)).check(
matches(withText(R.string.add_transfer_method_fee_label)));
onView(withId(R.id.add_transfer_method_processing_label)).check(
matches(withText(R.string.add_transfer_method_processing_time_label)));
onView(withId(R.id.add_transfer_method_fee_value)).check(matches(withText("USD 0.25")));
onView(withId(R.id.add_transfer_method_processing_time_value)).check(matches(withText("IMMEDIATE")));

//TODO: Uncomment when processing time node is implemented
// onView(withId(R.id.add_transfer_method_processing_label)).check(
// matches(withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE)));
// onView(withId(R.id.add_transfer_method_processing_label)).check(
// matches(withText(R.string.add_transfer_method_processing_time_label)));
// onView(withId(R.id.add_transfer_method_fee_value)).check(matches(withText("IMMEDIATE")));

}

@Test
Expand Down Expand Up @@ -178,7 +191,7 @@ public void testAddTransferMethod_returnsErrorOnInvalidPattern() {
onView(withId(R.id.add_transfer_method_button)).perform(nestedScrollTo(), click());

onView(withId(R.id.emailLabel))
.check(matches(hasErrorText("accountNumber is invalid")));
.check(matches(hasErrorText("is invalid length or format.")));
}

@Test
Expand Down
Loading