mvysny / karibu-testing

Vaadin Server-Side Browserless Containerless Unit Testing
Apache License 2.0
111 stars 14 forks source link

A page with CheckboxGroup causes exception during pretty print #169

Closed satorstefan closed 2 months ago

satorstefan commented 5 months ago

Hello Martin,

I accidentally searched for a button on a page where this button is not visible. This page also contains a checkbox group.

I got the following exception, which is probably not what you intended:

java.lang.IllegalAccessError: class com.github.mvysny.kaributesting.v10.GridKt tried to access private method 'com.vaadin.flow.data.provider.DataProvider com.vaadin.flow.component.checkbox.CheckboxGroup.getDataProvider()' (com.github.mvysny.kaributesting.v10.GridKt and com.vaadin.flow.component.checkbox.CheckboxGroup are in unnamed module of loader 'app')

at com.github.mvysny.kaributesting.v10.GridKt.getDataProvider(Grid.kt:937)
at com.github.mvysny.kaributesting.v10.PrettyPrintTreeKt.toPrettyString(PrettyPrintTree.kt:137)
at com.github.mvysny.kaributesting.v10.PrettyPrintTree$Companion.ofVaadin(PrettyPrintTree.kt:55)
at com.github.mvysny.kaributesting.v10.PrettyPrintTree$Companion.ofVaadin(PrettyPrintTree.kt:57)
at com.github.mvysny.kaributesting.v10.PrettyPrintTree$Companion.ofVaadin(PrettyPrintTree.kt:57)
at com.github.mvysny.kaributesting.v10.PrettyPrintTree$Companion.ofVaadin(PrettyPrintTree.kt:57)
at com.github.mvysny.kaributesting.v10.PrettyPrintTree$Companion.ofVaadin(PrettyPrintTree.kt:57)
at com.github.mvysny.kaributesting.v10.PrettyPrintTree$Companion.ofVaadin(PrettyPrintTree.kt:57)
at com.github.mvysny.kaributesting.v10.PrettyPrintTreeKt.toPrettyTree(PrettyPrintTree.kt:64)
at com.github.mvysny.kaributesting.v10.LocatorKt._find(Locator.kt:195)
at com.github.mvysny.kaributesting.v10.LocatorKt._get(Locator.kt:155)
at com.github.mvysny.kaributesting.v10.LocatorJ._get(LocatorJ.java:65)
at de.hahn.pageobjects.SafeguardEditorPage.getSaveButton(SafeguardEditorPage.java:187)
at de.hahn.pageobjects.SafeguardEditorPage.saveIsEnabled(SafeguardEditorPage.java:229)
at de.hahn.safeguard.SafeguardPoolEditorTest.creating_a_safeguard_enables_all_buttons(SafeguardPoolEditorTest.java:64)
at java.base/java.lang.reflect.Method.invoke(Method.java:578)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
satorstefan commented 5 months ago

This line causes the problem: image

mvysny commented 4 months ago

Which Karibu Testing and which Vaadin version please?

satorstefan commented 4 months ago
24.1.4 2.1.4
satorstefan commented 4 months ago

image

mvysny commented 2 months ago

Please upgrade to newest Vaadin 24.4, the CheckboxGroup.getDataProvider() function is public there.

satorstefan commented 2 months ago

Hello Martin, I dont think this works: image

The checkbox does not get selected.

   <vaadin.version>24.4.7</vaadin.version>
    <karibu.version>2.1.5</karibu.version>
satorstefan commented 2 months ago

Also in the documentation the java version of this call is not mentioned:

Call checkboxGroup.selectByLabel("Item #1", "Item #3") to select items with given labels (since KT 1.3.15).

mvysny commented 2 months ago

Please create a new issue.