Balrog994 / cucumber-test-runner

An Extension for Visual Studio Code to Run and Debug CucumberJS Tests
MIT License
5 stars 7 forks source link

unable to launch test #19

Open ArthurGlacetAdeo opened 5 months ago

ArthurGlacetAdeo commented 5 months ago

when i launch test using the vscode testing tool i get:

  You're calling functions (e.g. "When") on an instance of Cucumber that isn't running (status: PENDING).
          This means you may have an invalid installation, potentially due to:
          - Cucumber being installed globally
          - A project structure where your support code is depending on a different instance of Cucumber
          Either way, you'll need to address this in order for Cucumber to work.
          See https://github.com/cucumber/cucumber-js/blob/main/docs/installation.md#invalid-installations

when i run cucumber through the package.json it's working fine:

{
  "name": "*****",
  "version": "1.0.0",
  "description": "******",
  "main": "index.js",
  "scripts": {
    "test": "cucumber-js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@cucumber/cucumber": "^10.5.1",
    "@playwright/test": "^1.42.1",
    "@types/node": "^20.11.23"
  },
  "dependencies": {
    "@cucumber/pretty-formatter": "^1.0.1",
    "dotenv": "^16.4.5",
    "jsonpath": "^1.1.1",
    "node-ssh": "^13.1.0",
    "playwright": "^1.43.1",
    "tunnel-ssh": "^5.1.2"
  }
}
hardymj commented 5 months ago

@ArthurGlacetAdeo It seems to work if you have the following set "@cucumber/cucumber": "^9.5.1", But doesn't work if you set it to this. "@cucumber/cucumber": "^10.5.1",

ArthurGlacetAdeo commented 5 months ago

Thank you! it's know working !!!

other question: do you know if i can set the world parameter of the run ? i used to launch my campaign with : cucumber-js --world-parameters "{\"context\":\"fr-uat\"}"

hardymj commented 5 months ago

@ArthurGlacetAdeo

I don't use the world-parameters but could you try this?

My cucumber.js file looks like this for profiles. Could you add in Worldparameters as part of the default as below?

const common = { parallel: 2, retry: 0, format: ['./teamcity-cucumber-formatter', 'html:cucumber-report.html', 'json:reports/report.json', ], require: ['features/support/*.js'], };

module.exports = { default: { ...common, worldParameters: { context: 'fr-uat, }, }, cli: { ...common, paths: ['journeys///*.feature'], }, };

hardymj commented 5 months ago

@Balrog994 It would appear that moving from Cucumber 9 to Cucumber 10 does not cause the tests to run. The function chunksToLinesAsync in Cucumber 9 returns values but in Cucumber 10 it does not.

I suspect the cucumberProcess.stdout and cucumberProcess.stderr do not return the data in the same format so no longer works between the versions.