Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlayWright+Cucumber+ Allure - Allure is not supporting for latest cucumber version 10.3.1 #915

Open
varshanharshank opened this issue Mar 25, 2024 · 2 comments
Assignees
Labels
theme:cucumberjs CucumberJS related issue type:bug Something isn't working

Comments

@varshanharshank
Copy link

varshanharshank commented Mar 25, 2024

Describe the bug
I unable to run cucumber.js file after migrating to the cucumber 10.3.1 version.It is showing below error. But, the below issue is not occurring if i try with cucumber version 9.3.0.

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/test/Documents/Workspace/miscellaneous/router/src/helper/report/allureReport.ts
    at new NodeError (node:internal/errors:405:5)
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:79:11)
    at defaultGetFormat (node:internal/modules/esm/get_format:124:36)
    at defaultLoad (node:internal/modules/esm/load:84:20)
    at nextLoad (node:internal/modules/esm/loader:163:28)
    at ESMLoader.load (node:internal/modules/esm/loader:603:26)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:457:22)
    at new ModuleJob (node:internal/modules/esm/module_job:64:26)
    at ESMLoader.#createModuleJob (node:internal/modules/esm/loader:480:17)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:434:34) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
//allureReport.ts

/* eslint-disable @typescript-eslint/no-explicit-any */
import { AllureRuntime, CucumberJSAllureFormatter } from 'allure-cucumberjs'

function Reporter(options: any) {
  return new CucumberJSAllureFormatter(
    options,
    new AllureRuntime({ resultsDir: 'reports/allure-results' }),
    {
      labels: [
        {
          name: 'epic',
          pattern: [/@feature:(.*)/],
        },
        {
          name: 'severity',
          pattern: [/@severity:(.*)/],
        },
      ],
      links: [
        {
          type: 'issue',
          pattern: [/@issue=(.*)/],
          urlTemplate: 'http://localhost:8080/issue/%s',
        },
        {
          type: 'tms',
          pattern: [/@tms=(.*)/],
          urlTemplate: 'http://localhost:8080/tms/%s',
        },
      ],
    }
  )
}

Reporter.prototype = Object.create(CucumberJSAllureFormatter.prototype)
Reporter.prototype.constructor = Reporter

exports.default = Reporter

package.json
image

To Reproduce
Steps to reproduce the behavior:

  1. Migrate cucumber version to latest 10.3.1
  2. Run the following command npx cucumber-js test --tags '@smoke'

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@epszaw
Copy link
Member

epszaw commented Mar 25, 2024

Hey there! Will'll update the integration to make in compatible with the latest versions as soon as it is possible. Stay in touch!

@epszaw epszaw self-assigned this Mar 25, 2024
@epszaw epszaw added type:bug Something isn't working theme:cucumberjs CucumberJS related issue labels Mar 25, 2024
@prikverma
Copy link

is it fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:cucumberjs CucumberJS related issue type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants