Code Documentation Tool For Katalon Studio


#1

Can anyone say does katalon support any code documentation tools ? Like in groovy we have groovydoc.


#2

Katalon Studio itself does not support any “Javadoc” like feature.

I use Gradle to invoke Groovydoc for my projects. See the following build.gradle as an example.

Gradle is not bundled in Katalon Studio. You need to install Gradle into your PC for yourself.

Gradle will (or to be precise, the build.gradle will) manage downloading and enabling Groovydoc tool for you.

Using Groovydoc, you can generate API doc of your Groovy classes located in the Keywords directory of the project. Groovy classes located in the Include/scripts/groovy directory can also be documented. See my example at

But you can not generate docs of your scripts in “Test Cases”. I think there is no easy-to-use tool that can generate doc of Katalon Test Cases. Perhaps you would agree; the API doc format would not be suitable for Test Cases. Manuscripts would do.

What do I do usually to write documents for my projects?

  1. I do manually write documents in GitHub Flavoured Markdown in <project dir>/README.md or <project dir>/docs/docname.md
  2. publish them using GitHub Pages
  3. I can include generated groovy doc at <project dir>/docs/api/* to publish it

#3

@kazurayam
what if … use gradle wrapper? in theory should be easy to add it into a given project and provide more flexibility.
will not solve the groovydoc issue but it can be a way to avoid installing gradle globaly …
ok, it will require that gradle be installed at least once but after that can be just copy/paste between projects


#4

(modified at 2019/11/06)

Not very much applicable to @papri.paul case.


What is Gradle Wrapper? See this doc https://docs.gradle.org/current/userguide/gradle_wrapper.html

Adding the Gradle Wrapper

Generating the Wrapper files requires an installed version of the Gradle runtime on your machine as described in Installation. Thankfully, generating the initial Wrapper files is a one-time process.

Let me explain a bit more.

@papri.paul has created a Katalon Project possibly with a few Groovy classes as custom keywords. He/she wants to generate the groovydoc of the classes.

The project does NOT have the gradle wrapper built-in.

He/she needs install Gradle into the PC.

Once he/he installed Gradle into the PC, he/she can do in the command line:

$ cd <Katalon Project dir>
$ gradle init

By gradle init, a few files and folders will be added into the project directory including the “gradle wrapper”. He will add and commit the gradle wrapper into the Git repository.

His team members or CI machines can clone the Git repository. They will find the “wrapper” bundled in the project. Therefore they can execute

$ cd <Katalon Project dir>
$ .\gradlew xxxx

The team members DO NOT NEED to install Gradle. The CI machines DO NOT NEED to have Gradle installed. They simply execute the gradlew (Gradle Wrapper) binary which has been prepared by the project’s originator to enjoy full functionality of the Gradle build tool.


The gradlew (Wrapper) will be useful for the team members or CI machines who share a Katalon Project backed by Git repository. For example, I used Gradle for a Katalon Studio project which work with AWS S3 in order to manage external dependencies. If I add the Gradle Wrapper into the repository, then CI machines without Gradle installed can run the tests scripts. The external dependencis will be resolved by the Wrapper bundled in the project. Gradle Wrapper makes the setups of CI process much simple.

As for @papri.paul case, he/she is the originator of the project. The project does NOT have the Gradle Wrapper yet. He/she needs to prepare the Wrapper. In order to do it, he/she needs to have Gradle installed.


#5

@kazurayam

If you have time, can you produce a TIPS article which details the step-by-step process of using gradle wrapper on an existing KS project?

TIA!


#6

Yes, I think the same so I’m trying to generate groovydoc of the custom keywords of my project with Gradle. As I’m very new to Gradle so still facing some problems. Thanks, @kazurayam for the support. Further help will be appreciated.


#7

or … he can grab a project which has the wrapper already and copy the needed files into his project :wink:


#8

If one understands what gradle init command does, its OK. In order to understands what it does, one would need some experiments. So he/she needs to install Gradle anyway. :wink:


#9

or he/she can use IDEA from Intelij, which has gradle already, to init an empty project and study what the command did