Skip to content

Instantly share code, notes, and snippets.

@hyperh
Created November 5, 2017 22:39
Show Gist options
  • Save hyperh/73f0ee8e44efc4c789b25874de5c4290 to your computer and use it in GitHub Desktop.
Save hyperh/73f0ee8e44efc4c789b25874de5c4290 to your computer and use it in GitHub Desktop.
import pytest
import os
from appium import webdriver
@pytest.fixture(scope="function")
def driver():
driver = webdriver.Remote(
command_executor='http://127.0.0.1:4723/wd/hub',
desired_capabilities={
'app': os.path.expanduser(
'./android/app/build/outputs/apk/app-debug.apk'),
'platformName': 'Android',
'deviceName': 'Android Emulator'
})
yield driver # Test code runs after this line
# Teardown
driver.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment