Skip to content

Instantly share code, notes, and snippets.

@jcarlos7121
Created May 24, 2018 16:13
Show Gist options
  • Save jcarlos7121/0cf74b11a09294886c465963e6952103 to your computer and use it in GitHub Desktop.
Save jcarlos7121/0cf74b11a09294886c465963e6952103 to your computer and use it in GitHub Desktop.
var timeOut = (1000 * 60).toLong();
mDevice.wait(Until.findObject(By.clazz(WebView::class.java)), timeOut)
// Set Login
val emailInput = mDevice.findObject(UiSelector()
.instance(0)
.className(EditText::class.java))
emailInput.waitForExists(timeOut)
emailInput.setText("testvoucher123@gmail.com")
// Set Password
val passwordInput = mDevice.findObject(UiSelector()
.instance(1)
.className(EditText::class.java))
passwordInput.waitForExists(timeOut)
passwordInput.setText("cratebind123!")
// Confirm Button Click
val buttonLogin = mDevice.findObject(UiSelector()
.instance(0)
.className<Button>(Button::class.java!!))
buttonLogin.waitForExists(timeOut)
buttonLogin.clickAndWaitForNewWindow()
val buttonOk = mDevice.findObject(UiSelector()
.instance(1)
.className(Button::class.java))
buttonOk.waitForExists(timeOut)
buttonOk.click()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment