Task: 2026/10/19/read-button-and-toast-states-painted-toasts-and-glyph-ink-in-the-harness
2.5 KiB
test_box_button
Type: Harness API (may include self-tests).
Source contract: test_box_button.h.
Use when
Resolve and click shell footer buttons. Read the contract below and the source header before use.
Contract and usage
Click a box's shell footer button by label, rooted at
Test::PaintingLayerRoot, with its own self-test: a content-rooted
Ui::RoundButton search that reaches none of the footer buttons beside the
rooted search that finds and clicks one, a named refusal for a label no shell
button carries, a disabled or hidden footer readable as
present+disabled/hidden with matched() still false
(BoxButtonDisabled / BoxButtonHidden beside BoxButtonReady),
box_button_shell saved through CaptureBoxLayer so the frame contains the
footer row, and a same-launch hidden-then-ready shell-button reading while the
layer show animation runs. ClickBoxButton still Fails on an unusable button.
ReadBoxButtons reads each shell button through Test::ReadButtonState
(test_widgets.h), the shared reading of a button's own disabled flag
beside QWidget::isEnabled()
(button state), so the walk
holds no second copy of the isVisible() / isDisabled() test and
present, disabled, hidden, labels and every Box* answer keep their
meaning: disabled is the footer's own isDisabled(), and hidden still
wins over it.
Verification
AppendBoxButtonClickSelfTestcovers the click, the refusals, the busy/hidden readings and the hidden-during-show-animation reading on one realUi::GenericBox. ItsClickBoxButtonon the disabledHarness Busyfooter is the one announced deliberate FAIL, named by the Note before it, so a run carrying it endsSCENARIO_RESULT: FAILby design.AppendButtonStateSelfTestis the self-test ofReadButtonState: one stage on a realUi::RoundButtonparented to the primary window.setDisabled(true)andsetDisabled(false), called through theUi::RoundButtontype, read disabled and then enabled whileisEnabled(), printed beside them as the control, stays true;QWidget::setEnabled(false)moves that control and leaves the own flag clear; a null widget and a widget that is not aUi::AbstractButtonrefuse by name and are neverusable(). It has no deliberate FAIL, needs no session, chats list, network or account fixture, reads a missing primary window as a named fixture gate and releases its button in the same stage.