cucumber-jvm

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

Global hooks in Serenity BDD

感情迁移 提交于 2020-12-13 11:09:06
问题 I was trying to implement global hooks in serenity-bdd project. As I browse through found below links and none of them worked for me. Some of them not specific to Serenity-BDD though. package mypackage; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import net.serenitybdd.cucumber.CucumberWithSerenity; @RunWith(CucumberWithSerenity.class) @CucumberOptions( features = "src/test/resources/features", glue = {"MyProj.cucumber.stepdefinition"}, public class MyTest { @Before

Global hooks in Serenity BDD

痴心易碎 提交于 2020-12-13 11:08:27
问题 I was trying to implement global hooks in serenity-bdd project. As I browse through found below links and none of them worked for me. Some of them not specific to Serenity-BDD though. package mypackage; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import net.serenitybdd.cucumber.CucumberWithSerenity; @RunWith(CucumberWithSerenity.class) @CucumberOptions( features = "src/test/resources/features", glue = {"MyProj.cucumber.stepdefinition"}, public class MyTest { @Before

Global hooks in Serenity BDD

旧街凉风 提交于 2020-12-13 11:08:07
问题 I was trying to implement global hooks in serenity-bdd project. As I browse through found below links and none of them worked for me. Some of them not specific to Serenity-BDD though. package mypackage; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import net.serenitybdd.cucumber.CucumberWithSerenity; @RunWith(CucumberWithSerenity.class) @CucumberOptions( features = "src/test/resources/features", glue = {"MyProj.cucumber.stepdefinition"}, public class MyTest { @Before

Karate: how to pass dynamic path parameters?

妖精的绣舞 提交于 2020-12-13 07:20:23
问题 Suppose I have test scenario with exact same requirements but one path variable change as follows: Scenario: Some scenario Given path /mypath/param1 When method get Then status 200 I need to run the same test for /mypath/param2, /mypath/param3 as well. Is there a simpler way to do it without requiring to separate the feature into a separate file and using data driven test? 回答1: Yes, use the Scenario Outline which is a standard Cucumber pattern. Scenario Outline: Some scenario Given path