Make test TextInput::test_txtentry() more stable

The test function is rather flaky in CI at the moment.

The problem appears to be related to the TextInput not
receiving keyboard focus correctly.

Calling forceActiveFocus() should be more reliable than
setFocus(true), and will hopefully be enough to stabilize
the test.

Pick-to: 6.5 6.5.0
Change-Id: I4aeda581fc36e8b796c315b147a7e12acb032eba
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
This commit is contained in:
Oliver Eftevaag 2023-03-09 14:50:31 +01:00
parent 492dc98a28
commit 8ec8133aa2
1 changed files with 2 additions and 1 deletions

View File

@ -97,7 +97,8 @@ Item {
}
function test_textentry() {
txtentry.focus = true;
txtentry.forceActiveFocus()
verify(txtentry.activeFocus)
compare(txtentry.text, "")
keyClick(Qt.Key_H)
keyClick(Qt.Key_E)