cucumber-java

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:41:47
问题 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

Pass POJOs in Cucumber Example table

北战南征 提交于 2021-01-28 04:16:53
问题 Description: As a test developer, I would like to use a single scenario to test 3 different environments. Simplified Scenario example: @smoke Scenario: Login to the login page and assert that the user is logged in Given User navigates to the page And User enters valid login credentials When User clicks on the login button Then Landing page can be seen Data ( These are grabbed from a property file - converted to POJO ) : Env1.class url = www.environment1.com username = john password = doe1

Cucumber : How to read examples from external excel file for Scenarios Outline

南楼画角 提交于 2021-01-02 11:55:32
问题 My requirement is to read examples from external excel file rather than hard code it into feature file. I have more than 100 examples which is difficult to maintain in feature file. Can you please help me on this. Here is my scenario - Scenario Outline: Browser Test When I visit the URL <base>/<page>/<ordNumber>/<custName> Then the browser contains test <custNumber> Examples: | base | page | ordNumber | custName | | http://www.stackoverflow.com | orders | 123 | John | | http://www

Cucumber : How to read examples from external excel file for Scenarios Outline

戏子无情 提交于 2021-01-02 11:51:25
问题 My requirement is to read examples from external excel file rather than hard code it into feature file. I have more than 100 examples which is difficult to maintain in feature file. Can you please help me on this. Here is my scenario - Scenario Outline: Browser Test When I visit the URL <base>/<page>/<ordNumber>/<custName> Then the browser contains test <custNumber> Examples: | base | page | ordNumber | custName | | http://www.stackoverflow.com | orders | 123 | John | | http://www

Cucumber : How to read examples from external excel file for Scenarios Outline

試著忘記壹切 提交于 2021-01-02 11:50:40
问题 My requirement is to read examples from external excel file rather than hard code it into feature file. I have more than 100 examples which is difficult to maintain in feature file. Can you please help me on this. Here is my scenario - Scenario Outline: Browser Test When I visit the URL <base>/<page>/<ordNumber>/<custName> Then the browser contains test <custNumber> Examples: | base | page | ordNumber | custName | | http://www.stackoverflow.com | orders | 123 | John | | http://www

Cucumber : How to read examples from external excel file for Scenarios Outline

◇◆丶佛笑我妖孽 提交于 2021-01-02 11:50:21
问题 My requirement is to read examples from external excel file rather than hard code it into feature file. I have more than 100 examples which is difficult to maintain in feature file. Can you please help me on this. Here is my scenario - Scenario Outline: Browser Test When I visit the URL <base>/<page>/<ordNumber>/<custName> Then the browser contains test <custNumber> Examples: | base | page | ordNumber | custName | | http://www.stackoverflow.com | orders | 123 | John | | http://www

Cucumber : How to read examples from external excel file for Scenarios Outline

烂漫一生 提交于 2021-01-02 11:50:21
问题 My requirement is to read examples from external excel file rather than hard code it into feature file. I have more than 100 examples which is difficult to maintain in feature file. Can you please help me on this. Here is my scenario - Scenario Outline: Browser Test When I visit the URL <base>/<page>/<ordNumber>/<custName> Then the browser contains test <custNumber> Examples: | base | page | ordNumber | custName | | http://www.stackoverflow.com | orders | 123 | John | | http://www

How can gets all tags and cucumber scenarios without run tests

与世无争的帅哥 提交于 2020-12-31 04:32:14
问题 I would like somehow get list of all tags which I used in my project and get all names of cucumber scenarios which I have in my project without run tests. Could someone helps me how can I do this? 回答1: As suggested by @mpkorstanje you can create a custom plugin for this. public class DryRunPlugin implements EventListener { @Override public void setEventPublisher(EventPublisher publisher) { publisher.registerHandlerFor(TestCaseStarted.class, this::handleCaseStarted); } private void

Extentreport support for Cucumber-JVM 4.0 (io.cucumber)

两盒软妹~` 提交于 2020-12-06 15:44:18
问题 I am trying to migrate my Cucumber automation project from cucumber (info.cukes ) to cucumber (io.cucumber) During this process, i having trouble with migrating extend reports. Could you please help me with what I am missing? dependency: <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>io.cucumber</groupId> <artifactId>cucumber-java</artifactId> <version>4.2.6</version> <scope>test</scope> <

Extentreport support for Cucumber-JVM 4.0 (io.cucumber)

流过昼夜 提交于 2020-12-06 15:38:17
问题 I am trying to migrate my Cucumber automation project from cucumber (info.cukes ) to cucumber (io.cucumber) During this process, i having trouble with migrating extend reports. Could you please help me with what I am missing? dependency: <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>io.cucumber</groupId> <artifactId>cucumber-java</artifactId> <version>4.2.6</version> <scope>test</scope> <