allure-framework / allure-js

Allure integrations for JavaScript test frameworks
https://allurereport.org/
Apache License 2.0
226 stars 123 forks source link

Hermione-allure throws exception if test use 2 or more browser sessions #985

Closed alenamakarovaya closed 5 months ago

alenamakarovaya commented 5 months ago

Describe the bug If test is running in 2 or more sessions, then second session can't be described with hermione-allure. It throws exception which leads to test failure.

Looks like it's the similar old issue that was fixed https://github.com/allure-framework/allure-js/issues/656 but it came again with new version

To Reproduce Repo for reproduce: https://github.com/fortrest-jr/allure-tests/tree/Steps?tab=readme-ov-file Brunch Steps

Run test:

const {assert} = require('chai');

hermione.only.in(['chrome', 'chrome2']);
it('should pass', async function() {
    assert.equal(1, 1);
});

Expected behavior Error stacktrace:

TypeError: Cannot read properties of undefined (reading 'status')
    at AllureHermioneReporter.onTestFail (/Users/alenanikonova/tests/allure-tests/node_modules/hermione-allure/dist/reporter.js:187:26)
    at Hermione.emit (node:events:526:35)
    at Hermione.emit (node:domain:488:12)
    at MainRunner.<anonymous> (/Users/alenanikonova/tests/allure-tests/node_modules/hermione/build/src/events/utils.js:5:55)
    at MainRunner.emit (node:events:514:28)
    at MainRunner.emit (node:domain:488:12)
    at BrowserRunner.<anonymous> (/Users/alenanikonova/tests/allure-tests/node_modules/hermione/build/src/events/utils.js:5:55)
    at BrowserRunner.emit (node:events:514:28)
    at BrowserRunner.emit (node:domain:488:12)
    at InsistantTestRunner.<anonymous> (/Users/alenanikonova/tests/allure-tests/node_modules/hermione/build/src/runner/browser-runner.js:92:45)
    at InsistantTestRunner.emit (node:events:514:28)
    at InsistantTestRunner.emit (node:domain:488:12)
    at RegularTestRunner.<anonymous> (/Users/alenanikonova/tests/allure-tests/node_modules/hermione/build/src/runner/test-runner/insistant-test-runner.js:28:22)
    at RegularTestRunner.emit (node:events:514:28)
    at RegularTestRunner.emit (node:domain:488:12)
    at RegularTestRunner._emit (/Users/alenanikonova/tests/allure-tests/node_modules/hermione/build/src/runner/test-runner/regular-test-runner.js:39:14)
    at RegularTestRunner.run (/Users/alenanikonova/tests/allure-tests/node_modules/hermione/build/src/runner/test-runner/regular-test-runner.js:33:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async InsistantTestRunner.run (/Users/alenanikonova/tests/allure-tests/node_modules/hermione/build/src/runner/test-runner/insistant-test-runner.js:32:9)
    at async BrowserRunner._runTest (/Users/alenanikonova/tests/allure-tests/node_modules/hermione/build/src/runner/browser-runner.js:84:9)
baev commented 5 months ago

Official support for Hermione is deprecated due to constant breaking changes in Hermione API and extremely low user interest.