I am coding in Kotlin. I am trying to migrate my project from Vaadin 22 to Vaadin 23.3. I am using Karibu Testing 1.3.23 for Vaadin Unit Testing.
When I try to: val dialog = _get<Dialog>() in my unit tests, I get the following error: java.lang.AssertionError: /: No visible Dialog in MockedUI["<description_of_mocked_UI>"] matching Dialog: []. Component tree.
From my investigation so far, I understood that my Unit Tests throws an Assertion Error at the the following Karibu function: public fun <T: Component> Component._find(clazz: Class<T>, block: SearchSpec<T>.()->Unit = {}): List<T> after a certain number of iterations.
Any ideas about this? This is my first time working on Karibu Testing.
The output says a test is failing because there’s no visible Dialog. This in itself doesn’t say much, because it’s only stating the absence of something. If you test the same scenario manually, is there a dialog there?
Isn"t that the same thing I proposed above? Creating a dialog, add it to the AppLayout, and see the results on localhost on a browser. If you mean something else, would you mind explaining further please?
Hi. If this is what you mean with server logs, I don’t see useful information to be honest. If not, could you guide me on how to get the server logs? Thanks
2023-07-14 14:54:08.984 INFO 13748 --- [ restartedMain] c.v.f.s.DefaultDeploymentConfiguration :
Vaadin is running in DEVELOPMENT mode - do not use for production deployments.
I just understood what is meant with both modes.
I suppose I am using development mode since I am running the application through Intellij’s run button. In addition, I run it through ./gradlew command, but I suppose that’s development mode also.
My unit test literally stops at the first line (creation of a Dialog) and generates the above error.
The project code itself is quite huge and contains hundreds of classes and thousands of lines.