Skip to content

Commit

Permalink
chore(E2E Test): Add Thread.sleep to improve test stability
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexei Thornber committed Nov 11, 2024
1 parent 85d6c88 commit 76c8c8e
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ class EndToEndTest {

}

@Test
fun deleteUserAuth(){
flushAuthenticationClients()
}

@Test
fun testUserCanLoginAndCreateAnAccount() {
flushAuthenticationClients()
Expand All @@ -90,14 +85,16 @@ class EndToEndTest {

composeTestRule.onNodeWithTag("WelcomeButton").performClick()

Thread.sleep(5000)

/** Verify the email */

val emailVerificationUrl = getLatestEmailVerificationUrl()
verifyEmail(emailVerificationUrl)


// This sleep is required to wait for the email verification to complete
Thread.sleep(10000)
Thread.sleep(5000)


/** Refresh the email verification and continue */
Expand All @@ -122,13 +119,14 @@ class EndToEndTest {
composeTestRule.onNodeWithTag(AccountDetailsTestTags.CONTINUE_BUTTON).performClick()

// Wait until "HomeScreen" is displayed
composeTestRule.waitForIdle()
Thread.sleep(5000)
composeTestRule.onNodeWithTag(HomeTestTags.SCREEN).isDisplayed()

/** Navigate to the profile screen */
composeTestRule.onNodeWithTag("My Profile").performClick()

composeTestRule.waitForIdle()
Thread.sleep(5000)

composeTestRule.onNodeWithTag("UserProfileScreen").assertIsDisplayed()
composeTestRule.onNodeWithTag("UserProfileName").assertTextContains("$FIRST_NAME $LAST_NAME")
composeTestRule.onNodeWithTag("UserProfileBiography").assertTextContains(BIOGRAPHY)
Expand Down Expand Up @@ -196,7 +194,7 @@ class EndToEndTest {
}

companion object {
const val EMAIL = "alexeithornber@gmail.com"
const val EMAIL = "ishinzqyR6S@gmail.com"
const val PWD = "123456"

const val FIRST_NAME = "Alexei"
Expand Down

0 comments on commit 76c8c8e

Please sign in to comment.