alexkrechik / VSCucumberAutoComplete

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

how this work with ruby and golang? #309

Closed mpermperpisang closed 2 years ago

mpermperpisang commented 4 years ago

hello

I've tried this plugin in my vscode I'm using ruby and golang and it doesn't seems work do I have to using js only?

{
    "cucumberautocomplete.steps": [
        "features/stepdefinitions/*/*.go",
    ],
    "cucumberautocomplete.syncfeatures": "features/scenarios/*/*.feature",
    "cucumberautocomplete.strictGherkinCompletion": true
}
alexkrechik commented 4 years ago

Most programming languages should be supported. Could you please provide the step definition example?

mpermperpisang commented 4 years ago

this is my .feature, @alexkrechik

@api
Feature: Variant API

  @variant-api-1
  Scenario: Variant API With Non Array Body
    Given client has "ENV:ACCOUNT_BASE_URL_2" as base api
    And client login as "USER"
    And client has "ENV:API_BASE_URL_3" as base api
    When client sends a GET request to "ENV:ENDPOINT"
    Then response status should be "200"
    And response should have "$.data..active"
    And response should have "$.data..assurance"

and this is my step definition

package apisuites

import (
    "github.com/DATA-DOG/godog"
    "github.com/golang-automation/features/stepdefinitions/apisteps"
)

/*AutomationAPI is suites for API*/
func AutomationAPI(s *godog.Suite) {
    s.Step(`^client login as "([^"]*)"$`, apisteps.AuthenticationAPI)
    s.Step(`^client sends a ([^\"]*) request to "([^\"]*)"$`, apisteps.RequestAPIWithoutBody)
    s.Step(`^client sends a ([^\"]*) request to "([^\"]*)"(?: with body:)?$`, apisteps.RequestAPIWithBody)
    s.Step(`^response should have "([^"]*)"$`, apisteps.ResponseFindPath)
    s.Step(`^response should have "([^"]*)" matching "([^"]*)"$`, apisteps.ResponseMatchingValue)
    s.Step(`^response "([^"]*)" should be (integer|string|float64)$`, apisteps.ResponseDataType)
    s.Step(`^client collects "([^"]*)" as "([^"]*)"$`, apisteps.CollectsJSON)
}
alexkrechik commented 4 years ago

"Step" keyword is not supported by default. Looks like, that you should use cucumberautocomplete.gherkinDefinitionPart option like: "cucumberautocomplete.gherkinDefinitionPart": "(Step)\\(",

mpermperpisang commented 4 years ago

I've tried to using "cucumberautocomplete.gherkinDefinitionPart": "(Step)\\(", but it also didn't work

alexkrechik commented 4 years ago

Do you use strictGherkinValidation option?

mpermperpisang commented 4 years ago

No, I don't use strictGherkinValidation Should I use it?

cc @alexkrechik

alexkrechik commented 2 years ago

In the latest extension version, 'Step' param and "`" quotes should be supported from scratch.