Adopt latest Cucumber API interface#11010
Adopt latest Cucumber API interface#11010christian-bromann merged 17 commits intowebdriverio:mainfrom
Conversation
0764ce7 to
1ff7f50
Compare
|
Great to see work on this 👍 personal favorite feature I wanted |
christian-bromann
left a comment
There was a problem hiding this comment.
Fantastic work 👏 do you see anything that could potentially make user tests break after the update?
With these changes, the main area that will be affected is the capability to skip tests based on specific conditions. I believe this feature is widely used by many users. I'm currently working on finding a solution to address this impact and come up with an alternative approach. |
|
Hi @christian-bromann, I've managed to include all the current features in this by adopting the latest version of Cucumber. Kindly take a moment to review and share your thoughts on these updates. |
christian-bromann
left a comment
There was a problem hiding this comment.
Some comments. Overall very happy to see this change 🤩
| 'afterTestCaseHookDefinitionConfigs', | ||
| 'afterTestRunHookDefinitionConfigs', | ||
| ] as const | ||
| const cucumberFormatter = path.resolve(url.fileURLToPath(import.meta.url), '../cucumberFormatter.js') |
There was a problem hiding this comment.
Can we just use a file url string for windows and linux based OS?
| const cucumberFormatter = path.resolve(url.fileURLToPath(import.meta.url), '../cucumberFormatter.js') | |
| const cucumberFormatter = url.pathToFileURL(path.resolve(url.fileURLToPath(import.meta.url), '../cucumberFormatter.js')).href |
There was a problem hiding this comment.
At first, I took the same approach. When we use url.pathToFileURL, the file URL comes with the file:/// prefix with three slashes (///), which works well for Linux-based systems. However, Cucumber internally modifies the provided file URL and raises an error if there are three slashes (///) present on windows.
Upon further investigation, I observed that Cucumber employs the split operation, which creates issues on Windows. As a result, I've explicitly added a double slash prefix to the file path for Windows.
There was a problem hiding this comment.
Sorry this is such a pain point with Cucumber!
I just released 9.5.1 of cucumber-js which includes support for expressing each format as a 1- or 2-item array instead of a string, so it's explicit what is the formatter name/path and (optionally) what is the target and there is no buggy split operation. So with the configuration below it could be something like:
format: [
[cucumberFormatter]
]And that value should be fine as a regular file URL regardless of platform - if you're able to give this a try, let me know how it goes.
Also more generally, feel free to start a thread in cucumber/cucumber-js#2041 with any feedback you have on the new API. I'm conscious that the docs are pretty thin still, so I'm happy to fill any gaps.
There was a problem hiding this comment.
Thanks @davidjgoss for handling this. I'll make the necessary changes and will get in touch if I encounter any issues.
christian-bromann
left a comment
There was a problem hiding this comment.
This is an excellent change set, fantastic job 👍
|
I will look at the Windows test in |
|
@tamil777selvan just letting you know that you have picked up two issues with an |
Proposed changes
These modifications enable the utilisation of the latest Cucumber API interface for execution.
Types of changes
Checklist
Further comments
Reviewers: @webdriverio/project-committers