Skip to content

Conversation

@naholyr
Copy link
Contributor

@naholyr naholyr commented Mar 7, 2011

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 "([^"]+)"$/'

Example: Given John's bag has color "blue"
will propose the properly escaped regex '/^John\'s bag has color "([^"]+)"$/'
@everzet
Copy link
Member

everzet commented Mar 19, 2011

merged in develop branch, thanks!

will be in next release!

@everzet everzet closed this Mar 19, 2011
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants