question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can not use PIPE (|) character in Scenario Outlines

See original GitHub issue

Hello,

As also tried in https://github.com/eerkunt/terraform-compliance/issues/110, we can’t use ( or escape ) PIPE | character within Scenario Outlines.

Example Feature ;

  Scenario Outline: Ensure that my specific tags are defined
    Given I have resource that supports tags defined
    When it contains tags
    Then it must contain <tag_keys>
    And its value must match the "<pattern>" regex

    Examples:
      | tag_keys        | pattern           |
      | BusinessUnit    | ^(IT\|Marketing)$ |

Stack Trace :

Error: Hook 'console_writer_after_each_scenario' from /Users/sharky/Repository/venv3/lib/python3.7/site-packages/radish/extensions/formatters/gherkin.py:425 raised: 'RadishError: Invalid colum_index to get column width for ScenarioOutline 'Ensure that my specific tags are defined''

Traceback (most recent call last):
  File "/Users/sharky/Repository/venv3/lib/python3.7/site-packages/radish/scenariooutline.py", line 126, in get_column_width
    len(self.examples_header[column_index]),
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/.../venv3/lib/python3.7/site-packages/radish/hookregistry.py", line 132, in call
    func(model, *args, **kwargs)
  File "/.../venv3/lib/python3.7/site-packages/radish/extensions/formatters/gherkin.py", line 467, in console_writer_after_each_scenario
    for i, x in enumerate(scenario.example.data)
  File "/...venv3/lib/python3.7/site-packages/radish/extensions/formatters/gherkin.py", line 467, in <genexpr>
    for i, x in enumerate(scenario.example.data)
  File "/.../venv3/lib/python3.7/site-packages/radish/scenariooutline.py", line 131, in get_column_width
    self.sentence
radish.exceptions.RadishError: Invalid colum_index to get column width for ScenarioOutline 'Ensure that my specific tags are defined'

It looks like some frameworks already support this, any chance we can see this support in radish-bdd ?

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
timofurrercommented, Jun 28, 2019

I’ve implemented a fix with f1acaec and I’ll release that asap.

1reaction
timofurrercommented, Jun 28, 2019

Seems like a bug to me. I’ll have a closer look into it this evening. Thanks for reporting it 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Escape pipe character ("|") in scenario outline #333 - GitHub
Hi, is there any way to escape the pipe character in scenario outlines? The sample code below shows the "problem": sample.feature Feature: ...
Read more >
Pipe Character Escape for Gherkin Tables - Automation Panda
“\|” works for both step tables and scenario outline example tables. It looks like it is fairly standard for test frameworks that use...
Read more >
How use pipe character inside Examples table of Behave test ...
As far as I can tell, it is not possible to escape cell delimiters as of version 1.2.5 (current at the time of...
Read more >
[Cucumber:4308] Escaping pipe characters ... - Google Groups
I would like to know if there is an easier way of putting the pipe ( '|' ) character as data in an...
Read more >
[Cucumber:4308] Escaping pipe characters in Scenario ...
I would like to know if there is an easier way of putting the pipe ( '|' ) character as data in an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found