- WebdriverIO version: v8 (Previous version v7 doesn’t add URI path to the file. I think it’s coming from changes in Node.js 18)
- Env: Node v18.18
Description:
When using the “Rerun failed tests” feature in CircleCI with our WebdriverIO v8 test framework, the rerun command is not correctly handling the file paths of the failed tests. The expected behavior is to grab and rerun only the feature files that contain failed tests. However, instead of getting and passing only the name of the failed feature file (test.feature), it is getting the name of the file with the prefixed URI ‘file://’ in front (file://test.feature). This leads to an incorrect path and causes the rerun to fail.
“Error: spec file(s) /Users/distiller/project/app/e2e/file:/features/file.feature not found”
We are triggering our test from CircleCI config with this command
mkdir -p reports circleci tests glob “features/**/*.feature” | circleci tests run --command="xargs yarn wdio run wdio.ios.conf.ts --cucumberOpts.tags=‘@ios’ --spec " --verbose --split-by=timings
With leads to this command:
$ /Users/distiller/project/app/e2e/node_modules/.bin/wdio run wdio.ios.conf.ts --cucumberOpts.tags=@ios --spec features/articles.feature features/test1.feature features/test2.feature features/test3.feature features/test4.feature
And then, when we have failing tests and trying to “Rerun failed tests,” we are getting:
Installing circleci-tests-plugin-cli plugin.
circleci-tests-plugin-cli plugin Installed. Version: 1.0.7332-dfcf8a1
INFO[2024-02-27T16:09:12Z] received failed tests from workflow 3c40dc68-c1c6-4862-aaec-5ff43c1dd443
INFO[2024-02-27T16:09:12Z] 3 test(s) failed out of 172 total tests. Rerunning tests from 2 files
DEBU[2024-02-27T16:09:12Z] if all tests are being run instead of only failed tests, ensure your JUnit XML has a file or classname attribute.
DEBU[2024-02-27T16:09:12Z] starting execution
DEBU[2024-02-27T16:09:12Z] Received: file://./features/test1.feature
yarn run v1.22.19
**$ /Users/distiller/project/app/e2e/node_modules/.bin/wdio run wdio.ios.conf.ts --cucumberOpts.tags=@ios --spec file://./features/test1.feature**
Error: spec file(s) /Users/distiller/project/app/e2e/file:/features/test1.feature not found
I believe the issue seems to be with how CircleCI is handling the file paths during the rerun process. Can you handle it ASAP?
PS: I can’t provide a screenshot because new users can’t upload photos, but if somebody wants, I can share them.