Buttons guide

 

Buttons are entities in Image Library to operate with testing objects which are buttons actually. Buttons are clickable and inherit different configurations to help testers to manage with them in various situations. As Image Library is aimed to fully work with GUI through screenshots thus buttons also are being interacted through pre-defined image templates and in some cases through coordinates.

If there is a need to interact with buttons through keyboard - this Image Library buttons are NOT for these scenarios. Please use another libraries and solutions. 

 

Image Library operates with Buttons of following types:

 

Buttons are defined in yaml config file in windows sections except for global buttons definitions.

Below is the yaml example with explanations. 

===============

Define all global buttons in all of three possible states and then choose which states to use

global_buttons_defs:
button name; through this name button is called in keyword .... cursor:
button can be in 3 states: normal, highlighted, disabled.
also here the threshold value for button can be defined (default is 0.99). There is no need to specify default threshold. .... .... states: .... .... .... highlighted: .... .... .... .... image: cursor_active.png .... .... .... .... threshold: 0.85 .... .... .... normal: cursor.png .... exit: .... .... states: .... .... .... highlighted: exit_active.png .... .... .... normal: exit.png .... switch: .... .... states: .... .... .... disabled: switch_disabled.png .... show: .... .... states: .... .... .... active: show_active.png .... .... .... disabled: show_disabled.png .... send: .... .... states: .... .... .... normal: send.png .... .... .... highlighted: send_active.png .... .... .... disabled: send_disabled.png

main window is obligatory to define (if not specified by default main is used)
main:
.... buttons:
.... .... enter: enter.png
.... dynamic_buttons:
....  .... cancel: cancel.png
.... multiple_buttons:
....  .... arrow:
....  ....  .... expected_count: 5
....  ....  .... directions: vertical | horizontal
....  ....  .... image: arrow.png
....  button_coord:
....  ....  window_button:
....  ....  .... position: [1108, 345, 23, 21]
....  buttons_panels:
....  .... cards:
....  .... .... position:   [349, 115, 441, 160]
....  .... .... count:      4
....  .... .... padding:    7 (distance between buttons in pixels)
....  .... .... direction:  horizontal | vertical | matrix (buttons placement on the panel)

....  global_buttons:
here specify in which states the button is used in this window; note: all the states you pass will be treated as possbile
states for button and library will search this button in any of this state when called .... .... cursor: all .... .... exit: highlighted .... .... switch: disabled .... .... show: active .... .... send: [normal, highlighted]

To define the threshold (default is 0.99) for button image here use as this:
note: available for: button, dynamic_buttons, multiple buttons

main:
.... buttons:
.... .... enter:
.... .... .... image: enter.png
.... .... .... threshold: 0.85
.... multiple_buttons:
.... .... arrow:
.... .... .... expected_count: 5
.... .... .... directions: vertical | horizontal
.... .... .... image: arrow.png
.... .... .... threshold: 0.87