webdriverio/webdriverio

[🐛 Bug]: Setting allure report outputDir in onPrepare hook has no effect

Open

#13,929 建立於 2024年11月27日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)JavaScript (6,029 star) (1,793 fork)batch import
Bug 🐛help wanted

描述

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

8.40.3

Node.js Version

v20.11.1

Mode

Standalone Mode

Which capabilities are you using?

No response

What happened?

Setting the outptDir of the allure reporter in the onPrepare hook has no effect.

Config:

  reporters: [
    "spec",
    [
      "allure",
      {
        outputDir: "allure-results",
      },
    ],
  ],

Code (simplified):

  onPrepare: function (config, _capabilities) {
      const fullOutputPath = "some-other-folder";
      (config.reporters![1] as Array<any>)[1].outputDir = fullOutputPath;
  },

Looking into the some-other-folder it is empty, and the folder allure-results contain all the files generated by the reporter.

Using:

"@wdio/allure-reporter": "^8.40.3",

What is your expected behavior?

For changes done in onPrepare to reflect on the reporters.

How to reproduce the bug.

To reproduce use an example project and modify the onPrepare as stated above.

Relevant log output

Nothing is written to the log about these steps.

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

貢獻者指南