fix(tests): fix functional tests failing due to the wrong input box receiving input (autofocus)

@vladikoff - mind reviewing?

If the element is already visible, only attempt one focus.

fixes #1329