当前位置:网站首页>Third party tools and framework integration
Third party tools and framework integration
2022-06-29 18:57:00 【It's Joe Joe】
Introduction to agile development testing concept
BDD: Behavior driven development , Also known as acceptance test driven development (ATDD). Based on users Story Agile testing or instantiation requirements .
CI: Continuous integration framework
be based on BDD Test tools
python Many of the tools in can implement BDD, There are two main tools Behave and Lettuce.
Behave
pip install behave
To write feature Document principles :GWT(Given-When-Then)
- Given: Set the preconditions for the execution of a scenario
- When: Contains the operations to be performed by a scenario
- Then: Contains the results of a scenario execution
notes : A scene can have multiple when and then.
step Definition
feature File scene outline step It needs to be defined separately .
step The definition file is saved in feature Subdirectory of the path where the file is located steps Next .
for example :
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
Environment configuration
function feature Before , You need to create an environment configuration file , To configure Behave Common configuration , as well as step Between or step Define shared code between files .
Usually in feature Create a new environment configuration file in the file directory environment.py, add to before_all() and after_all() Method , These two methods are respectively in feature Run before and after execution .
from selenium import webdriver
def before_all(context):
context.driver = webdriver.Chrome()
def after_all(context):
context.driver.quit()
perform behave
Get into bbd Under the document , And then execute “behave” command .
Behave Show results at three levels . Namely feature、scenario and step The number of passes and failures at each level .
Continuous integration Jenkins
Jekins yes Java Write continuous integration (CI) service , Come of Hudson project .
The service support includes git、SVN And other version control tools .
Jekins In addition to building software functions 、 It can also be used to build an automated test environment .
install Jenkins
Jenkins Installation package download address :https://www.jenkins.io/download/
Click on next Can be installed .
边栏推荐
- 程序员值得收藏的几款代码截图美化工具播
- Adobe Premiere foundation - batch material import sequence - variable speed and rewind (recall) - continuous action shot switching - subtitle requirements (13)
- 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
- Us judge ruled that the former security director of Uber accused of covering up hacking must face fraud charges
- 山东大学项目实训(七)添加导航栏选择城市
- The 8th "Internet +" competition - cloud native track invites you to challenge
- PHP implementation of sorting two-dimensional arrays by specified key names
- Mac: MySQL 66 questions, 20000 words + 50 pictures!
- SD6.25集训总结
- Selenium的各类API方法
猜你喜欢

centos 7.5安装mysql 8.0.27----yum

UnrealEngine插件中使用protobuf 链接mysql

Leetcode 984. String without AAA or BBB (thought of netizens)

对强缓存和协商缓存的理解

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

JDBC knowledge

Shandong University project training (VII) add navigation bar to select city

Apache Doris basic usage summary

Cannot retrieve repository metadata processing records

These advantages of the Institute are really fragrant! The landing rate is still very high!
随机推荐
如何使用物联网低代码平台进行服务管理?
山东大学项目实训(六)点击事件展示折线图
Cannot retrieve repository metadata processing records
Failed to allocate graph: myriad device is not opened
garbage collector
《安富莱嵌入式周报》第271期:2022.06.20--2022.06.26
对强缓存和协商缓存的理解
What is a multi paradigm programming language and what does "multi paradigm" mean?
CentOS 7.5 install MySQL 8.0.27---yum
PHP 输出两个指定日期之间的所有日期
PHP implementation of sorting two-dimensional arrays by specified key names
6.29 simulation summary
数据分析--时间序列预测
How to use the low code platform of the Internet of things for service management?
Fastdfs
2. add customized related files to the keil5 project established by stm32cubemx
SD6.22集训总结
These advantages of the Institute are really fragrant! The landing rate is still very high!
Page Object与数据驱动测试
Us judge ruled that the former security director of Uber accused of covering up hacking must face fraud charges