Class MenuContract

java.lang.Object
limn.testing.a11y.MenuContract

public final class MenuContract extends Object
What every widget of the MENU shape owes a reader, as named cases over a MenuSubject: a menu bar and a popup menu under the same rules, which until this were tested in each widget's own file.
  • the rows are the members of one selection, named in order, and classify as MENU;
  • the four invariants hold, unfocused and focused;
  • FOCUS moves the highlight onto a row and chooses nothing and opens nothing; a disabled row offers it not;
  • a row with something to open offers SHOW_MENU and EXPAND while closed and COLLAPSE alone while open, each verb doing what it says and the other refused by state; a row with nothing to open offers none of the three;
  • PRESS chooses a command row and TOGGLE flips a check row, which takes PRESS too; a title, a submenu and an empty one take neither;
  • a row's verbs are the menu verb set and nothing else, and a disabled row carries none;
  • a row keeps its id while the highlight moves.
A refusal is read as an effect: the scene's perform answers true whenever the node exists, so what the contract checks after a refused verb is that nothing changed.
  • Field Details

  • Method Details

    • cases

      public static List<ContractCase> cases(MenuSubject subject, UiRuntime runtime)
      The cases, in the order above.
      Parameters:
      subject - the widget under contract
      runtime - the installed runtime the harness drains verbs through
      Returns:
      the cases; a test runs each as a dynamic test