Created
November 5, 2017 23:07
-
-
Save hyperh/f5e940e94633b82090da47f88ca7e3f9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
import os | |
from appium import webdriver | |
AWS = 'aws' | |
LOCAL = 'local' | |
def get_desired_capabilities(location=AWS): | |
if location == LOCAL: | |
return { | |
'app': os.path.expanduser( | |
'./android/app/build/outputs/apk/app-debug.apk'), | |
'platformName': 'Android', | |
'deviceName': 'Android Emulator' | |
} | |
else: | |
return {} | |
@pytest.fixture(scope="function") | |
def driver(): | |
driver = webdriver.Remote( | |
command_executor='http://127.0.0.1:4723/wd/hub', | |
desired_capabilities=get_desired_capabilities( | |
location=os.environ.get('LOCATION') | |
) | |
) | |
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