alexkrechik / VSCucumberAutoComplete

Cucumber (Gherkin) Full Support Extension for VSCode
https://marketplace.visualstudio.com/items?itemName=alexkrechik.cucumberautocomplete
MIT License
331 stars 79 forks source link

Steps ordering in the Testing tab in Vs Code does not match the order of steps in the feature file #454

Open anazar2001 opened 1 year ago

anazar2001 commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

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

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

Cucumberautocomplete part of VSCode settings:

{
  "cucumberautocomplete.steps": [
      "features/step_definitions/*.js",
      "node_modules/@revjet/csp-qa/src/steps/*.js"
  ],
  "cucumberautocomplete.skipDocStringsFormat": true,
  "cucumberautocomplete.syncfeatures": "features/*.feature",
  "cucumberautocomplete.strictGherkinCompletion": true,
  "cucumberautocomplete.smartSnippets": true,
  "cucumberautocomplete.stepsInvariants": true,
  "cucumberautocomplete.onTypeFormat": false,
  "cucumberautocomplete.formatConfOverride": {
      "And": 0,
  }
}

Step definition: If applicable, add example of step definition:

When(/^I rename the run to "([^"]*)"$/, (name) =>
  // ... whatever
);

Gherkin step line If applicable, add step line from gherkin file When I rename the run to "([^"]*)"

alexkrechik commented 1 year ago

If I properly understand the issue, steps are ordering due to their's usage popularity, not due to order they in the feature file.

anazar2001 commented 1 year ago

Would it be possible to make the order match the feature file? Otherwise it is not very useful for whoever runs the test or verifies the results. Eclipse plugin sorts steps according to the feature file steps order.

alexkrechik commented 1 year ago

Could you please send screenshot of the issue?

anazar2001 commented 1 year ago

Please find it below

Screenshot 2022-10-24 at 14 43 06
anazar2001 commented 1 year ago

Hi,

Any updates on this. Could this be fixed please.

Thanks, Andrei.

alexkrechik commented 1 year ago

Hi!

Looks like that, unfortunately, this tab is out of the extension responsibility. Extension is working with 'edit' part of the VSCode - steps hishlight, checking for errors, etc.

anazar2001 commented 1 year ago

Ok. Is there some ordering of the steps at the moment at all? Can we introduce some natural ordering instead of relative statement weight which would be auto incremented number (not available on UI but used to sort steps)?

alexkrechik commented 1 year ago

May be some other type of steps suggestion ordering (like not use steps usage popularity) could be introduced in the future as an optional param (due to current sorting way is more useful for the most cases).

anazar2001 commented 1 year ago

I think steps suggestion ordering and the ordering of steps displayed in the Testing tab should be separate. I understand the current logic behind suggestions but it is not the same as the order of steps execution. Currently it is very difficult to understand where in the sequence your step failed.

Is there a way to pass steps to Testing tab in the same order steps have been executed. The execution order is correct. There is just a display issue.

Also, the ordering of scenarios seems to be correct. Is there any difference between scenarios and steps?

On Mon, 31 Oct 2022, 12:24 Oleks, @.***> wrote:

May be some other type of steps suggestion ordering (like not use steps usage popularity) could be introduced in the future as an optional param (due to current sorting way is more useful for the most cases).

— Reply to this email directly, view it on GitHub https://github.com/alexkrechik/VSCucumberAutoComplete/issues/454#issuecomment-1297009600, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADJXPJ2EFAP2NATQKMXTERTWF626VANCNFSM6AAAAAARMP5MWE . You are receiving this because you authored the thread.Message ID: @.***>