assertProperty
Asserts that the value actual reads off the matched node equals expected, and returns this interaction for chaining.
actual reads the resolved node, typed as the query named it, so any property a component exposes can be asserted on directly:
onNodeOfType<JSplitPane>().assertProperty(180) { dividerLocation }The failure names the query and both values, e.g. Node 'isOfType(JSplitPane)' property was 200, expected 180. It appends message, which tells several property assertions on the same node apart.
Use this for a property the assertion vocabulary does not cover. A property with its own assertion or matcher reads better through that. SwingNodeInteraction.fetch is the last resort, for a call that requires the matched component itself or for its identity.
Parameters
the value actual must return, compared with equals.
appended to the failure after both values; null by default.
the property to read, evaluated against the node the query resolves at this call.
Asserts that the value actual reads off the matched window equals expected, and returns this interaction for chaining.
actual reads the resolved window, typed as the query named it, so any property a window exposes can be asserted on directly:
onWindowWithTitle("Settings").assertProperty(true) { isAlwaysOnTop }The failure names the query and both values, e.g. Window 'hasTitle("Settings")' property was false, expected true. It appends message, which tells several property assertions on the same window apart.
Use this for a property the window assertions do not cover. A property with its own assertion reads better through that. SwingWindowInteraction.fetch is the last resort, for a call on the matched window itself or for its identity.
Parameters
the value actual must return, compared with equals.
appended to the failure after both values; null by default.
the property to read, evaluated against the window the query resolves at this call.