Skip to content

AssertJ not clicking boxes - Java 11 #229

Open
@hirshbergshachar

Description

@hirshbergshachar

Summary

I’m not able to use basic click functionalities with AssertJ (basically everything related to activating buttons)

Opened a thread about it in STO as well -

I’m not sure if it’s a regression or if I’m just missing out something obvious… the example here - Example is not working on my env as well (Java 11)

Example

The GUI is a JPanel and I use Containers.showInFrame to display it.

The panel has some text fields, JCheckboxes and JComboboxes.

I'm able to set text in the text fields, but I am not able to check/select the boxes. Been breaking my head but couldn't figure out what is missing...

Working:

frame.textBox("example").setText(result).requireText(result);

Not working:

frame.checkBox("exampleCheckBox").uncheck().requireNotSelected(); 
frame.checkBox("example2CheckBox").check().requireSelected();
panel.comboBox("exampleComboBox").selectItem(2);

The component description that I get for a checkbox is:

[javax.swing.JCheckBox[name='exampleCheckBox', text='Mandatory', selected=true, enabled=true, visible=true, showing=true] - property:'selected']

Using Java 11, Gradle build, latest assertj-swing-junit and assertj-core.

Would highly appreciate any leads!
Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions