GithubHelp home page GithubHelp logo

appium-lich's Introduction

Link

移动端自动化测试系列之一——Appium环境搭建

移动端自动化测试系列之二——pytest入门详解

移动端自动化测试系列之三——Allure测试报告

移动端自动化测试系列之四——生成定位元素

移动端自动化测试系列之五——AppiumLich框架使用

Environment

Python3:

brew install python3
pip3 install <name>
  • Appium-Python-Client
  • Jinja2
  • PyYAML
  • pytest
  • pytest-allure-adaptor
  • watchdog
  • termcolor (not needed)

Appium

npm install -g appium
npm install -g appium-doctor

appium-doctor to ensure your system is set up properly

more

Allure-Commandline

Allure Framework is a flexible lightweight multi-language test report tool with the possibility to add screenshots, logs and so on. It provides modular architecture and neat web reports with the ability to store attachments, steps, parameters and many more.

brew tap qatools/formulas 
brew install allure-commandline

TODO: use Jenkins Plugin

more

Run Test

start appium service:

appium --address 127.0.0.1 --port 4723 --log "log_path" --log-timestamp --local-timezone --session-override

run test:

cd project_path
python3 run.py

Html-Report will be generate on project_path/report/html/index.html

report shot:

Write Test Case

开启watchdog

cd project_path
python3 watch_dog.py

打开 project_path/data/pages.yaml,以下面模板定位元素:

---
LoginPage:
  dec: 登录页面
  locators:
    -
      name: 注册
      timeOutInSeconds: 20
      type: name
      value: 注册

写测试case

class TestLogin:
    def test_login(self, action: ElementActions):
        L.d('test_login')
        account = Steps.get_account()
        action.click(HomePage.登录入口)
        action.text(LoginPage.账户, account[0])
        action.text(LoginPage.密码, account[1])
        action.sleep(1)
        action.click(LoginPage.登录)
        assert action.is_toast_show('欢迎回来')

TODO

  • 兼容iOS
  • 集成 stf

License

MIT

appium-lich's People

Contributors

mio4kon avatar

Watchers

 avatar  avatar  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.