danielmartins / pyppium

Pyppium is an appium wrapper with focus on cross mobile testing and QA usability.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pyppium

made-with-python codecov Documentation Status GitHub license

Pyppium is a wrapper of Appium-Python-Client for cross mobile testing.

Installation

$ pip install pyppium

Basic Usage

Create your screen like this

from pyppium.fetcher import fetch, iOS, Android


class ScreenOne:
    _button = fetch(iOS("id", "buttonSignIn"), Android("id", "button"))
    _text_field = fetch(iOS("id", "inputUserName"), Android("id", "username"))
    _text_password = fetch(iOS("id", "InputPassword"), Android("id", "pass"))

    def login(self, username, password):
        self._text_field.send_keys(username)
        self._text_password.send_keys(password)
        self._button.click()

    

User your screen in test after start pyppium driver

from pyppium.driver import PyppiumDriver
from tests.e2e.screens.screen import ScreenOne, ScreenTwo
from assertpy import assert_that


def test_android_basic_behaviours():
    username = "Lully"
    password = "123456789"

    caps_android ={
            "platformName": "Android",
            "automationName": "uiautomator2",
            "deviceName": "Android Emulator",
            "appPackage": "com.example.dummy",
            "appActivity": "MainActivity",
            "newCommandTimeout": 0,
    }


    PyppiumDriver(caps_android)
    ScreenOne().login(username, password)
    assert_that(ScreenTwo().label_welcome_message()).contains(username)
    PyppiumDriver.quit()

Documentation

About

Pyppium is an appium wrapper with focus on cross mobile testing and QA usability.

License:MIT License


Languages

Language:Python 100.0%