当前位置:网站首页>第三方工具與框架集成
第三方工具與框架集成
2022-06-29 18:56: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安裝即可。
边栏推荐
- Error [warning] neural network information was performed on socket 'RGB', depth frame is aligned to socket
- Dragon canvas animation
- 细说GaussDB(DWS)复杂多样的资源负载管理手段
- postgis 生成 图形切割
- Cannot retrieve repository metadata 处理记录
- [tcapulusdb knowledge base] tcapulusdb operation and maintenance doc introduction
- Interview question 10.10 Rank of digital stream
- JDBC Codes connexes
- Apache inlong million billion level data stream processing
- About microservices
猜你喜欢

Machine learning 8-artificial neural network

garbage collector

2. add customized related files to the keil5 project established by stm32cubemx

jdbc认识上手

MySQL -connector/j driver download

如何使用物联网低代码平台进行服务管理?

Meta agent model can be migrated to resist attacks

面霸篇:MySQL六十六问,两万字+五十图详解!

山东大学项目实训(六)点击事件展示折线图

Request header field XXXX is not allowed by access control allow headers in preflight response
随机推荐
Sword finger offer 34 Path DFS method for binary tree neutralization
Anfulai embedded weekly report no. 271: June 20, 2022 to June 26, 2022
Adobe Premiere Basics - common video effects (cropping, black and white, clip speed, mirroring, lens halo) (XV)
Deep learning --- the weight of the three good students' scores (2)
MySQL enterprise development specification
Machine learning 7-Support vector machine
Anaconda安装并配置jupyter notebook远程
Source code installation mavros
sql server备份以及还原的命令操作
JWT登录验证
Sister Juan takes you to learn database -- 5-day sprint Day1
Redis (I) -- getting started with redis (2) -- redis data type
Elegant writing controller (parameter verification + unified exception handling)
535. encryption and decryption of tinyurl / Jianzhi offer II 103 Minimum number of coins
【日常训练】535. TinyURL 的加密与解密
[tcapulusdb knowledge base] tcapulusdb operation and maintenance doc introduction
Basis of data analysis -- prediction model
markdown常用字体
Selenium WebDriver的高级特性
Apache InLong百万亿级数据流处理