How to handle transitions with Appium


I’m currently trying to find an element after page transition. However the following methods don’t seem to work for me.
using driver.sleep, and setImplicitWaitTimeout don’t seem to work for this specific cause.

Genymotion is showing the proper ui, and the server logs are showing the timeouts are still triggering after the page has loaded.

Has anyone else encountered this problem? How did you solve it? Cheers.

import wd from 'wd'

const PORT = 4723
const config = {
  platformName: 'Android',
  deviceName: 'Android Emulator',
  app: './e2e/apk/android%2F@visylvius%2Fprogressly-99436ac4-085e-11e8-8e43-0a580a78271a-signed.apk' // relative to root of project

const driver = wd.promiseChainRemote('localhost', PORT)

beforeAll(async () => {
  await driver.init(config)
  await driver.sleep(2000) // wait for app to load

test('app renders', async () => {
  expect(await driver.hasElementByAccessibilityId('email-input')).toBe(true)
  expect(await driver.hasElementByAccessibilityId('password-input')).toBe(true)
  expect(await driver.hasElementByAccessibilityId('login-button')).toBe(true)
  expect(await driver.hasElementByAccessibilityId('notthere')).toBe(false)

test('will fill out the email input', async function () {
  const element = driver.elementByAccessibilityId('email-input')
  await element.clear()
  await element.sendKeys('[email protected]')
  const resultText = await element.text()
  const userName = '[email protected]'

test('will fill out the password input', async () => {
  const element = await driver.elementByAccessibilityId('password-input')
  await element.clear()
  await element.sendKeys('stuff')
  const resultText = await element.text()
  const password = ''

test('login button will be clicked', async () => {
  const element = await driver.elementByAccessibilityId('login-button')

test('create execution button will be clicked', async () => {
  await driver.sleep(20000)
  await driver.setImplicitWaitTimeout(20000)
  const element = await driver.elementByAccessibilityId('create-execution-e1153fe2-cedb-4a1d-b800-689ae0951576')