Created
September 12, 2019 22:05
-
-
Save gwpantazes/5aca70459a7a089ad7ea187b5ec70e6a to your computer and use it in GitHub Desktop.
Cucumber Scenario Outline and custom configured ParameterType aren't compatible for step highlighting/usage detection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.test; | |
import cucumber.api.java.en.And; | |
import cucumber.api.java.en.Given; | |
import cucumber.api.java.en.Then; | |
import cucumber.api.java.en.When; | |
public class MyStepdefs { | |
@Given("that we're using a scenario outline") | |
public void thatWeReUsingAScenarioOutline() { | |
} | |
@When("we use the example placeholder for a custom parameter type") | |
public void weUseTheExamplePlaceholderForACustomParameterType() { | |
} | |
@And("this is the sample step {customtype}") | |
public void thisIsTheSampleStepSample() { | |
} | |
@Then("IntelliJ \\/ CucumberJVM should be able to recognize that it's valid") | |
public void intellijCucumberJVMShouldBeAbleToRecognizeThatItSValid() { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Sample Feature | |
Scenario Outline: Scenario Outlines should be compatible with custom ParameterType | |
Given that we're using a scenario outline | |
When we use the example placeholder for a custom parameter type | |
And this is the sample step A | |
And this is the sample step <sample> | |
And this is the sample step "<sample>" | |
Then IntelliJ / CucumberJVM should be able to recognize that it's valid | |
Examples: | |
| sample | | |
| A | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.test; | |
import com.wolfram.rtester.util.Language; | |
import cucumber.api.TypeRegistry; | |
import cucumber.api.TypeRegistryConfigurer; | |
import io.cucumber.cucumberexpressions.ParameterType; | |
import java.util.Locale; | |
public class TypeRegistryConfiguration implements TypeRegistryConfigurer { | |
@Override | |
public Locale locale() { | |
return Locale.ENGLISH; | |
} | |
@Override | |
public void configureTypeRegistry(final TypeRegistry typeRegistry) { | |
typeRegistry.defineParameterType(new ParameterType<>( | |
"customtype", | |
"A|B|C", | |
String.class, | |
(String s) -> s | |
)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment