-
-
Notifications
You must be signed in to change notification settings - Fork 616
Regex escape quote #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Example: Given John's bag has color "blue" will propose the properly escaped regex '/^John\'s bag has color "([^"]+)"$/'
Member
|
merged in develop branch, thanks! will be in next release! |
wouterj
pushed a commit
to wouterj/Behat
that referenced
this pull request
Jul 1, 2014
Define selenium2 capabilities as strings
pamil
added a commit
that referenced
this pull request
Jun 18, 2020
This PR was merged into the 3.8.x-dev branch.
Discussion
----------
I added "return 0" to fix this error message:
```
$ vendor/bin/behat --debug
behat version 3.7.0
--- configuration
environment variable (BEHAT_PARAMS): none
configuration file: /home/jawira/PhpstormProjects/xxxxxxxx/behat.yml
--- extensions
extensions loaded: api_extension
PHP Fatal error: Uncaught TypeError: Return value of "Behat\Testwork\Cli\DebugCommand::execute()" must be of the type int, NULL returned. in /home/jawira/PhpstormProjects/xxxxxxxx/vendor/symfony/console/Command/Command.php:258
Stack trace:
#0 /home/jawira/PhpstormProjects/xxxxxxxx/vendor/symfony/console/Application.php(912): Symfony\Component\Console\Command\Command->run()
#1 /home/jawira/PhpstormProjects/xxxxxxxx/vendor/symfony/console/Application.php(264): Symfony\Component\Console\Application->doRunCommand()
#2 /home/jawira/PhpstormProjects/xxxxxxxx/vendor/behat/behat/src/Behat/Testwork/Cli/Application.php(124): Symfony\Component\Console\Application->doRun()
#3 /home/jawira/PhpstormProjects/xxxxxxxx/vendor/symfony/console/Application.php(140): Behat\Testwork\Cli\Application->doRun()
#4 /home/jawira/PhpstormProjects/xxxxxxxx/vendor/behat/behat/bin/behat(34): Symfony\Component\Console\Application->run()
#5 {main}
thrown in /home/jawira/PhpstormProjects/xxxxxxxx/vendor/symfony/console/Command/Command.php on line 258
```
Commits
-------
48a3636 Add "return 0" in DebugCommand.php
902b3c6 Add debug test
lorenzodalaqua
referenced
this pull request
in lorenzodalaqua/Behat
Jul 1, 2022
This is applicable to Scenarios which are a part of a Scenario Outline. Each example in an outline would be appended an index to its name in the output (ex: Chekote#1, Chekote#2, Chekote#3...), but in a behat --rerun, they are all appended Chekote#1, which breaks IFT detection. Not having the Example number is the way the script currently expects the output to be, so it was removed.
lorenzodalaqua
referenced
this pull request
in lorenzodalaqua/Behat
Jul 1, 2022
This is applicable to Scenarios which are a part of a Scenario Outline. Each example in an outline would be appended an index to its name in the output (ex: Chekote#1, Chekote#2, Chekote#3...), but in a behat --rerun, they are all appended Chekote#1, which breaks IFT detection. Not having the Example number is the way the script currently expects the output to be, so it was removed.
acoulton
added a commit
to acoulton/Behat
that referenced
this pull request
Oct 27, 2025
Previously, when a feature file contained scenarios with `Example` nodes the junit report would append an index to each testcase name to differentiate them (e.g. `<testcase name="Some scenario outline #1"`, `<testcase name="Some scenario outline Behat#2`, etc). These indices were dynamically generated based on the examples that actually ran. As a result, on a `--rerun` the names would start from `#1` in sequence and be inconsistent with the numbering of the first execution. This makes it difficult to compare reports between each test run, for example to link a passing rerun to the previous failure. With this change, examples are numbered consistently based on the order they appear in the feature file. Additionally, we also now support placeholders in the Scenario Outline title. This allows users to include some or all of the values from the Examples: table in each `<testcase` name for additional clarity. This matches the behaviour of the official cucumber runners. This PR builds on work done by @uuf6429 and in particular the implementation of the numbering & placeholder replacement that he contributed to Behat/Gherkin.
acoulton
added a commit
to acoulton/Behat
that referenced
this pull request
Oct 27, 2025
Previously, when a feature file contained scenarios with `Example` nodes the junit report would append an index to each testcase name to differentiate them (e.g. `<testcase name="Some scenario outline #1"`, `<testcase name="Some scenario outline Behat#2`, etc). These indices were dynamically generated based on the examples that actually ran. As a result, on a `--rerun` the names would start from `#1` in sequence and be inconsistent with the numbering of the first execution. This makes it difficult to compare reports between each test run, for example to link a passing rerun to the previous failure. With this change, examples are numbered consistently based on the order they appear in the feature file. Additionally, we also now support placeholders in the Scenario Outline title. This allows users to include some or all of the values from the Examples: table in each `<testcase` name for additional clarity. This matches the behaviour of the official cucumber runners. This PR builds on work done by @uuf6429 and in particular the implementation of the numbering & placeholder replacement that he contributed to Behat/Gherkin.
acoulton
added a commit
to acoulton/Behat
that referenced
this pull request
Oct 27, 2025
Previously, when a feature file contained scenarios with `Example` nodes the junit report would append an index to each testcase name to differentiate them (e.g. `<testcase name="Some scenario outline #1"`, `<testcase name="Some scenario outline Behat#2`, etc). These indices were dynamically generated based on the examples that actually ran. As a result, on a `--rerun` the names would start from `#1` in sequence and be inconsistent with the numbering of the first execution. This makes it difficult to compare reports between each test run, for example to link a passing rerun to the previous failure. With this change, examples are numbered consistently based on the order they appear in the feature file. Additionally, we also now support placeholders in the Scenario Outline title. This allows users to include some or all of the values from the Examples: table in each `<testcase` name for additional clarity. This matches the behaviour of the official cucumber runners. This PR builds on work done by @uuf6429 and in particular the implementation of the numbering & placeholder replacement that he contributed to Behat/Gherkin.
acoulton
added a commit
that referenced
this pull request
Oct 28, 2025
…it (#1682) Previously, when a feature file contained scenarios with `Example` nodes the junit report would append an index to each testcase name to differentiate them (e.g. `<testcase name="Some scenario outline #1"`, `<testcase name="Some scenario outline #2`, etc). These indices were dynamically generated based on the examples that actually ran. As a result, on a `--rerun` the names would start from `#1` in sequence and be inconsistent with the numbering of the first execution. This makes it difficult to compare reports between each test run, for example to link a passing rerun to the previous failure. With this change, examples are numbered consistently based on the order they appear in the feature file. This fixes #1448. Additionally, we also now support placeholders in the Scenario Outline title. This allows users to include some or all of the values from the Examples: table in each `<testcase` name for additional clarity. This matches the behaviour of the official cucumber runners. This PR builds on work done by @uuf6429 in #1459 and in particular the implementation of the numbering & placeholder replacement that he contributed in Behat/Gherkin#270 and Behat/Gherkin#271.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Escape unmatched single quotes in proposed regex.
Example: Given John's bag has color "blue"
will propose the properly escaped regex '/^John's bag has color "([^"]+)"$/'