skrape{it}
Search…
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
1
<dependency>
2
<groupId>it.skrape</groupId>
3
<artifactId>skrapeit-core</artifactId>
4
<version>LATEST</version>
5
<scope>test</scope>
6
</dependency>
7
<dependency>
8
<groupId>it.skrape</groupId>
9
<artifactId>skrapeit-ktor</artifactId>
10
<version>LATEST</version>
11
<scope>test</scope>
12
</dependency>
Copied!
build.gradle.kts
1
testCompile("it.skrape:skrapeit-core:+")
2
testCompile("it.skrape:skrapeit-ktor:+")
Copied!

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
Last modified 2yr ago
Copy link