there I proposed a custom keyword class com.kazurayam.junit4ks.JUnitCustomKeywords with a keyword method runWithJUnitRunner(Class clazz). This keyword enables me to run JUnit-based tests for my Custom Keywords (which interacts with web sites via WebDriver) in Katalon Studio, and to view test results in concise format in the LogView/Console pane. It would make it a lot easier for me to develop custom keywords in Katalon Studio.
I would request @Katalon Team to provided a similar keyword built-in the Katalon Studio.
The previous version emitted a log when a test case failed, but the log did not show the exact point of failure: which test case class, which method, which source code line caused failure. The new version emits more informative message, something like this:
2019-01-18 05:37:31.543 INFO c.k.katalon.core.main.TestCaseExecutor - START Test Cases/test/com.kazurayam.ksbackyard.junit/JUnitCustomKeywordsTestRuuner
2019-01-18 05:37:32.380 DEBUG testcase.JUnitCustomKeywordsTestRuuner - 1: com.kazurayam.ksbackyard.junit.JUnitCustomKeywords.runWithJUnitRunner(com.kazurayam.ksbackyard.junit.JUnitCustomKeywordsTest, CONTINUE_ON_FAILURE)
2019-01-18 05:37:32.767 ERROR c.k.k.core.keyword.internal.KeywordMain - ❌ These following reason:
[
java.lang.AssertionError:
Expected: is "\taaa\n\tbbb\n\tccc\n"
but: was ">> aaa\n>> bbb\n>> ccc\n"
at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
at org.junit.Assert.assertThat(Assert.java:956)
at org.junit.Assert.assertThat(Assert.java:923)
at org.junit.Assert$assertThat.callStatic(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:214)
at com.kazurayam.ksbackyard.junit.JUnitCustomKeywordsTest.testIndentLines(JUnitCustomKeywordsTest.groovy:18) // .... this is the exact point where the test case failed
...
at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:131)
]
Yeah given the current status of our backlog, plugin would be a better way. We will update the Gradle plugin so that it can package Katalon Studio projects as custom keyword plugins.