-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assure focused password textbox #6596
Assure focused password textbox #6596
Conversation
lib/utils.pm
Outdated
@@ -756,7 +756,7 @@ sub handle_login { | |||
select_user_gnome($myuser); | |||
} | |||
} | |||
assert_screen 'displaymanager-password-prompt', no_wait => 1; | |||
assert_and_click 'displaymanager-password-prompt'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the password prompt be always selected? This worked in before so either we have a bug that we do not want to hide or something else is broken but I would like to not just silently accept faulty product behaviour.
8908ab2
to
89d9b02
Compare
lib/utils.pm
Outdated
@@ -761,7 +761,8 @@ sub handle_login { | |||
select_user_gnome($myuser); | |||
} | |||
} | |||
assert_screen 'displaymanager-password-prompt', no_wait => 1; | |||
record_soft_failure('bsc#1122664 - password prompt is not focused') if (check_screen 'displaymanager-unfocused-password-prompt'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and again this can not work reliably because check_screen
has a 0 timeout, meaning there is no waiting between the former selection of user and the password prompt.
Please use a multi-tag assert_screen
with match_has_tag
instead of check_screen
with non-zero timeout to prevent introducing any timing dependant behaviour, to save test execution time as well as state more explicitly from the testers point of view what are the expected alternatives. For example:
assert_screen([qw(yast2_console-finished yast2_missing_package)]);
if (match_has_tag('yast2_missing_package')) {
send_key 'alt-o'; # confirm package installation
assert_screen 'yast2_console-finished';
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a blinking cursor, using multi-tag assertion you have 50% of chances of getting false positives. But, anyway I just realized that asserting an unfocused textbox is also wrong. Because the unfocused textbox looks the same as a focused textbox at an instant when the cursor is off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- There is the option "no_wait" on e.g.
assert_screen
to cover "blinking cursor" if you must - Better avoid the blinking cursor, e.g. with a proper needle design, could be an exclude area
- Are you sure unfocussed looks the same as focussed but cursor off? If you mean by "cursor off", while it's blinking I remember in gdm that there is still a small white border around the box
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- assert_screen will break the test on unfocused textbox
- We are exactly trying to match this area, we cannot exclude it.
- Yes, see: https://progress.opensuse.org/issues/46223#note-6
5229a1a
to
9c570ef
Compare
@okurz, what do you think now? |
lib/utils.pm
Outdated
@@ -761,7 +761,10 @@ sub handle_login { | |||
select_user_gnome($myuser); | |||
} | |||
} | |||
assert_screen 'displaymanager-password-prompt', no_wait => 1; | |||
if (!check_screen('displaymanager-password-prompt', 30)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why not to use multitag assert here or that's not possible to catch unfocused password prompt?
Advantage will be that if password prompt is unfocused, we won't wait for 30 seconds before selecting it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 what @rwx788 says, the check_screen
is a no-go for me here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is not possible.
As I stated here: #6596 (comment)
And I explained it here: https://progress.opensuse.org/issues/46223#note-6
Comparing this job where it worked with a failing one:
- Passed: https://openqa.opensuse.org/tests/832459#step/user_gui_login/5
with - Failing: https://openqa.opensuse.org/tests/831695#step/user_gui_login/6
There is no difference between a focused textbox from a non-focused textbox. If you try to verify if it is not focused, you get false positives, since there is a 50% chance (it really depends on the blinking frecuency, but you get the point) of getting an focused textbox without cursor.
The only thing we can be sure is that if we see the cursor, it is focused, and to avoid the test to fail, I need check_screen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the two screens look quite different. Maybe only very subtle a one-pixel border around the entryfield which looks like black-on-black but the other logos are bright in one case and dim in the other case. Can't we use that? If it is really not possible to detect if the password field is unfocussed then this is a pretty messed up bug in sddm that should definitely be reported and fixed by adjusting the design.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I can agree with an UX bug. There should be a unambiguous difference between a focused and an unfocused textbox.
Creating the bug and adapting the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should be most likely an upstream bug. Have you looked on bugs.kde.org if maybe there is one already? But honestly I am not yet sure if that is really the problem. As I stated: IMHO the two screens do look quite different
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't.
I have found a list of bugs that could be related. bugs.kde.org redirected me to https://github.com/sddm/sddm for sddm bugs.
I put here the list to carefully check them tomorrow (I just did a quick look):
- Strange behaviour while using alternative themes for SDDM sddm/sddm#990 (theme problem?)
- No focus and unresponsive keyboard until click with dual monitor sddm/sddm#859 (No focus and unresponsive keyboard until click with dual monitor)
- Focus is not on password field sddm/sddm#612 (Focus is not on password field after boot)
- Add better visual feedback when password is wrong sddm/sddm#363 (visual feedback problems)
At least openQA and in my monitors I don't see any difference in the textbox. I will try to use it manually to see if there is another element in the screen that can give a hint about a focused password textbox
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need needles for SLE? Or this issue doesn't occur there? |
Good point. I as can see, the test module is only used by opensuse: sergio@sergio-latitude:~/github/os-autoinst-distri-opensuse$ git --no-pager grep user_gui_login
lib/main_common.pm: loadtest "x11/user_gui_login" if is_opensuse && !get_var("LIVETEST") && !get_var("NOAUTOLOGIN"); |
I still need to rebase the commits |
6775998
to
7d56b3b
Compare
Ready to be reviewed (and merged) |
Please revert this NOW, this is breaking all openQA tests on SLE15 SP1. |
and all leap tests. |
Fixing it in: #6669 |
Use available screenshot to assert an unfocused textbox os-autoinst-needles-opensuse#499reverted