suppressHandler, useHandler, disableHandler, enableHandler

in Japanese(日本語)

Lets a scenario operate a modal itself instead of having a declared irregularHandler close it automatically.

Functions

function description
suppressHandler { } Runs the block without closing declared interruptions, so the scenario can check or operate the modal itself. Block form — suppression is always restored when the block exits, even on failure.
useHandler { } Inside suppressHandler (or between disableHandler()/enableHandler()), restores automatic closing for this block only.
disableHandler() Stops closing declared interruptions until enableHandler(). Unlike suppressHandler, this spans condition / action / expectation blocks.
enableHandler() Resumes what disableHandler() stopped.

Example

func beforeEach() {
    irregularHandler("#promo_modal", dismiss: "#btn_promo_close")   // declaration stays in beforeEach
}

suppressHandler {
    exist("#promo_modal")          // verify it appeared
    tap("#btn_promo_detail")       // operate it yourself
}                                   // automatic closing resumes on exit

Crossing a scene's condition / action / expectation boundary needs the imperative form, since suppressHandler { } can only wrap a single block:

condition {
    disableHandler()
    exist("#promo_modal")       // just confirm it appeared
}.action {
    tap("#btn_promo_detail")    // still suppressed here
}.expectation {
    exist("#detail_screen")
    enableHandler()             // automatic closing resumes from here
}

Notes