SHARE
TWEET

TC

a guest Jun 18th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package uk.co.footballindex.ui.splash
  2.  
  3. import android.os.Build
  4. import androidx.test.filters.SdkSuppress
  5. import com.schibsted.spain.barista.assertion.BaristaEnabledAssertions.assertDisabled
  6. import com.schibsted.spain.barista.assertion.BaristaVisibilityAssertions.assertDisplayed
  7. import com.schibsted.spain.barista.interaction.BaristaClickInteractions.clickOn
  8. import com.schibsted.spain.barista.interaction.BaristaEditTextInteractions.writeTo
  9. import com.schibsted.spain.barista.interaction.BaristaListInteractions.clickListItem
  10. import org.junit.Test
  11. import uk.co.footballindex.R
  12. import java.util.*
  13.  
  14. class SignUpTest : BaseInstrumentationTest() {
  15.     @Test
  16.     fun testSignUp() {
  17.         activityRule.launchActivity()
  18.  
  19.         clickOn(R.id.buttonJoinOnboarding)
  20.  
  21.         assertDisabled(R.id.buttonNext)
  22.         clickListItem(R.id.recyclerListCountry, 0)
  23.         clickOn(R.id.buttonNext)
  24.  
  25.         assertDisabled(R.id.buttonNext)
  26.         val firstName = "Ffd"
  27.         writeTo(R.id.textFieldFirstName, firstName)
  28.  
  29.         assertDisabled(R.id.buttonNext)
  30.         val lastName = "Ftyy"
  31.         writeTo(R.id.textFieldSurname, lastName)
  32.         clickOn(R.id.buttonNext)
  33.  
  34.         clickOn(R.id.buttonNext)
  35.  
  36.         writeTo(R.id.textFieldPostCode, "dh22bl")
  37.         clickOn(R.id.buttonFindAddress)
  38.         clickListItem(R.id.recyclerListAddress, 0)
  39.         clickOn(R.id.buttonNext)
  40.  
  41.         assertDisabled(R.id.buttonNext)
  42.         clickOn(R.id.cb_email)
  43.         clickOn(R.id.switchTerms)
  44.         clickOn(R.id.buttonNext)
  45.  
  46.         assertDisabled(R.id.buttonNext)
  47.         val randomGenerator = Random()
  48.         val randomInt = randomGenerator.nextInt(1000)
  49.         writeTo(R.id.textFieldRegisterEmail, "username$randomInt@gmail.com")
  50.         writeTo(R.id.textFieldRegisterNumber, "07911 123456")
  51.         writeTo(R.id.textFieldRegisterPassword, "00000000")
  52.         writeTo(R.id.textFieldRegisterConfirmPassword, "00000000")
  53.         clickOn(R.id.buttonNext)
  54.  
  55.         clickOn(R.id.buttonWebDone)
  56.  
  57.         assertDisplayed(R.id.topText, "Please set the pin code for simple access to Football INDEX later")
  58.     }
  59.  
  60.     @Test
  61.     @SdkSuppress(maxSdkVersion = Build.VERSION_CODES.M)
  62.     fun testSignUpOldDevice() {
  63.         activityRule.launchActivity()
  64.  
  65.         clickOn(R.id.buttonJoinOnboarding)
  66.  
  67.         assertDisabled(R.id.buttonNext)
  68.         clickListItem(R.id.recyclerListCountry, 0)
  69.         clickOn(R.id.buttonNext)
  70.  
  71.         assertDisabled(R.id.buttonNext)
  72.         val firstName = "Fgu"
  73.         writeTo(R.id.textFieldFirstName, firstName)
  74.  
  75.         assertDisabled(R.id.buttonNext)
  76.         val lastName = "Ftyy"
  77.         writeTo(R.id.textFieldSurname, lastName)
  78.         clickOn(R.id.buttonNext)
  79.  
  80.         clickOn(R.id.buttonNext)
  81.  
  82.         writeTo(R.id.textFieldPostCode, "dh22bl")
  83.         clickOn(R.id.buttonFindAddress)
  84.         clickListItem(R.id.recyclerListAddress, 0)
  85.         clickOn(R.id.buttonNext)
  86.  
  87.         assertDisabled(R.id.buttonNext)
  88.         clickOn(R.id.cb_email)
  89.         clickOn(R.id.switchTerms)
  90.         clickOn(R.id.buttonNext)
  91.  
  92.         assertDisabled(R.id.buttonNext)
  93.         val randomGenerator = Random()
  94.         val randomInt = randomGenerator.nextInt(1000)
  95.         writeTo(R.id.textFieldRegisterEmail, "username$randomInt@gmail.com")
  96.         writeTo(R.id.textFieldRegisterNumber, "07911 123456")
  97.         writeTo(R.id.textFieldRegisterPassword, "00000000")
  98.         writeTo(R.id.textFieldRegisterConfirmPassword, "00000000")
  99.         clickOn(R.id.buttonNext)
  100.  
  101.         clickOn(android.R.id.button1)
  102.  
  103.         assertDisplayed(R.id.topText, "Please set the pin code for simple access to Football INDEX later")
  104.     }
  105. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top