Search in sources :

Example 1 with CucumberStepInspection

use of org.jetbrains.plugins.cucumber.inspections.CucumberStepInspection in project intellij-plugins by JetBrains.

the class CucumberHighlightingTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    myFixture.allowTreeAccessForAllFiles();
    CucumberStepsIndex.getInstance(getProject()).reset();
    myFixture.enableInspections(new CucumberStepInspection());
    myFixture.copyDirectoryToProject(getTestName(true), "");
    myFixture.configureByFile(getTestName(true) + "/test.feature");
}
Also used : CucumberStepInspection(org.jetbrains.plugins.cucumber.inspections.CucumberStepInspection)

Example 2 with CucumberStepInspection

use of org.jetbrains.plugins.cucumber.inspections.CucumberStepInspection in project intellij-plugins by JetBrains.

the class CucumberJavaCreateStepTest method doTest.

private void doTest(boolean createAll) {
    CucumberStepsIndex.getInstance(getProject()).reset();
    myFixture.enableInspections(new CucumberStepInspection());
    myFixture.copyDirectoryToProject("createStep/" + getTestName(true), "");
    myFixture.configureByFile("createStep/" + getTestName(true) + "/test.feature");
    myFixture.checkHighlighting(true, false, false);
    final String fixName = createAll ? "Create All" : "Create step";
    final IntentionAction quickFix = ContainerUtil.find(myFixture.getAvailableIntentions(), intentionAction -> intentionAction instanceof QuickFixWrapper && intentionAction.getText().contains(fixName));
    if (quickFix != null) {
        myFixture.launchAction(quickFix);
        VirtualFile expectedFile = myFixture.findFileInTempDir("StepDefs.java");
        myFixture.openFileInEditor(expectedFile);
        myFixture.checkResultByFile("createStep/" + getTestName(true) + "/StepDefs_fixed.txt");
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) IntentionAction(com.intellij.codeInsight.intention.IntentionAction) CucumberStepInspection(org.jetbrains.plugins.cucumber.inspections.CucumberStepInspection) QuickFixWrapper(com.intellij.codeInspection.ex.QuickFixWrapper)

Aggregations

CucumberStepInspection (org.jetbrains.plugins.cucumber.inspections.CucumberStepInspection)2 IntentionAction (com.intellij.codeInsight.intention.IntentionAction)1 QuickFixWrapper (com.intellij.codeInspection.ex.QuickFixWrapper)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1