当前位置:网站首页>第三方工具与框架集成
第三方工具与框架集成
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安装即可。
边栏推荐
- jdbc_相关代码
- Error [warning] neural network information was performed on socket 'RGB', depth frame is aligned to socket
- WBF:检测任务NMS后虑框新方式?
- JS text particle dynamic background
- [tcapulusdb knowledge base] tcapulusdb doc acceptance - transaction execution introduction
- Sd6.24 summary of intensive training
- Anaconda安装并配置jupyter notebook远程
- The table ‘table_name‘ is full 异常排查及解决方案
- AMAZING PANDAVERSE:META”无国界,来2.0新征程激活时髦属性
- Error building SqlSession问题
猜你喜欢

Cannot retrieve repository metadata processing records

Servlet student management system (Mengxin hands-on version)

Meta agent model can be migrated to resist attacks

Us judge ruled that the former security director of Uber accused of covering up hacking must face fraud charges

Adobe Premiere Basics - common video effects (cropping, black and white, clip speed, mirroring, lens halo) (XV)

Adobe Premiere foundation - sound adjustment (volume correction, noise reduction, telephone tone, pitch shifter, parameter equalizer) (XVIII)

Source code installation mavros

数据仓库模型分层ODS、DWD、DWM实战

《安富莱嵌入式周报》第271期:2022.06.20--2022.06.26

C Primer Plus Chapter 12_ Storage categories, links, and memory management_ Codes and exercises
随机推荐
Shandong University project training (VIII) design rotation map entry page
CentOS 7.5 install MySQL 8.0.27---yum
Travel card "star picking" hot search first! Stimulate the search volume of tourism products to rise
优雅书写Controller(参数验证+统一异常处理)
【TcaplusDB知识库】TcaplusDB单据受理-创建业务介绍
Redis (I) -- getting started with redis (2) -- redis data type
【日常训练】535. TinyURL 的加密与解密
SD6.22集训总结
金鱼哥RHCA回忆录:DO447构建高级作业工作流--创建工作流作业模板并启动工作流作业
jdbc_相关代码
Adobe Premiere Basics - common video effects (cropping, black and white, clip speed, mirroring, lens halo) (XV)
6.29模拟赛总结
Machine learning 8-artificial neural network
Sd6.25 summary of intensive training
[daily training] 535 Encryption and decryption of tinyurl
Know that Chuangyu has helped the energy industry in asset management and was selected into the 2021 IOT demonstration project of the Ministry of industry and information technology
Tag filtering and SQL filtering of rocketmq
MySQL Enterprise Development Specification
2. 在STM32CubeMX建立的Keil5工程中添加自定义的相关文件
mysql — 清空表中数据