Ktor

Setup

In order to use the Ktor-extension it's required to have the skrapeit-core artifact in the classpath as well as having a proper Ktor setup up and running.

Maven
Gradle
pom.xml
<dependency>
<groupId>it.skrape</groupId>
<artifactId>skrapeit-core</artifactId>
<version>LATEST</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>it.skrape</groupId>
<artifactId>skrapeit-ktor</artifactId>
<version>LATEST</version>
<scope>test</scope>
</dependency>
build.gradle.kts
testCompile("it.skrape:skrapeit-core:+")
testCompile("it.skrape:skrapeit-ktor:+")

How to Use

The skrape{it} Ktor-extension will extend Ktor's TestApplicationResponse with anexpectHtml{} lambda function. The scope of the lambda will give you a parsed response body (deserialized to a Doc) and enables you to make comfortable assumptions about the content, properties and structure of the document.

Documentation by example