Skip to content

Commit

Permalink
Revert "Test adding delay to UI tests"
Browse files Browse the repository at this point in the history
This reverts commit 2e15d2d.
  • Loading branch information
AnasNaouchi committed Nov 1, 2023
1 parent 2e15d2d commit cffff5e
Showing 1 changed file with 5 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,6 @@ class CreditCardActivityTest {
override fun onActivityDestroyed(activity: Activity) {}
}
private val mockClient: Client = mock()
private fun waitMilliseconds(delay: Long) {
try {
Thread.sleep(delay)
} catch (e: InterruptedException) {
// Handle the exception if needed
Thread.currentThread().interrupt()
}
}

@Before
fun setUp() {
Expand Down Expand Up @@ -129,8 +121,7 @@ class CreditCardActivityTest {
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())
// Add a delay before interacting with the dialog
waitMilliseconds(2000)

onView(withId(R.id.country_list))
.inRoot(isDialog())
.perform(
Expand Down Expand Up @@ -174,8 +165,7 @@ class CreditCardActivityTest {
onView(withId(R.id.edit_expiry_date)).perform(typeText("1234"))
onView(withId(R.id.edit_security_code)).perform(typeNumberText("123"))
onView(withId(R.id.edit_country)).perform(scrollTo(), click())
// Add a delay before interacting with the dialog
waitMilliseconds(2000)

onView(withId(R.id.country_list))
.inRoot(isDialog())
.perform(
Expand All @@ -192,8 +182,7 @@ class CreditCardActivityTest {
onView(withId(R.id.edit_expiry_date)).perform(typeText("1234"))
onView(withId(R.id.edit_security_code)).perform(typeNumberText("123"))
onView(withId(R.id.edit_country)).perform(scrollTo(), click())
// Add a delay before interacting with the dialog
waitMilliseconds(2000)

onView(withId(R.id.country_list))
.inRoot(isDialog())
.perform(
Expand All @@ -213,8 +202,7 @@ class CreditCardActivityTest {
onView(withId(R.id.edit_expiry_date)).perform(typeText("1234"))
onView(withId(R.id.edit_security_code)).perform(typeNumberText("123"))
onView(withId(R.id.edit_country)).perform(scrollTo(), click())
// Add a delay before interacting with the dialog
waitMilliseconds(2000)

onView(withId(R.id.country_list))
.inRoot(isDialog())
.perform(
Expand All @@ -234,8 +222,7 @@ class CreditCardActivityTest {
onView(withId(R.id.edit_expiry_date)).perform(typeText("1234"))
onView(withId(R.id.edit_security_code)).perform(typeNumberText("123"))
onView(withId(R.id.edit_country)).perform(scrollTo(), click())
// Add a delay before interacting with the dialog
waitMilliseconds(2000)

onView(withId(R.id.country_list))
.inRoot(isDialog())
.perform(
Expand All @@ -250,8 +237,6 @@ class CreditCardActivityTest {
@Test
fun postTalCode_canTypeAlphabet() {
onView(withId(R.id.edit_country)).perform(scrollTo(), click())
// Add a delay before interacting with the dialog
waitMilliseconds(2000)
onView(withId(R.id.country_list))
.inRoot(isDialog())
.perform(
Expand All @@ -266,8 +251,6 @@ class CreditCardActivityTest {
@Test
fun postTalCode_canTypeStartWithZero() {
onView(withId(R.id.edit_country)).perform(scrollTo(), click())
// Add a delay before interacting with the dialog
waitMilliseconds(2000)
onView(withId(R.id.country_list))
.inRoot(isDialog())
.perform(
Expand All @@ -282,8 +265,6 @@ class CreditCardActivityTest {
@Test
fun state_canTypeWhitespacesApostrophesPeriod() {
onView(withId(R.id.edit_country)).perform(scrollTo(), click())
// Add a delay before interacting with the dialog
waitMilliseconds(2000)
onView(withId(R.id.country_list))
.inRoot(isDialog())
.perform(
Expand Down Expand Up @@ -368,8 +349,6 @@ class CreditCardActivityTest {
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())
// Add a delay before interacting with the dialog
waitMilliseconds(2000)
onView(withId(R.id.country_list))
.inRoot(isDialog())
.perform(
Expand Down

0 comments on commit cffff5e

Please sign in to comment.