void (String sourceData, String emmetExpression, String expectedData) { configureFromFileText("test." + getExtension(), selectSourceData(sourceData)); final CustomTemplateCallback callback = new CustomTemplateCallback(getEditor(), getFile()); doWrap(emmetExpression, callback); TemplateState state; while ((state = TemplateManagerImpl.getTemplateState(getEditor())) != null) { state.nextTab(); } NonBlockingReadActionImpl.waitForAsyncTaskCompletion(); UIUtil.dispatchAllInvocationEvents(); checkResultByText(expectedData); }