DEV Community

Farida
Farida

Posted on • Originally published at Medium on

Kotlin test automation. Chapter 0 — First steps.

Kotlin test automation. Chapter 0 — First steps.

Hello everyone!

Today I’d like to start a huge activity on describing how to start test automation using Kotlin language.

Why Kotlin?

  • I saw a lot of courses made for learning Kotlin but most of them — about language itself or about app development. Almost nothing about test automation and frameworks.
  • Kotlin is easy enough to start in comparison with other programming languages.
  • It is multiplatform and now also a recommended by Google language to use on mobile development.

🧳Let’s settle an environment first

  • We need to go here and download JDK. I’m using SDK 15 in this tutorial.
  • Then choose and download preferable IDE which support Kotlin lang. In my opinion — InteliJ Idea is ideal for Kotlin and Java so I’ll use it in descriptions too.
  • And customise to make it convenient for you: install required plugins, create a remote repo etc.

Seems like we’re all set!

Create a new project in IDEA, name it as you wish but, please, notice that it is a good practice to name projects/ classes/ variables in Kotlin in camelCase.

Choose in project parameters — Gradle builder and specify Java version.


Example of a project parameters

Also you’ll need to build your project to manage dependencies via Gradle builder. Just press on the cycled arrows icon.


Building project

Ok, now you have tree of folders. We need to add Kotlin class in “test” folder. Let’s name it “SampleTest”. Choose “Kotlin Class/ File” in creation options. Then open this class.


File and folders tree

So, we’re all set!

Now let’s go to the Chapter 1 and write some code.

Top comments (0)