gherkin

Howto to write a step implementation that supports multiple words

家住魔仙堡 提交于 2021-02-10 16:22:46
问题 Example Gherkin # Gherkin snip When waiting for 30 seconds # or When waiting for 5 s I want to implement above steps in one step definition. I tried the following step implementation. from behave import * use_step_matcher("re") @when(u"waiting for (?P<time>\d+) (s|seconds)") def step_impl(context, time): pass When running this results in this error: TypeError: step_impl() got multiple values for keyword argument 'time' Behave extracts it as a parameter. What's a good practice for doing this?

Howto to write a step implementation that supports multiple words

断了今生、忘了曾经 提交于 2021-02-10 16:22:08
问题 Example Gherkin # Gherkin snip When waiting for 30 seconds # or When waiting for 5 s I want to implement above steps in one step definition. I tried the following step implementation. from behave import * use_step_matcher("re") @when(u"waiting for (?P<time>\d+) (s|seconds)") def step_impl(context, time): pass When running this results in this error: TypeError: step_impl() got multiple values for keyword argument 'time' Behave extracts it as a parameter. What's a good practice for doing this?

Assertion Issue of jsonpath response

不羁岁月 提交于 2021-02-10 06:45:27
问题 I'm writing api test automated codes with bdd method by Karate. Assertion part pushes me hard. My response is like below, and when I called that path $.data.subscribers[0].products this gives me empty-null array as I checked by http://jsonpath.herokuapp.com/ website. However, when I run my gherkin Karate feature then It gave me the response as null, It still gives me error assertion. It says actual: null, expected: null... I couldn't see any error, how can I fix this? Is it a bug or Is there

Sharing a common set of Examples across multiple Scenario Outlines in Specflow

故事扮演 提交于 2021-02-07 11:31:49
问题 Is is possible to share a common set of examples across multiple scenario outlines in Specflow without duplicating the set of examples for each outline? e.g. excuse the noddy example, but here the Examples are repeated for each Scenario Outline and I want to know if it's possible to declare those Examples once and use them for each Scenario Outline ? Feature: Just an example about animals Scenario Outline: Given an <animal> When something happens Then this should be the outcome Examples: |

Question about Karate test case for POST method

◇◆丶佛笑我妖孽 提交于 2021-02-05 08:16:41
问题 I have an endpoint URL, within Swagger I must pass certain fields to test the POST method. I was wondering if anyone had an example of how to set up a Karate test for a POST method? 回答1: Yes, there are plenty in the documentation: https://github.com/intuit/karate If you follow the quickstart, you will get a sample project with a working POST: https://github.com/intuit/karate#quickstart Scenario: create a user and then get it by id * def user = """ { "name": "Test User", "username": "testuser"

Question about Karate test case for POST method

五迷三道 提交于 2021-02-05 08:16:27
问题 I have an endpoint URL, within Swagger I must pass certain fields to test the POST method. I was wondering if anyone had an example of how to set up a Karate test for a POST method? 回答1: Yes, there are plenty in the documentation: https://github.com/intuit/karate If you follow the quickstart, you will get a sample project with a working POST: https://github.com/intuit/karate#quickstart Scenario: create a user and then get it by id * def user = """ { "name": "Test User", "username": "testuser"

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

SpecFlow equivalent to parameterized test fixture

别来无恙 提交于 2021-01-28 10:34:04
问题 I’m using SpecFlow to write a set of tests, and I’d like to run each test multiple times, with different input data. I could do this with scenario outlines, but I want to run every scenario in the feature file with the same test cases. I know I can use the Background to share the setup for one case, but I’m looking for something like a cross between Background and Scenario Outline, where I can supply a table of data to the Background and run the entire feature file once per row. In NUnit, I’d

SpecFlow equivalent to parameterized test fixture

陌路散爱 提交于 2021-01-28 10:32:09
问题 I’m using SpecFlow to write a set of tests, and I’d like to run each test multiple times, with different input data. I could do this with scenario outlines, but I want to run every scenario in the feature file with the same test cases. I know I can use the Background to share the setup for one case, but I’m looking for something like a cross between Background and Scenario Outline, where I can supply a table of data to the Background and run the entire feature file once per row. In NUnit, I’d

SpecFlow equivalent to parameterized test fixture

荒凉一梦 提交于 2021-01-28 10:22:26
问题 I’m using SpecFlow to write a set of tests, and I’d like to run each test multiple times, with different input data. I could do this with scenario outlines, but I want to run every scenario in the feature file with the same test cases. I know I can use the Background to share the setup for one case, but I’m looking for something like a cross between Background and Scenario Outline, where I can supply a table of data to the Background and run the entire feature file once per row. In NUnit, I’d