File tree Expand file tree Collapse file tree 2 files changed +48
-1
lines changed
Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Unreleased
1111- Use `gherkin-official ` parser to replace custom parsing logic. This will make pytest-bdd more compatible with the Gherkin specification.
1212- Multiline steps must now always use triple-quotes for the additional lines.
1313- All feature files must now use the keyword `Feature: ` to be considered valid.
14- - Tags can no longer have spaces (e.g. "@tag one" "@tag two" are no longer valid).
14+ - Tags can no longer have spaces (e.g. "@tag one" and "@tag two" are no longer valid).
1515- Tags can now be on multiple lines (stacked)
1616
17177.3.0
Original file line number Diff line number Diff line change @@ -219,3 +219,50 @@ def _(string):
219219 r"bork \\" ,
220220 r"bork \\|" ,
221221 ]
222+
223+
224+ def test_forward_slash_in_params (pytester ):
225+ """Test parametrised scenario when the parameter contains a slash, such in a URL."""
226+
227+ pytester .makefile (
228+ ".feature" ,
229+ outline = textwrap .dedent (
230+ """\
231+ Feature: Outline
232+ Scenario Outline: Outlined with slashes
233+ Given I am in <Country>
234+ Then I visit <Site>
235+
236+ Examples:
237+ | Country | Site |
238+ | US | https://my-site.com |
239+
240+ """
241+ ),
242+ )
243+ pytester .makeconftest (textwrap .dedent (STEPS ))
244+
245+ pytester .makepyfile (
246+ textwrap .dedent (
247+ """\
248+ from pytest_bdd import given, parsers, scenarios, then
249+ from pytest_bdd.utils import dump_obj
250+
251+ scenarios('outline.feature')
252+
253+
254+ @given(parsers.parse("I am in {country}"))
255+ def _(country):
256+ pass
257+
258+
259+ @then(parsers.parse("I visit {site}"))
260+ def _(site):
261+ dump_obj(site)
262+
263+ """
264+ )
265+ )
266+ result = pytester .runpytest ("-s" )
267+ result .assert_outcomes (passed = 1 )
268+ assert collect_dumped_objects (result ) == ["https://my-site.com" ]
You can’t perform that action at this time.
0 commit comments