Coder Social home page Coder Social logo

bipin-mishra1 / python-appium-framework Goto Github PK

View Code? Open in Web Editor NEW

This project forked from prashanth-sams/python-appium-framework

0.0 0.0 0.0 20.05 MB

Complete Python Appium framework in 360 degree

Shell 1.32% Python 65.51% CSS 6.55% HTML 26.62%

python-appium-framework's Introduction

Python Appium Framework

Complete Python Appium framework in 360 degree

Features

  • Locator strategy
  • Hooks (unittest)
  • Helper methods
  • Database connectivity + SSH Tunneling
  • Screenshot on failure
  • Docker support for Android
  • Handle local storage
  • Bash Runner
  • Slack notify
  • Define environment variable
  • HTML report
  • JSON report
  • Allure report
  • CLI arguments as a fixture (Pytest)
  • In-house data storage
  • Logger
  • Runner (Pytest)
  • Runner percentage with style (Pytest)
  • Parallel Tests (Pytest) x2
  • Re-run failures (Pytest)
  • Test script validation

Installation

Install python libraries

pip3 install -r requirements.txt

Test Runner

Action Command
Bash runner bash runner/android/smoke_run.sh
Default python3 -m pytest src/spec/* --app=android
Rerun failures python3 -m pytest src/spec/home_test.py --app=android --reruns 1
Parallel Test python3 -m pytest src/spec/home_test.py --app=android -v -n2

Docker Run

Android test - x1 run

docker run --privileged -d -p 6080:6080 -p 4723:4723 -p 5554:5554 -p 5555:5555 \ 
-v $(pwd)/data/apps/Android-NativeDemoApp-0.2.1.apk:/root/tmp/Android-NativeDemoApp-0.2.1.apk \
-e DEVICE="Samsung Galaxy S9" -e APPIUM=true --name android-container \
budtmo/docker-android-x86-11.0

noVnc interface: http://localhost:6080

Test Report

Type Command
HTML Report python3 -m pytest src/spec/android/*.py --html-report=report/report.html --app=android
JSON Report python3 -m pytest src/spec/android/*.py --json=report/json/report.json --app=android
Allure Report python3 -m pytest src/spec/android/* --alluredir=report --app=android

generate allure report

allure serve report/

Wrapper Methods

Methods Usage
element App.element(self, locator)
elements App.elements(self, locactor)
is_displayed App.is_displayed(self, locator)
is_displayed > elements App.is_displayed(self, locator, index=0)
is_exist App.is_exist(self, locator)
is_exist > elements App.is_exist(self, locator, index=0)
tap App.tap(self, locator)
tap > elements App.tap(self, locator, index=0)
double_tap App.double_tap(self, locator)
double_tap > elements App.double_tap(self, locator, index=0)
click App.click(self, locator)
click > elements App.click(self, locator, index=0)
swipe App.swipe(self, start=locator, dest=locator)
swipe > elements App.swipe(self, start=(locator, 2), dest=(locator, 1))
send_keys App.send_keys(self, locator, 'text')
send_keys > elements App.send_keys(self, locator, 'text', index=0)
get_screen_size App.get_screen_size(self)
back App.back(self)
close App.close(self)
reset App.reset(self)
launch_app App.send_keys(self, locator, 'text'
tap_by_coordinates App.tap_by_coordinates(self, x=338, y=204)
assert_text App.assert_text(self, 'actual', 'expected')
assert_text > elements App.assert_text(self, 'actual', 'expected', index=0)
assert_size App.assert_size(self, locator, 'more than 1')
App.assert_size(self, locator, 'greater than 1')
App.assert_size(self, locator, 'above 1')
App.assert_size(self, locator, '> 1')
App.assert_size(self, locator, 'less than 1')
App.assert_size(self, locator, 'below 1')
App.assert_size(self, locator, '< 1')
App.assert_size(self, locator, 'equal to 1')
App.assert_size(self, locator, '== 1')
assert_boolean App.assert_boolean(True, True)
swipe_until App.swipe_until(self, locator, start_x=144, start_y=434, count=20)

python-appium-framework's People

Contributors

prashanth-sams avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.