Skip to main content

xiaobaiauto2是对自动化框架的第三次更新,功能覆盖UI自动化与API自动化意在帮助对自动化有更多需求且过多时间写代码的人群,让大家的时间花在业务的实现上

Project description

简介

xiaobaiauto2是一套自动化框架,功能覆盖UI自动化与API自动化
意在帮助对自动化有更多需求且过多时间写代码的人群,让大家的时间
花在业务的实现上

架构

-------------------------xiaobaiauto2---------------------
                              |
----------------------------------------------------------
|                 |                 |         |         |
定时任务(jenkins)  邮件发送           数据管理   日志内容   测试报告

开始使用

了解测试用例目录

test
|
|--__init__.py
|
|--WebTest 
|   |
|   |--conftest.py
|   |--testCases.py
|
|--APPTest
|   |
|   |--conftest.py
|   |--testCases.py
|
|--APITest
|   |
|   |--testCases.py

了解关键词

序号 CMD key
1 打开网页 URL
2 点击 CLICK
3 输入 SENDKEY
4 刷新页面 REFRESH
5 后退 BACK
6 关闭 CLOSE
7 退出 QUIT
8 标签 CHECKTAG
9 属性[使用属性值定位] CHECKATTR
10 URL CHECKURL
11 标题 CHECKTITLE
12 跳转标签页[序号(1开始)] SWITCHTOWINDOW
13 Alert弹出框-[确定] ALERT0
14 Alert弹出框-[取消] ALERT1
15 Alert弹出框-[输入框] ALERT2
16 Alert弹出框-[文本] ALERT3
17 停止时间 WAIT
18 运行JS脚本 SCRIPT
19 添加cookie COOKIE
20 滑屏 SWIPE
21 截屏 SCREENSHOT

修改脚本

参考testCase_template目录下面的内容
备注
  • 若APP测试需要获取toast信息可以写一个方法添加到自己的项目中,代码样例如下:
    def find_toast(self, message, timeout, poll_frequency):
         new_message = f"//*[@text=\'{message}\']"
         element = WebDriverWait(self.driver, timeout, poll_frequency).until(
             EC.presence_of_element_located((By.XPATH, new_message)))
         return element.text
    

运行脚本

pytest --html=report.html --self-contained-html
or
pytest --html=report.html --self-contained-html -m xiaobai_web
or
pytest --html=report.html --self-contained-html -o log_cli=true -o log_cli_level=INFO

更新日志

版本 功能
0.0.1 添加邮件发送,用例排序,chrome提示框禁止等等
0.1.0.1 添加自动执行任务功能及UI界面

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xiaobaiauto2-0.1.0.1.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xiaobaiauto2-0.1.0.1-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

File details

Details for the file xiaobaiauto2-0.1.0.1.tar.gz.

File metadata

  • Download URL: xiaobaiauto2-0.1.0.1.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.1

File hashes

Hashes for xiaobaiauto2-0.1.0.1.tar.gz
Algorithm Hash digest
SHA256 ef0db92c5b9f2bf7a04a07384b628421da8c1b38b67cf8f1e3acbd1a299ddaf6
MD5 074f46f3a6a9f2d376ce230333ac856b
BLAKE2b-256 6fa2794c6ca9a2f4fb4082cd2294f3ccdf3b2bc334cacdf4d184b4a2480d0edb

See more details on using hashes here.

File details

Details for the file xiaobaiauto2-0.1.0.1-py3-none-any.whl.

File metadata

  • Download URL: xiaobaiauto2-0.1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 35.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.1

File hashes

Hashes for xiaobaiauto2-0.1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d4defbfa7e3c2044c588d511daa6978021bf2b4dfb4ed6238d166a4aa61dd97
MD5 aaa469a03a06c4aa731f046884b1a62f
BLAKE2b-256 5c66ca455675d57006e8bf5ca6742f6fbffd3398e29160c9a8eb32c5720cccd4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page