Skip to content

Conversation

carlos-granados
Copy link
Contributor

If your feature or context files are located in some subfolders, for example tests/behat/features and src/behat, it is not very informative if these folders are always printed when printing paths and you may prefer to remove them, so that for example instead of

Scenario: # tests/behat/features/users/login.feature:3

you see

Scenario: # users/login.feature:3

This PR adds a new removePrefix option to the configurable path printer that allows you to define a list of prefixes that need to be removed from paths when printing them. This affects only the visible paths, not the ones used in the editorUrl. This option is available in the command line (where the prefixes need to be comma separated), the yaml config and the php config

These prefixes are removed in the order in which they are defined, so you need to list more specific prefixes first

Copy link
Contributor

@acoulton acoulton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlos-granados this looks great, thanks - no comments from me. It will be super helpful!

Very sorry that I didn't notice this originally, you should have poked me sooner :)

@acoulton acoulton merged commit 2f9e2d4 into Behat:master Jul 15, 2025
19 checks passed
@carlos-granados carlos-granados deleted the remove-prefix branch August 16, 2025 08:08
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