Code Monkey home page Code Monkey logo

automation_test's Introduction

欢迎

##《高效自动化测试平台开发实战》书籍配套代码

该REPO目前包含了书籍中的源码,作为书籍的补充,作者会不定期更新该REPO的代码,增加以及实现更多的功能。

代码部分分别对应了书中介绍的平台模块的主要介绍的功能模块,包括:

-配置管理 core.config -测试资源管理 core.resource -测试结果报告管理 core.result -测试执行引擎 core.testengine

另外thridparty中包括了书中介绍的一些扩展测试方法的代码,比如Selenium封装,测试代码自动生成等。

使用方法

作者目前还在整理部分代码,希望能将该REPO打造成一个可安装的包,目前可能需要读者自行下载并且使用IDE来调试。

推荐IDE:PyCharm

步骤:

  • Clone代码到本地
  • 使用PyCharm打开目录,并且设置虚拟环境
  • 安装requirement.txt中的依赖包
  • userinterface目录中包括了命令行方式以及REST的启动方式

Hello World

###一个基本的执行: 在example目录中有两个基本的演示文件:

demo_list.testlist 包含了一个Hello World的测试用例 (测试列表章节)
resource.json 一个资源配置文件 (资源配置章节)

基本执行

执行 userinterface下的start.py文件

$python3 start.py -s settingfile -t ../example/demo_list.testlist -r ../example/resource.json -u dechen 其中,-s settingfile指定了配置文件的路径,第一次执行会自动建立

如果一切正常,可以看到执行结果。

日志路径

默认情况下,可以看到settingfile目录中,产生了3个setting文件,可以在CaseRunnerSetting中看到,默认情况下的,框架日志路径,测试用例日志路径,以及测试用例配置的默认路径。3。

时间仓促,代码不免有bug,欢迎读者report issue。

如果读者有兴趣参与该项目,也可以和作者联系,提交PR。

automation_test's People

Contributors

dechenx avatar dechenx83 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

automation_test's Issues

执行没有结果

按照read.md操作,没有结果,不知道是不是我的操作问题,作者可以弄一个执行Hello world例子的视频吗?

命令行执行出错

命令行执行出错,提示模块不存在,需要在start.py 中加
import sys
import os
curPath = os.path.abspath(os.path.dirname(file))
rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)

windows环境执行hello word直接报错,是否不支持windows环境下运行哪?

我在windows环境下执行demo用例,直接报错,报错信息如下:
D:\automation_test\userinterface>python start.py -s settingfile -t ../example/demo_list.testlist -r ../example/resource.json -u dechen
Traceback (most recent call last):
File "start.py", line 8, in
from controller.manager import *
File "D:\myrepo\automation_test\userinterface..\controller\manager.py", line 4, in
from core.testengine.caserunner import CaseRunner
File "D:\myrepo\automation_test\userinterface..\core\testengine\caserunner.py", line 13, in
from core.resource.pool import ResourcePool
File "D:\myrepo\automation_test\userinterface..\core\resource\pool.py", line 296, in
class ResourceSetting(SettingBase):
File "D:\myrepo\automation_test\userinterface..\core\resource\pool.py", line 299, in ResourceSetting
resource_path = os.path.join(os.environ['HOME'], "test_resource")
File "C:\Users\Think\AppData\Local\Programs\Python\Python38-32\lib\os.py", line 675, in getitem
raise KeyError(key) from None
KeyError: 'HOME'

测试引擎如何调用其他非Python的测试用例

范例代码中由测试引擎执行的,都是基于Python的测试用例,并且这些测试用例都需要继承TestCaseBase。
如果已经有了一批非Python的测试用例(比如基于jest测试框架的js测试用例),
测试引擎如何实现对这些测试用例的兼容,以便调用这些测试用例。不知道有没有什么推荐的方案呢?谢谢!

代码疑问

请问下这套代码是一个可运行的完整的测试平台吗,请问下书中第12章微服务化的测试平台有代码没呢

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.