当前位置:网站首页>第三方工具与框架集成
第三方工具与框架集成
2022-06-29 18:29:00 【是乔乔啊】
敏捷开发测试概念介绍
BDD:行为驱动开发,也称验收测试驱动开发(ATDD)。基于用户Story 敏捷测试或实例化需求。
CI:持续集成框架
基于BDD的测试工具
python中很多工具可以实现BDD,有两个主要的工具是Behave和Lettuce。
Behave
pip install behave
编写feature文件原则:GWT(Given-When-Then)
- Given:设置一个场景执行的前提条件
- When:包含一个场景所要执行的操作
- Then:包含一个场景执行后的结果
注:一个场景可以有多个when和then。
step定义
feature文件场景大纲中的step需要分别进行定义。
step定义文件保存在feature文件所在路径的子目录steps下。
例如:
from behave import *
@given('I am on home page')
def step_i_am_on_home_page(context):
context.driver.get("http://demo.magentocommerce.com
/")
@when('I search for {text}')
def step_i_search_for(context, text):
search_field = context.driver.find_element_by_name(
"q")
search_field.clear()
# enter search keyword and submit
search_field.send_keys(text)
search_field.submit()
@then('I should see list of matching products in search
results')
def step_i_should_see_list(context):
products = context.driver.\
find_elements_by_xpath("//h2[@class='product-nam
e']/a")
# check count of products shown in results
assert len(products) > 0
环境配置
运行feature之前,需要创建一个环境配置文件,配置Behave常用配置,以及step之间或step定义文件之间的共享代码。
通常在feature文件目录中新建一个环境配置文件environment.py,添加before_all()和after_all()方法,这两个方法分别在feature执行前和结束后运行。
from selenium import webdriver
def before_all(context):
context.driver = webdriver.Chrome()
def after_all(context):
context.driver.quit()
执行behave
进入bbd文件下,然后执行“behave”命令。
Behave显示三个级别的结果。分别是feature、scenario和step各级别通过和失败的数量。
持续集成Jenkins
Jekins是Java编写的持续集成(CI)服务,起源于Hudson项目。
该服务支持包括git、SVN等各种版本控制工具。
Jekins除了构建软件功能外、还可以用于搭建自动化测试环境。
安装Jenkins
Jenkins安装包下载地址:https://www.jenkins.io/download/
点击next安装即可。
边栏推荐
- 源码安装MAVROS
- [tcapulusdb knowledge base] tcapulusdb doc acceptance - transaction execution introduction
- Shandong University project training (VIII) design rotation map entry page
- 美法官裁定,被控掩盖黑客行为的Uber前安全主管必须面对欺诈指控
- 2. 在STM32CubeMX建立的Keil5工程中添加自定义的相关文件
- C Primer Plus Chapter 12_ Storage categories, links, and memory management_ Codes and exercises
- Fastdfs
- Svg circle drawing path animation
- 报错Failed to allocate graph: MYRIAD device is not opened.
- SD6.22集训总结
猜你喜欢

Mac: MySQL 66 questions, 20000 words + 50 pictures!

Up to 81.98%! Announcement of undergraduate study rate of more than 100 "double first-class" Universities

How to use the oak camera on raspberry pie?

Failed to allocate graph: myriad device is not opened

svg画圆路径动画

山东大学项目实训(八)设计轮播图进入页面

Source code installation mavros

How to use the low code platform of the Internet of things for service management?

C Primer Plus Chapter 12_ Storage categories, links, and memory management_ Codes and exercises

JDBC Codes connexes
随机推荐
深度学习---三好学生各成绩所占权重问题(2)
MySQL Enterprise Development Specification
Adobe Premiere基础-不透明度(蒙版)(十一)
JS converts seconds to "2h30min50s" format
6.29 simulation summary
SD6.24集训总结
BeanUtils属性复制的用法
The table ‘table_name‘ is full 异常排查及解决方案
C Primer Plus 第12章_存储类别、链接和内存管理_代码和练习题
How to use an oak camera as a webcam?
Data analysis time series prediction
Data warehouse model layered ODS, DWD, DWM practice
熊猫跑酷js小游戏代码
Sd6.22 summary of intensive training
如何将OAK相机当做网络摄像头使用?
Adobe Premiere foundation - material nesting (animation of Tiktok ending avatar) (IX)
Adobe Premiere Basics - common video effects (cropping, black and white, clip speed, mirroring, lens halo) (XV)
Sd6.25 summary of intensive training
Programmer Resource Recommendation Guide
WBF: new method of NMS post filter frame for detection task?