Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Powered By Vaadin on Kotlin Build Status

Karibu-Testing Demo project for Spring Boot

A Vaadin 8 example project which demonstrates the possibility to use the 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.

Either Java or Kotlin might be used, or both. Testing the Vaadin 8 application is as easy as:

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<Customer> grid = _get(Grid.class);
        Stream<Customer> customerStream = grid.getDataProvider().fetch(new Query<>());
        assertTrue("Halk does not exist", customerStream.map(Customer::getFirstName).anyMatch("Halk"::equals));
    }

Kotlin:

    @Test
    fun createNewCustomer() {
        _get<Button> { caption = "New customer" }._click()
        _get<TextField> { caption = "First name" }._value = "Halk"
        _get<Button> { caption = "Save" }._click()
        val dataProvider = _get<Grid<Customer>> { }.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/.

To run the tests, run ./mvnw verify.

About

Karibu-Testing Demo project for Spring Boot

Resources

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.