cucumber 相关问题

Cucumber是一种行为驱动开发(BDD)工具,它以纯文本(以简单的Gherkin语言结构)编写的功能描述作为自动化测试。

Cucumber html 报告错误未以正确方式显示

我在测试用例失败后启动 Cucumber html 报告,但 html 报告中的错误消息未以正确的方式显示。 所以任何人都可以帮助我解决这个问题。 “脚本”:{ “测试”:&qu...

回答 1 投票 0

如何使用 Capybara 获取元素中的 HTML?

我正在编写一个黄瓜测试,我想在元素中获取 HTML。 例如: 在“表”内做 # 这有效 find('//tr[2]//td[7]').text.should == "这些是注释" #我想要

回答 11 投票 0


Cucumber [错误] 无法解析“node:perf_hooks”

我最近将 cypress 从 9 升级到 11,当我开始使用它时 npx 柏树 打开 运行测试时我没有遇到任何问题。 当我启动它时使用: npx 赛普拉斯运行 它返回给我以下错误...

回答 1 投票 0

behave 无法检测到environment.py 文件

大家好,我正在尝试开发行为框架来自动化一组 API。文件夹结构如下: environment.py 文件包含以下代码: 来自 features.configuration.api_resources 我...

回答 1 投票 0

隐藏未处理异常的所有控制台输出

我捕获所有异常并使用 loguru 记录器记录它们。然后我必须重新引发相同的异常以使该步骤失败并将信息发送到弹性。 从 loguru 导入记录器 @when('某个步骤...'...

回答 1 投票 0

如何测试 Cucumber 中的操作序列?

我看过多个 Cucumber 风格指南,建议在每个场景中使用“仅一个时间”。但是,如果测试需要一系列按时间顺序的步骤怎么办? 这是现实世界的前任...

回答 1 投票 0

使用cypress-cucumber-preprocessor时,如何使用标签来过滤规格和功能?

我有 Cypress 项目设置,这样我就可以一次性编写和运行 Spec 和 Cucumber 测试。 cypress run --spec“cypress/tests/gsac/specs/*.cy.js,cypress/tests/gsac/*.feature” 有效

回答 1 投票 0

尽管已定义,但使用 Examples 关键字时步骤定义仍保持“未定义”

我在我的功能文件中创建了以下场景: 场景概要:用户可以通过选择关联的链接导航到预期的 url 给定的应用程序配置用于测试 ...

回答 1 投票 0

执行黄瓜脚本时浏览器未打开,但脚本通过了

我创建了一个简单的功能,只需启动浏览器,但是,浏览器未启动并且脚本在控制台中显示通过。 特征文件 功能:Flipkart 主页 场景:测试 鉴于

回答 1 投票 0

如何从cypress中的BDD步骤定义文件中的fixture导入json文件

我在 cypress 中有以下文件夹结构。我试图在 BDD 步骤定义中调用对象存储库并测试数据 json 文件,但它不会选择文件。 我在 command.js 中有以下函数...

回答 1 投票 0


点击“重新计算步骤”时,Cucumber 功能文件无法找到粘合代码并抛出错误消息

我目前正在使用 Cucumber 框架创建一个测试套件。我已经为我必须测试的每个功能创建了功能文件。 特征文件从未显示出要满足的条件

回答 3 投票 0

如何将Excel文件转换为黄瓜数据表

嗨,我正在做一个 BDD Cucumber 项目。而不是在 Cucumber 功能文件中提供 DataTable 本身中的数据。我正在尝试传递 Excel 文件位置 我的 Cucumber 功能文件是...

回答 2 投票 0

测试/场景未使用 testng Cucumber 执行

从 TestNG 运行程序类(Testng-Cucumber)执行测试后获得以下输出,但没有执行任何测试 - [RemoteTestNG] 检测到 TestNG 版本 7.4.0 通过:运行场景(“

回答 1 投票 0

无法使用 Testng 运行 Cucumber。但是如果我在功能文件中执行,它就可以工作

在 TestNg Runner 中我没有执行代码,但是使用功能文件我得到了结果 我需要使用 TestNg runner 执行。显示以下错误 [TestNG] 未找到测试。没有运行任何内容 用途: 在 TestNg Runner 中我没有执行代码,但使用功能文件我得到结果 我需要使用 TestNg runner 执行。显示以下错误 [TestNG] No tests found. Nothing was run Usage: <main class> [options] The XML suite files to run Options: -alwaysrunlisteners Should MethodInvocation Listeners be run even for skipped methods Default: true -configfailurepolicy Configuration failure policy (skip or continue) -d Output directory -dataproviderthreadcount Number of threads to use when running data providers -dependencyinjectorfactory The dependency injector factory implementation that TestNG should use. -excludegroups Comma-separated list of group names to exclude -failwheneverythingskipped Should TestNG fail execution if all tests were skipped and nothing was run. Default: false -generateResultsPerSuite Should TestNG consider failures in Data Providers as test failures. Default: false -groups Comma-separated list of group names to be run -ignoreMissedTestNames Ignore missed test names given by '-testnames' and continue to run existing tests, if any. Default: false -includeAllDataDrivenTestsWhenSkipping Should TestNG report all iterations of a data driven test as individual skips, in-case of upstream failures. Default: false -junit JUnit mode Default: false -listener List of .class files or list of class names implementing ITestListener or ISuiteListener -methods Comma separated of test methods Default: [] -methodselectors List of .class files or list of class names implementing IMethodSelector -mixed Mixed mode - autodetect the type of current test and run it with appropriate runner Default: false -objectfactory List of .class files or list of class names implementing ITestRunnerFactory -overrideincludedmethods Comma separated fully qualified class names of listeners that should be skipped from being wired in via Service Loaders. Default: false -parallel Parallel mode (methods, tests or classes) Possible Values: [tests, methods, classes, instances, none] -port The port -propagateDataProviderFailureAsTestFailure Should TestNG consider failures in Data Providers as test failures. Default: false -reporter Extended configuration for custom report listener -spilistenerstoskip Comma separated fully qualified class names of listeners that should be skipped from being wired in via Service Loaders. Default: <empty string> -suitename Default name of test suite, if not specified in suite definition file or source code -suitethreadpoolsize Size of the thread pool to use to run suites Default: 1 -testclass The list of test classes -testjar A jar file containing the tests -testname Default name of test, if not specified in suitedefinition file or source code -testnames The list of test names to run -testrunfactory, -testRunFactory The factory used to create tests -threadcount Number of threads to use when running tests in parallel -threadpoolfactoryclass The threadpool executor factory implementation that TestNG should use. -usedefaultlisteners Whether to use the default listeners Default: true -log, -verbose Level of verbosity -xmlpathinjar The full path to the xml file inside the jar file (only valid if -testjar was specified) Default: testng.xml 要通过 TestNG 运行 Cucumber 功能,请确保完成以下步骤: 包含 Cucumber-testNG 依赖项:https://mvnrepository.com/artifact/io.cucumber/cucumber-testng Cucumber runner 类已创建,例如: package testrunners; import io.cucumber.testng.AbstractTestNGCucumberTests; import io.cucumber.testng.CucumberOptions; @CucumberOptions( features = "src/test/resources/features", glue = {"stepdefinitions"}, plugin = { "pretty", "json:cucumber.json" } ) public class TestRunner extends AbstractTestNGCucumberTests {} 该类必须扩展 AbstractTestNGCucumberTests 类 src/test/resources/features 是包含 .feature 文件的文件夹的路径 stepdefinitions 是包的名称,其中包含已实现步骤的代码的类。 TestNG XML 运行上述步骤中的 Cucumber 运行程序类,例如: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="Default Suite" configfailurepolicy="continue" time- out="60000"> <test name="Main tests"> <classes> <class name="testrunners.TestRunner"/> </classes> </test> </suite> 通过此设置,您应该能够运行 TestNG XML,它将执行位于指定文件夹中的所有 .feature 文件中的所有场景。

回答 1 投票 0

如何为python的behave(cucumber)中的某个功能创建临时目录?

我正在尝试对一些使用 Cucumber 进行测试的 ruby 代码进行 python 移植。我正在尝试在新端口中使用完全相同的功能文件。其中一个功能看起来有点像: 特点:...

回答 1 投票 0

cucumber.runtime.DuplicateStepDefinitionException:

你好,我是黄瓜和硒的新手。我正在尝试使用多个黄瓜功能文件执行我的 Maven 项目。但是当我执行以下错误时,我得到了。 黄瓜.运行时。

回答 3 投票 0

ruby cucumber 如何使用黄瓜表达式让不同的步骤调用相同的定义

说我想要 给定一些东西 当天空蔚蓝时 而且草是绿的 那我就开心了 但我想要 当('天空是蓝色的')做 写“好” 结尾 和 When('草是绿的') 做 写“好” 结尾 成为

回答 1 投票 0

空手道无法在 jar 应用程序中找到功能文件

我正在尝试使用 karate runner 从 REST 控制器类调用执行一些功能文件(功能文件与应用程序 jar 文件捆绑在一起)。在服务课上,我使用空手道跑步者来运行...

回答 2 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.