webdriverio/webdriverio
Vedi su GitHub[🐛 Bug]: Error: There isn't any active suite!
Open
#13.013 aperta il 11 giu 2024
Bug 🐛help wanted
Metriche repository
- Star
- (6029 star)
- Metriche merge PR
- (Merge medio 15g 15h) (48 PR mergiate in 30 g)
Descrizione
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
8.37.0
Node.js Version
18.20.3
Mode
Standalone Mode
Which capabilities are you using?
No response
What happened?
After upgrading to webdriverio version 8.37.0 some test suite runs are failing with Error: There isn't any active suite!
In the allure report the test is showing as passed, so this error must be happening aftewards. I did a little digging and it looks like it may be failing because _endTest in reporter.js is being called for one of the hook states that gets pushed on the _state stack.
This does not occur in version 8.36.1.
What is your expected behavior?
Tests pass without failures.
How to reproduce the bug.
Minimal example (corresponding gist) that recreates the issue:
- Create a custom service that extends the browser object in the
beforemethod. - Create a test suite that calls the function added to the browser object within the
beforehook followed by a call tobrowser.url(there must be both). I used the mocha test runner but I'm not sure if this matters. - Add a nested
describeblock that a contains a single test. - Run the test and observe the error in the output.
Relevant log output
Terminal output:
Error: There isn't any active suite!
at AllureReporter._endSuite (./node_modules/@wdio/allure-reporter/build/reporter.js:80:19)
at AllureReporter.onSuiteEnd (./node_modules/@wdio/allure-reporter/build/reporter.js:307:14)
at AllureReporter.<anonymous> (./node_modules/@wdio/reporter/build/index.js:165:18)
at AllureReporter.emit (node:events:517:28)
at AllureReporter.emit (node:domain:489:12)
at ./node_modules/@wdio/runner/build/reporter.js:47:56
at Array.forEach (<anonymous>)
at BaseReporter.emit (./node_modules/@wdio/runner/build/reporter.js:47:25)
at MochaAdapter.emit (./node_modules/@wdio/mocha-framework/build/index.js:162:24)
at Runner.emit (node:events:529:35)
at Runner.emit (node:domain:489:12)
at ./node_modules/@wdio/mocha-framework/node_modules/mocha/lib/runner.js:896:12
at next (./node_modules/@wdio/mocha-framework/node_modules/mocha/lib/runner.js:474:14)
at Immediate.<anonymous> (./node_modules/@wdio/mocha-framework/node_modules/mocha/lib/runner.js:559:5)
at processImmediate (node:internal/timers:476:21)
Code of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues