karibu-testing icon indicating copy to clipboard operation
karibu-testing copied to clipboard

A page with CheckboxGroup causes exception during pretty print

Open satorstefan opened this issue 10 months ago • 2 comments

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 avatar Apr 06 '24 19:04 satorstefan

This line causes the problem: image

satorstefan avatar Apr 12 '24 13:04 satorstefan

Which Karibu Testing and which Vaadin version please?

mvysny avatar May 08 '24 06:05 mvysny

<vaadin.version>24.1.4</vaadin.version> <karibu.version>2.1.4</karibu.version>

satorstefan avatar May 12 '24 08:05 satorstefan

image

satorstefan avatar May 12 '24 08:05 satorstefan

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

mvysny avatar Jul 05 '24 09:07 mvysny

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 avatar Jul 29 '24 22:07 satorstefan

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).

satorstefan avatar Jul 29 '24 22:07 satorstefan

Please create a new issue.

mvysny avatar Jul 30 '24 05:07 mvysny