Cucumber browser automation with Kotlin

Submitted by Dickens A S on Wed, 11/06/2019 - 15:45

Kick start browser automation in cucumber using kotlin

System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir")+"\\driver\\chromedriver.exe")
driver = ChromeDriver()

Given("I am on the Google search page") {
   driver.get("https:\\www.google.com")
}

GitHub https://github.com/dickensas/kotlin-gradle-templates/tree/master/cucumber

Use the above to do a google search using Selenium WebDriver and Gherkin feature

Cucumber
Browser Automation
Gherkin
Selenium
WebDriver

KotlinX HTML with coroutines

Submitted by Dickens A S on Mon, 11/04/2019 - 16:10

use KotlinX with coroutines to create a delay in HTML rendering

var detectDiv = GlobalScope.launch {
	delay(2000L) //wait for 2 second browser ready hack
	val myDiv = document.create.div {
		p { +"some text " }
		div { +"my div tag" }
	}

	var root = document.getElementById("root")
	root?.append(myDiv)
}

Source Code

End Of Article

KotlinX
KotlinX coroutines
KotlinX DOM
KolinX HTML

Kickstart Kotlin Web Assembly with Spring Boot

Submitted by Dickens A S on Sun, 11/03/2019 - 13:22

Easily create Kotlin Web Assembly project from these multiplatform boilerplate Gradle DSL

Kotlin Code

package wasm

fun main() {
    println("Hello World!")
}

JavaScript Code

No need to write JavaScript code simply put this HTML

<script src="build/bin/wasm/releaseExecutable/sboot_wasm.wasm.js" wasm="build/bin/wasm/releaseExecutable/sboot_wasm.wasm"> </script>

Run gradle command

  gradle assemble

Web Assembly
Kotlin Multiplatform
Spring Boot
application/wasm
wasm
WebAssembly

[DSL] Domain Specific Language

Submitted by Dickens A S on Sat, 10/26/2019 - 11:04

Domain Specific Language is an amazing concept for many years. Any particular choice of DSL can be re-used and converted to another DSL type

Below are the benefits of DSL

  • Convert DSL to source code
  • Use DSL to trigger many application modules
  • Use DSL to build script
  • Use DSL for business process
  • Convert a visual diagram to source code
  • Use DSL for Dev-Ops

Examples of DSL

DSL
Domain Specific Language

Combine Languages Together

Submitted by Dickens A S on Sat, 10/26/2019 - 08:39

Many languages can be combined together, languages can be invoked or called or directly used as follows

  • Python
  • R
  • JavaScript
  • Haskell
  • PHP 
  • Ruby
  • etc..

All these languages can be embedded and invoked from many languages using engines like Rhino for JavaScript

This benefits 

  • Reuse
  • Virtualize
  • Route
  • Embed

Example

Embedded Script Engine
Script Engine
Vert.X
Nashorn
Rhino
GraalJS
HTMLUnit