Appium tests written in Python

Appium tests written in Python are detected by looking for a nose configuration file named nevercode-nosesetup.cfg. You can leave the file empty, but as Nevercode executes your tests using the nose framework, you can set the configuration up according to the official documentation.

Android

Specify the location of your .apk that's going to be tested, this should be the relative path from the test file to the .apk as in the following example:

from appium import webdriver

class AndroidTests(unittest.TestCase):
    def setUp(self):
        desired_caps = {}
        ...
        desired_caps['app'] = os.path.join(
            os.path.dirname(__file__),
            '../../build/outputs/apk/App-greenhouseandroid-debug.apk')
        self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)

iOS

Specify the location of your .app directory that's going to be tested, for this we export an environment variable called NEVERCODE_SYMROOT. This will hold the path of the current build's SYMROOT. Your tests should use this variable as in the following example:

from appium import webdriver

class AndroidTests(unittest.TestCase):
    def setUp(self):
        desired_caps = {}
        ...
        desired_caps['app'] = os.path.join(
            os.environ.get("NEVERCODE_SYMROOT"),
            "Debug-iphonesimulator/greenhouse-ios.app")
        self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)

Example

Example test projects are available for both Android and iOS.

Updated 3 years ago

Appium tests written in Python


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.