Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mvysny/karibu-testing-spring
Karibu-Testing Demo project for Spring Boot
https://github.com/mvysny/karibu-testing-spring
Last synced: 28 days ago
JSON representation
Karibu-Testing Demo project for Spring Boot
- Host: GitHub
- URL: https://github.com/mvysny/karibu-testing-spring
- Owner: mvysny
- License: mit
- Created: 2018-10-23T09:07:48.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-20T22:40:55.000Z (over 2 years ago)
- Last Synced: 2024-10-05T11:10:33.334Z (about 1 month ago)
- Language: Java
- Size: 78.1 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Powered By Vaadin on Kotlin](http://vaadinonkotlin.eu/iconography/vok_badge.svg)](http://vaadinonkotlin.eu)
[![Build Status](https://travis-ci.org/mvysny/karibu-testing-spring.svg?branch=master)](https://travis-ci.org/mvysny/karibu-testing-spring)# Karibu-Testing Demo project for Spring Boot
A Vaadin 8 example project which demonstrates the possibility to use
the [Karibu-Testing](https://github.com/mvysny/karibu-testing)
Browserless Testing Framework with Spring Boot. No web server,
no Selenium, and no TestBench, pure business logic testing.> For Vaadin 14 example project please visit [t-shirt-shop-example](https://github.com/mvysny/t-shirt-shop-example).
Either Java or Kotlin might be used, or both. Testing the Vaadin 8 application is as easy as:
Java:
```java
@Test
public void createNewCustomer() {
_click(_get(Button.class, spec -> spec.withCaption("New customer")));
_setValue(_get(TextField.class, spec -> spec.withCaption("First name")), "Halk");
_click(_get(Button.class, spec -> spec.withCaption("Save")));
Grid grid = _get(Grid.class);
Stream customerStream = grid.getDataProvider().fetch(new Query<>());
assertTrue("Halk does not exist", customerStream.map(Customer::getFirstName).anyMatch("Halk"::equals));
}
```Kotlin:
```kotlin
@Test
fun createNewCustomer() {
_get { caption = "New customer" }._click()
_get { caption = "First name" }._value = "Halk"
_get { caption = "Save" }._click()
val dataProvider = _get> { }.dataProvider
expect(true, "Halk does not exist: ${dataProvider._findAll()}") {
dataProvider._findAll().any { it.firstName == "Halk" }
}
}```
Workflow
========To compile the entire project, run `./mvnw -C clean package` (or on Windows: `./mvnw.cmd -C clean package`).
To run the application, run `./mvnw spring-boot:run` and open [http://localhost:8080/](http://localhost:8080/).
To run the tests, run `./mvnw verify`.