cucumber-java

Refer defined variable in Scenario outline example

半腔热情 提交于 2021-02-16 21:01:13
问题 Feature: Test Type Background: * url host * def name = 'test_name' * def label = name Scenario Outline: Test 2 Given url homeLinks.groupTypesUrl And headers { tenant: #(tenantId), Authorization: #(authToken) } * def name = <name> * def description = <description> * def label = <label> * json data = read('path/to/file/create_group_type_request.json') And request data When method POST Then status 400 Examples: | name | label | description | | '\u0000' | 'label' | 'description' | | #(name) | '

Refer defined variable in Scenario outline example

冷暖自知 提交于 2021-02-16 21:01:02
问题 Feature: Test Type Background: * url host * def name = 'test_name' * def label = name Scenario Outline: Test 2 Given url homeLinks.groupTypesUrl And headers { tenant: #(tenantId), Authorization: #(authToken) } * def name = <name> * def description = <description> * def label = <label> * json data = read('path/to/file/create_group_type_request.json') And request data When method POST Then status 400 Examples: | name | label | description | | '\u0000' | 'label' | 'description' | | #(name) | '

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

Combine Multiple json results in one, updated Cucumber-JVM Report

走远了吗. 提交于 2021-02-07 08:21:34
问题 I have two runners in my automation project as follows: Main runner - Executes all the @ui-test tagged test cases and if a scenario is failed target/rerun.txt will be populated with the scenario location (e.g. features/Dummy.feature:22 ): @RunWith(Cucumber.class) @CucumberOptions( features = "classpath:features", plugin = {"pretty", "html:target/cucumber-html-report", "json:target/cucumber.json", "rerun:target/rerun.txt"}, tags = {"@ui-test", "~@ignore"} ) public class RunCukesTest { }

Combine Multiple json results in one, updated Cucumber-JVM Report

元气小坏坏 提交于 2021-02-07 08:15:23
问题 I have two runners in my automation project as follows: Main runner - Executes all the @ui-test tagged test cases and if a scenario is failed target/rerun.txt will be populated with the scenario location (e.g. features/Dummy.feature:22 ): @RunWith(Cucumber.class) @CucumberOptions( features = "classpath:features", plugin = {"pretty", "html:target/cucumber-html-report", "json:target/cucumber.json", "rerun:target/rerun.txt"}, tags = {"@ui-test", "~@ignore"} ) public class RunCukesTest { }

Is there any way to display all the APIs called for a scenario in Cucumber Report?

天涯浪子 提交于 2021-01-29 10:15:49
问题 I am developing a Test Automation using Rest-Assured Cucumber and generating the report using net.masterthought report plugin. Everything works fine, but now I want to display all the GET/POST/PUT/DELETE resource called during the test in any place/page of the report. Can anyone give any idea how can I accomplish this? Thanks, Surodip 来源: https://stackoverflow.com/questions/61344107/is-there-any-way-to-display-all-the-apis-called-for-a-scenario-in-cucumber-repor

I need to have an gradle task to execute my cucumber runner class and execute cucumber tets

匆匆过客 提交于 2021-01-29 06:39:48
问题 I have my Cucumber Runner class as shown below and i need to call and run this runner class through gradle so that in turn it executes my stepdefinition / tests as we do it in normal cucumber project import java.io.File; import java.io.IOException; import org.apache.commons.io.FileUtils; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeSuite; import com.inspire.brands.helper.reporter.ReporterUtil; import io.cucumber.testng.AbstractTestNGCucumberTests; import io

cucumber.runtime.CucumberException: java.util.regex.PatternSyntaxException: Illegal repetition near index 39

99封情书 提交于 2021-01-29 04:03:59
问题 Facing some repetition errors after running tests from Java class I have tried to change/update my steps and runner file but unfortunately this did not help to solve my problem. I'm quite new in cucumber and maven so if the information that I've provided is less please let me know. Feature file 1: Feature: Login into account Existing user should be able to login account using correct credentials Scenario: Login into account with correct credentials Given User navigates to stackoverflow

Cucumber tags as TestNG group in QAF and Spring boot environment

时光总嘲笑我的痴心妄想 提交于 2021-01-28 08:58:21
问题 I have 4 tests in a feature file with 2 different tags @first and @then. I would like @first tests to run first with parallelism and @then tests to run after all @first tests finished, with parallelism too. The project is here : https://github.com/marcesso/qafTesting @CucumberOptions(plugin = {"com.qmetry.qaf.automation.cucumber.QAFCucumberPlugin", "pretty", "html:target"}, /*tags = {"@Ignore"},*/ features = {"src/test/resources/my/custom/packagename/testing"}) public class RunnerTest extends

Can you save a result (Given) to a variable in a Gherkin feature file, and then compare the variable with another result (Then)? (Cucumber for Java)

 ̄綄美尐妖づ 提交于 2021-01-28 08:58:10
问题 I am new to Cucumber for Java and trying to automate testing of a SpringBoot server backed by a MS SQL Server. I have an endpoint "Get All Employees". Writing the traditional feature file, I will have to list all the Employees in the @Then clause. This is not possible with thousands of employees. So I just want to get a row count of the Employee table in the database, and then compare with the number of objects returned from the "Get All Employees" endpoint. Compare SELECT count(*) from