Skip to content

Commit

Permalink
Fixed failing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AnasNaouchi committed Oct 30, 2023
1 parent e6eef05 commit 8c006c5
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class CreditCardActivityTest {
fun form_validForm() {
onView(withId(R.id.edit_card_number)).perform(typeText("4242424242424242"))
onView(withId(R.id.edit_card_name)).perform(typeText("John Doe"))
onView(withId(R.id.edit_expiry_date)).perform(typeText("1234"))
onView(withId(R.id.edit_expiry_date)).perform(typeNumberText("1234"))
onView(withId(R.id.edit_security_code)).perform(typeNumberText("123"), pressImeActionButton())

onView(withId(R.id.edit_card_number)).check(matches(withText("4242 4242 4242 4242")))
Expand All @@ -118,7 +118,7 @@ class CreditCardActivityTest {
fun form_validBillingAddressForm() {
onView(withId(R.id.edit_card_number)).perform(typeText("4242424242424242"))
onView(withId(R.id.edit_card_name)).perform(typeText("John Doe"))
onView(withId(R.id.edit_expiry_date)).perform(typeText("1234"))
onView(withId(R.id.edit_expiry_date)).perform(typeNumberText("1234"))
onView(withId(R.id.edit_security_code)).perform(typeNumberText("123"))
onView(withId(R.id.edit_country)).perform(scrollTo(), click())

Expand Down Expand Up @@ -148,7 +148,7 @@ class CreditCardActivityTest {
fun form_invalidForm() {
onView(withId(R.id.edit_card_number)).perform(typeText("1234567890"))
onView(withId(R.id.edit_card_name)).perform(typeText("John Doe"))
onView(withId(R.id.edit_expiry_date)).perform(typeText("1234"))
onView(withId(R.id.edit_expiry_date)).perform(typeNumberText("1234"))
onView(withId(R.id.edit_security_code)).perform(typeNumberText("123"), pressImeActionButton())

onView(withId(R.id.edit_card_number)).check(matches(withText("1234 5678 90")))
Expand Down Expand Up @@ -298,7 +298,7 @@ class CreditCardActivityTest {
whenever(mockClient.send<Token>(any(), any())).doAnswer {}
onView(withId(R.id.edit_card_number)).perform(typeText("4242424242424242"))
onView(withId(R.id.edit_card_name)).perform(typeText("John Doe"))
onView(withId(R.id.edit_expiry_date)).perform(typeText("1234"))
onView(withId(R.id.edit_expiry_date)).perform(typeNumberText("1234"))
onView(withId(R.id.edit_security_code)).perform(typeNumberText("123"), closeSoftKeyboard())
onView(withId(R.id.button_submit)).perform(scrollTo(), click())

Expand All @@ -319,7 +319,7 @@ class CreditCardActivityTest {

onView(withId(R.id.edit_card_number)).perform(typeText("4242424242424242"))
onView(withId(R.id.edit_card_name)).perform(typeText("John Doe"))
onView(withId(R.id.edit_expiry_date)).perform(typeText("1234"))
onView(withId(R.id.edit_expiry_date)).perform(typeNumberText("1234"))
onView(withId(R.id.edit_security_code)).perform(typeNumberText("123"), closeSoftKeyboard())
onView(withId(R.id.button_submit)).perform(scrollTo(), click())

Expand All @@ -346,7 +346,7 @@ class CreditCardActivityTest {

onView(withId(R.id.edit_card_number)).perform(typeText("4242424242424242"))
onView(withId(R.id.edit_card_name)).perform(typeText("John Doe"))
onView(withId(R.id.edit_expiry_date)).perform(typeText("1234"))
onView(withId(R.id.edit_expiry_date)).perform(typeNumberText("1234"))
onView(withId(R.id.edit_security_code)).perform(typeNumberText("123"), closeSoftKeyboard())
onView(withId(R.id.edit_country)).perform(scrollTo(), click())
onView(withId(R.id.country_list))
Expand Down

0 comments on commit 8c006c5

Please sign in to comment.