void () { String inputName = getTestName(false); String extension = ".java"; String actionName = "Create method"; String path = PlatformTestUtil.lowercaseFirstLetter(inputName, true) + ".fxml"; myFixture.configureByFiles(path, inputName + extension); IntentionAction intention = myFixture.findSingleIntention(actionName); Editor editor = myFixture.getEditor(); PsiFile file = myFixture.getFile(); WriteCommandAction.runWriteCommandAction(getProject(), () -> { Document document = editor.getDocument(); PsiElement leaf = file.findElementAt(editor.getCaretModel().getOffset()); TextRange range = PsiTreeUtil.getParentOfType(leaf, XmlAttributeValue.class).getValueTextRange(); document.deleteString(range.getStartOffset(), range.getEndOffset()); PsiDocumentManager.getInstance(getProject()).commitDocument(document); }); assertFalse(intention.isAvailable(getProject(), editor, file)); }