cucumber

TestNG with Cucumber

那年仲夏 提交于 2021-02-19 08:43:06
问题 I am running cucumber with testNG. CucumberRunner class extends AbstractTestNGCucumberTests and CucumberRunner class is specified in testNG.xml file. If I run a simple TestNG class with testNG.xml then output for testNG results gets displayed in console i.e Total tests run, Failures, Skips as shown below:- Test.java package com.cucumber.test; import org.testng.Assert; public class Test { @org.testng.annotations.Test public void test() { Assert.assertEquals(true, true); } } testNG.xml:- <

No tasks available when executing JUnit runner class

廉价感情. 提交于 2021-02-17 21:10:16
问题 I am trying to run Cucumber feature files in IntelliJ. Cucumber Options is pointing to the right folder, but I get the "No tasks available" notification when trying to execute the JUnit runner class. What am I doing wrong? Here is my build.gradle : plugins { id 'java' } sourceCompatibility = 1.8 apply plugin: 'java' repositories { mavenCentral() } compileJava.options.encoding = "UTF-8" dependencies { compile 'org.codehaus.groovy:groovy-all:2.3.11' testCompile group: 'junit', name: 'junit',

No tasks available when executing JUnit runner class

≡放荡痞女 提交于 2021-02-17 21:10:12
问题 I am trying to run Cucumber feature files in IntelliJ. Cucumber Options is pointing to the right folder, but I get the "No tasks available" notification when trying to execute the JUnit runner class. What am I doing wrong? Here is my build.gradle : plugins { id 'java' } sourceCompatibility = 1.8 apply plugin: 'java' repositories { mavenCentral() } compileJava.options.encoding = "UTF-8" dependencies { compile 'org.codehaus.groovy:groovy-all:2.3.11' testCompile group: 'junit', name: 'junit',

does not have a matching glue code in Groovy-cucumber

人走茶凉 提交于 2021-02-17 05:52:50
问题 I'm using cucumber-groovy with maven based framework and unable to find the glue to stepDefinitions. Getting does not have a matching glue code in feature file. It is in Cucumber-maven Project. I have converted the Feature folder to 'Source folder'. Error : Unable to create src/test/groovy & src/test/resource (to use as feature's folder) Here is my Test Runner CucumberOptions: @CucumberOptions( features = ["src/test/resources/"], glue = ["com.esw.taa.avs.steps"], plugin = ["html:esw-tests

Cucumber Test execution for gradle project via command line using tags for cucumber feature files

为君一笑 提交于 2021-02-16 20:22:05
问题 I am looking to execute a cucumber test for a gradle project via command line using specific feature tags. The command I am using : gradle test -DCucumber.options="-tags @tagname" Command does execute the tags mentioned. I have tried using gradle test -DCucumber.options="-tags @tagname" and also gradle test .I didn't find any difference in both the command. gradle test -DCucumber.options="-tags @tagname" : Executes the Runtest.java and tags mentioned in this file, irrespective of what feature

How to resolve java.lang.NullPointerException in Selenium with Cucumber?

a 夏天 提交于 2021-02-16 15:09:26
问题 Register.feature Feature: The Registration Page Background: Given The User is on the Registration Page Scenario: The User Should be able to Register When The User Enters Contact Information And The User Enters Mailing Information When The User Enters User Information ReisterSteps.java public class RegisterSteps { public WebDriver driver; @Given("^The User is on the Registration Page$") public void the_User_is_on_the_Registration_Page() throws Throwable { System.out.println("Background:- The

How to use typescript Path aliases in Cucumber?

雨燕双飞 提交于 2021-02-11 12:28:33
问题 I need to use Cucumber in a project that uses path aliasing. As soon as I would import one of the path aliased modules, I get an error I have tried solution in this answer, but I am running into another problem: Whenever I use the --require-module tsconfig-paths/register \ part, I suddenly get TypeError: cucumber_1.Given is not a function error whenever I try to run the features. (The error changes to TypeError: Given is not a function when I use the const { Given } = require('cucumber')

How to identify a particular Page Object fragment member element through Selenium

淺唱寂寞╮ 提交于 2021-02-10 12:53:01
问题 In our project we have multiple selenium tests run with cucumber which are testing specific components. One of these components are two identifiers, which we call country identifier and site identifier. These have the following HTML: <div class="identifiers"> <div class="country-identifier"> <span class="ident-label"> Germany </span> </div> <div class="site-identifier"> <span class="ident-label"> Gaming </span> </div> </div> Now our tests have two models, one for each identifier: @PageObject

possible values for @CucumberOptions(plugin = …)

*爱你&永不变心* 提交于 2021-02-10 05:47:11
问题 I am using @CucumberOptions(plugin = {"pretty"} for test report in cucumber but the default colors for this are really bad..so I am looking to change the font color in output report. Anyone as any idea..how proceed further? 回答1: For console colors see Console-Colours. For reports you can specify that the report be output in JSON and then pass the generated JSON to a custom formatter. See Custom-Formatters. BTW, this is how TeamCity creates its reports. Here is an example of generating both

找不到 cucumber.api.cli.Main 的报错解决方案

耗尽温柔 提交于 2021-02-09 11:34:09
最近玩IDEA,发现导入的项目有问题,报了一个“找不到或者不存在cucumber.api.cli.Main”的错误。 后来发现是新版的IDEA在导入时没有提示,以至于我没有配置项目对应的Tomcat 服务器 ,如上图所示,IDEA错误的给项目配置了一个主类。于是就报错了。 解决方案: 首先点击Run > Edit Configurations > 左上角的 + 号 > Tomcat server > local 一般也不用修改啥配置,直接点击保存即可,然后运行就没问题了 点击“+”添加项目下“WEB-INF”所在目录,在右边的“Application context”里配置“/项目名”。然后点击应用(apply),最后点击OK,就可以了。 这一切搞定后,项目就可以启动了。 来源: oschina 链接: https://my.oschina.net/u/4267186/blog/3620685