AssertJ/JUnit 故障跟踪

AssertJ/JUnit Failure Trace

当程序未能在测试用例中找到组件时,将显示失败跟踪。它显示层次结构中组件的属性。例如:

[name=null, text='Close', enabled=true, visible=true, showing=false]

我想知道 visibleshowing 的值告诉我们关于组件的什么信息。

这些属性来自 java.awt.Component class。

这些属性 (https://docs.oracle.com/javase/8/docs/api/java/awt/Component.html) 的 JavaDoc 具有以下信息:

可见:

Determines whether this component should be visible when its parent is visible.

正在显示:

Determines whether this component is showing on screen. This means that the component must be visible, and it must be in a container that is visible and showing.