void (String fileName, boolean performAction) { VirtualFile root = ModuleRootManager.getInstance(myModule).getContentRoots()[0].getParent(); configureByExistingFile(root.findFileByRelativePath(fileName)); VirtualFile virtualFile = getFile().getVirtualFile(); ActionHint actionHint = ActionHint.parse(getFile(), getFile().getText()); Collection<HighlightInfo> infosBefore = highlightErrors(); final IntentionAction action = findActionAndCheck(actionHint, infosBefore); if(action != null && performAction) { String text = action.getText(); WriteCommandAction.runWriteCommandAction(null, () -> action.invoke(getProject(), getEditor(), getFile())); myFile = getPsiManager().findFile(virtualFile); Collection<HighlightInfo> infosAfter = highlightErrors(); final IntentionAction afterAction = findActionWithText(text); if (afterAction != null) { fail("Action '" + text + "' is still available after its invocation in test " + BASE_PATH + fileName); } assertTrue(infosBefore.size() > infosAfter.size()); } }