assertj / assertj-swing

Fluent assertions for Swing apps
Other
107 stars 52 forks source link

Can't find internal dialog box #246

Closed GregJohnStewart closed 4 years ago

GregJohnStewart commented 4 years ago

I'm having trouble finding a way to find an internal dialog box. None of the built in functions seem to be able to find it, and when looking at the stacktrace I can see the item:

javax.swing.JInternalFrame[,0,159,687x223,layout=javax.swing.plaf.basic.BasicInternalFrameUI$Handler,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.metal.MetalBorders$OptionDialogBorder@47a677aa,flags=264,maximumSize=,minimumSize=,preferredSize=,closable=false,defaultCloseOperation=DISPOSE_ON_CLOSE,desktopIcon=javax.swing.JInternalFrame$JDesktopIcon[,0,0,160x31,invalid,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@2ce49e79,flags=8,maximumSize=,minimumSize=,preferredSize=],frameIcon=sun.swing.ImageIconUIResource@213b6830,iconable=false,isClosed=false,isIcon=false,isMaximum=false,isSelected=true,maximizable=false,opened=true,resizable=false,rootPane=javax.swing.JRootPane[,3,25,681x195,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=449,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true,title=About Task Timekeeper]

I know I can keep mucking around and eventually find a custom matcher that works, but I was wondering if I should be able to find this using one of the built in methods such as:

this.fixture.dialog(DialogMatcher.withTitle("About Task Timekeeper").andShowing());

On a side note, how does one click a button on a dialog? so far the best way I have found to identify/ match things has been with a name, but that's not really an option in a dialog box.

Thanks in advance!