当前位置: 首页 > news >正文

网站建设可以作为无形资产吗目前我们的网站正在建设中

网站建设可以作为无形资产吗,目前我们的网站正在建设中,免费网站服务商,做房产买卖哪些网站可以获客BDD - Python Behave 配置文件 behave.ini 引言behave.ini配置参数的类型配置项 behave.ini 应用feature 文件step 文件创建 behave.ini执行 Behave查看配置默认值 behave -v 引言 前面文章 《BDD - Python Behave Runner Script》就是为了每次执行 Behave 时不用手动敲一长串… BDD - Python Behave 配置文件 behave.ini 引言behave.ini配置参数的类型配置项 behave.ini 应用feature 文件step 文件创建 behave.ini执行 Behave查看配置默认值 behave -v 引言 前面文章 《BDD - Python Behave Runner Script》就是为了每次执行 Behave 时不用手动敲一长串选项其实还有另外一种实现方式那就是通过配置文件指定 Behave 的命令行参数和设置。今天就来了解一下 Behave 的配置。 想了解更多 Behave 相关的文章欢迎阅读《Python BDD Behave 系列》持续更新中。 behave.ini behave.ini 文件是 Behave 的配置文件用于设置 Behave 命令行选项配置文件必须以标签 “[behave]” 开头。 配置参数的类型 text 文本 将提供的任何文本分配给配置设置 tagssmokebool 布尔值 为配置设置分配一个布尔值。文本描述当值为 true 时的功能。 True 值为 1 “” yes True “和” on 。 False 值为“0”、“no”、“False”和“off”。 dry_run falsesequence 系列文本 字段在新行上接受一个或多个值例如 tags 的配置 tag 带不带 Behave 都无所谓能识别到。 tagsfoo,~barzap相当于 --tags foo,~bar --tagszap 配置项 基本上 Behave 的配置项跟 Behave 命令行选项是对应的但是这里请注意配置项的名字并不是一一对应的具体可参考官方文档 Behave Configuration 例如 命令选项 –dry-run配置项名字却是 dry_run 命令选项 –o 或 --outfile配置项名字却是 outfiles 查看 Behave 命令行选项 执行命令behave -h PS C:\Automation\Test behave -h usage: behave [options] [ [DIR|FILE|FILE:LINE] ]Run a number of feature tests with behave.positional arguments:paths Feature directory, file or file location (FILE:LINE).optional arguments:-h, --help show this help message and exit-c, --no-color Disable the use of ANSI color escapes.--color Use ANSI color escapes. This is the default behaviour. This switch is used to override a configuration file setting.-d, --dry-run Invokes formatters without executing the steps.-D NAMEVALUE, --define NAMEVALUEDefine user-specific data for the config.userdata dictionary. Example: -D foobar to store it in config.userdata[foo].-e PATTERN, --exclude PATTERNDont run feature files matching regular expression PATTERN.-i PATTERN, --include PATTERNOnly run feature files matching regular expression PATTERN.--no-junit Dont output JUnit-compatible reports.--junit Output JUnit-compatible reports. When junit is enabled, all stdout and stderr will be redirected and dumped to the junit report, regardless of the --capture and --no-capture options.--junit-directory PATHDirectory in which to store JUnit reports.-f FORMAT, --format FORMATSpecify a formatter. If none is specified the default formatter is used. Pass --format help to get a list of available formatters. --steps-catalog Show a catalog of all available step definitions. SAME AS:--formatsteps.catalog --dry-run --no-summary -q-k, --no-skipped Dont print skipped steps (due to tags).--show-skipped Print skipped steps. This is the default behaviour. This switch is used to override a configuration file setting.--no-snippets Dont print snippets for unimplemented steps.--snippets Print snippets for unimplemented steps. This is the default behaviour. This switch is used to override a configuration file setting.-m, --no-multiline Dont print multiline strings and tables under steps.--multiline Print multiline strings and tables under steps. This is the default behaviour. This switch is used to override a configuration filesetting.-n NAME, --name NAME Only execute the feature elements which match part of the given name. If this option is given more than once, it will match against all the given names.--no-capture Dont capture stdout (any stdout output will be printed immediately.) --capture Capture stdout (any stdout output will be printed if there is afailure.) This is the default behaviour. This switch is used tooverride a configuration file setting.--no-capture-stderr Dont capture stderr (any stderr output will be printed immediately.) --capture-stderr Capture stderr (any stderr output will be printed if there is afailure.) This is the default behaviour. This switch is used tooverride a configuration file setting.--no-logcapture Dont capture logging. Logging configuration will be left intact. --logcapture Capture logging. All logging during a step will be captured anddisplayed in the event of a failure. This is the default behaviour. This switch is used to override a configuration file setting.--logging-level LOGGING_LEVELSpecify a level to capture logging at. The default is INFO - capturing everything.--logging-format LOGGING_FORMATSpecify custom format to print statements. Uses the same format as used by standard logging handlers. The default is%(levelname)s:%(name)s:%(message)s.--logging-datefmt LOGGING_DATEFMTSpecify custom date/time format to print statements. Uses the same format as used by standard logging handlers.--logging-filter LOGGING_FILTERSpecify which statements to filter in/out. By default, everything is captured. If the output is too verbose, use this option to filter out needless output. Example: --logging-filterfoo will capture statements issued ONLY to foo or foo.what.ever.sub but not foobar or other logger. Specify multiple loggers with comma: filterfoo,bar,baz. If any logger name is prefixed with a minus, eg filter-foo, it will be excluded rather than included.--logging-clear-handlersClear all other logging handlers.--no-summary Dont display the summary at the end of the run.--summary Display the summary at the end of the run.-o FILE, --outfile FILEWrite to specified file instead of stdout.-q, --quiet Alias for --no-snippets --no-source.-s, --no-source Dont print the file and line of the step definition with the steps. --show-source Print the file and line of the step definition with the steps. This is the default behaviour. This switch is used to override a configuration file setting.--stage STAGE Defines the current test stage. The test stage name is used as name prefix for the environment file and the steps directory (instead of default path names).--stop Stop running tests at the first failure.-t TAG_EXPRESSION, --tags TAG_EXPRESSIONOnly execute features or scenarios with tags matching TAG_EXPRESSION. Pass --tags-help for more information.-T, --no-timings Dont print the time taken for each step.--show-timings Print the time taken, in seconds, of each step after the step has completed. This is the default behaviour. This switch is used tooverride a configuration file setting.-v, --verbose Show the files and features loaded.-w, --wip Only run scenarios tagged with wip. Additionally: use the plain formatter, do not capture stdout or logging output and stop at the first failure.-x, --expand Expand scenario outline tables in output.--lang LANG Use keywords for a language other than English.--lang-list List the languages available for --lang.--lang-help LANG List the translations accepted for one language.--tags-help Show help for tag expressions.--version Show version.behave.ini 应用 下面通常简单的实例来应用一下 Behave 的配置项目结构如下 feature 文件 创建 shopping_cart.feature加上一些 tags # shopping_cart.featureFeature: Shopping Cart and Order Processcart smokeScenario: Guest user adds items to the cartGiven the user is on the home pageWhen the user adds an item to the cartThen the user should see the item in the cartcart regressionScenario: Registered user removes items from the cartGiven the user is logged inAnd the user has items in the cartWhen the user removes an item from the cartThen the user should see the updated cartorder smokeScenario: Guest user places an orderGiven the user is on the home pageWhen the user adds an item to the cartAnd the user proceeds to checkoutAnd the user completes the orderThen the user should receive an order confirmationorder regressionScenario: Registered user tracks an orderGiven the user is logged inAnd the user has placed an orderWhen the user checks the order statusThen the user should see the current order statusstep 文件 创建 calculator_steps.py 文件 # calculator_steps.pyfrom behave import given, when, thengiven(the calculator is turned on) def step_calculator_turned_on(context):context.calculator_on True when(I add {num1:d} and {num2:d}) def step_add_numbers(context, num1, num2):context.result num1 num2then(the result should be {expected_result:d}) def step_check_result(context, expected_result):assert context.result expected_result, fActual result: {context.result}, Expected result: {expected_result}创建 behave.ini 这里将配置文件和 feature, steps 文件夹是同级的, 配置了一些常用的 Behave 命令选项 配置 feature 的路径pathsBDD/Features/tag_exampledisable dry-run 执行步骤dry_run false配置标签为 smoke 且 为 cart 的测试用例tagssmoke cart配置 format 为自定义的 my_htmlformat my_html配置输出文件为 my_report.html outfiles my_report.html配置自定义输出格式 my_html [behave.formatters] my_html behave_html_formatter:HTMLFormatter上面就是配置自定义的 my_html 的输出格式是 behave_html_formatter behave.formatters 模块是 Behave 框架中用于处理格式化输出的模块可以自定义。它包含了一些用于定义和管理不同输出格式的类。这些类负责将测试结果以各种方式呈现比如在终端上显示、生成报告文件等。详情请参考 Behave Formatter 所以整个配置内容如下 # behave.ini [behave] pathsBDD/Features/tag_example dry_run false tagssmokecart format my_html outfiles my_report.html[behave.formatters] my_html behave_html_formatter:HTMLFormatter执行 Behave 只需执行命令 behave不用敲那么命令了只有 BDD/Features/tag_example 文件夹下的 标签为 smoke 且为 cart 的测试用例执行了并且生成了自定义的 html 测试报告。 PS C:\Automation\Test behave Feature: Shopping Cart and Order Process # BDD/Features/tag_example/shopping_cart.feature:3cart smokeScenario: Guest user adds items to the cart # BDD/Features/tag_example/shopping_cart.feature:6Given the user is on the home page # BDD/steps/shopping_cart_steps.py:27When the user adds an item to the cart # BDD/steps/shopping_cart_steps.py:40Then the user should see the item in the cart # BDD/steps/shopping_cart_steps.py:61cart regressionScenario: Registered user removes items from the cart # BDD/Features/tag_example/shopping_cart.feature:12Given the user is logged in # NoneAnd the user has items in the cart # NoneWhen the user removes an item from the cart # NoneThen the user should see the updated cart # Noneorder smokeScenario: Guest user places an order # BDD/Features/tag_example/shopping_cart.feature:19Given the user is on the home page # NoneWhen the user adds an item to the cart # NoneAnd the user proceeds to checkout # NoneAnd the user completes the order # NoneThen the user should receive an order confirmation # Noneorder regressionScenario: Registered user tracks an order # BDD/Features/tag_example/shopping_cart.feature:27Given the user is logged in # NoneAnd the user has placed an order # NoneWhen the user checks the order status # NoneThen the user should see the current order status # None1 feature passed, 0 failed, 0 skipped 1 scenario passed, 0 failed, 3 skipped 3 steps passed, 0 failed, 13 skipped, 0 undefined Took 0m0.000s生成了 html 测试报告 查看配置默认值 behave -v 如果您想知道 behave 从哪里获得其配置默认值您可以使用 “-v” 命令行参数它会告诉您。 PS C:\Automation\Test behave -v Loading config defaults from ./behave.ini Using defaults:color Falseshow_snippets Trueshow_skipped Truedry_run Falseshow_source Trueshow_timings Truestdout_capture Truestderr_capture Truelog_capture Truelogging_format %(levelname)s:%(name)s:%(message)slogging_level 20steps_catalog Falsesummary Truejunit Falsestage Noneuserdata {}default_format prettydefault_tags scenario_outline_annotation_schema {name} -- {row.id} {examples.name}format [my_html]outfiles [my_report.html]paths [BDD\\Features\\tag_example]tags [smoke, cart] more_formatters {my_html: behave_html_formatter:HTMLFormatter} Supplied path: BDD\Features\tag_example Trying base directory: C:\Automation\Test\BDD\Features\tag_example Trying base directory: C:\Automation\Test\BDD\Features Trying base directory: C:\Automation\Test\BDD Feature: Shopping Cart and Order Process # BDD/Features/tag_example/shopping_cart.feature:3cart smokeScenario: Guest user adds items to the cart # BDD/Features/tag_example/shopping_cart.feature:6Given the user is on the home page # BDD/steps/shopping_cart_steps.py:27When the user adds an item to the cart # BDD/steps/shopping_cart_steps.py:40Then the user should see the item in the cart # BDD/steps/shopping_cart_steps.py:61cart regressionScenario: Registered user removes items from the cart # BDD/Features/tag_example/shopping_cart.feature:12Given the user is logged in # NoneAnd the user has items in the cart # NoneWhen the user removes an item from the cart # NoneThen the user should see the updated cart # Noneorder smokeScenario: Guest user places an order # BDD/Features/tag_example/shopping_cart.feature:19Given the user is on the home page # NoneWhen the user adds an item to the cart # NoneAnd the user proceeds to checkout # NoneAnd the user completes the order # NoneThen the user should receive an order confirmation # Noneorder regressionScenario: Registered user tracks an order # BDD/Features/tag_example/shopping_cart.feature:27Given the user is logged in # NoneAnd the user has placed an order # NoneWhen the user checks the order status # NoneThen the user should see the current order status # None1 feature passed, 0 failed, 0 skipped 1 scenario passed, 0 failed, 3 skipped 3 steps passed, 0 failed, 13 skipped, 0 undefined Took 0m0.000s
http://www.pierceye.com/news/284519/

相关文章:

  • 易班班级网站建设展示PPTwordpress php 采集器
  • 网站的透明图片怎么做嘉兴网站托管
  • 宝安做棋牌网站建设哪家便宜wordpress 导出html5
  • 网页制作与网站建设的发展趋势设想wordpress必装插件
  • 网站模板下载百度云链接怎么做的学做粤菜的网站
  • 牛栏前网站建设整站优化推广品牌
  • 太原做网站找谁阳江公司做网站
  • 企业网站aspwordpress原生相册
  • 重庆网站建设哪家公司那家好企业宣传软文
  • 如何选择营销网站建设什么网站做优化最好?
  • 个人博客网站模板素材网站的运营方案
  • wordpress增加网站网页关键词jquery验证网站地址
  • 企业招聘网站模板网站页面设计需要遵循的六大原则
  • 网站界面设计说明关键词排名顾问
  • 滨江区网站开发公司贵阳住房和城乡建设局网站
  • 如何建设小网站邢台市天气预报15天
  • 网站收录量低怎么做舟山公司网站制作
  • 部队网站模板计算机网站建设员
  • 对象储存做网站微博内网站怎么做的
  • 运城做网站要多少钱谷歌网站英文
  • 校园网站建设的意见与建议做儿童交互网站
  • 7黄页网站建设网站建设培训会讲话
  • 百度推广公司地址苏州优化方式
  • 做一个电商网站建设银行网站打不开用什么浏览器
  • 保定住房和城乡建设局网站沙洋网站定制
  • 北京电脑培训网站网站首页怎么做全屏swf
  • 网站建设 设计 优化 维护爱站网关键词挖掘工具
  • 做电影收费网站二级域名查询
  • 销售网站模板a5站长网网站交易
  • 网站需要怎么做的吗做营销网站那个好