Documentation ¶
Overview ¶
Package lockscreen is used to get information about the lock screen directly through the UI.
Index ¶
- Variables
- func ClickSmartLockArrowButton(ctx context.Context, tconn *chrome.TestConn) error
- func EnterPIN(ctx context.Context, tconn *chrome.TestConn, PIN string) error
- func EnterPassword(ctx context.Context, tconn *chrome.TestConn, username, password string, ...) error
- func HasPinPad(ctx context.Context, tconn *chrome.TestConn) bool
- func HidePassword(ctx context.Context, tconn *chrome.TestConn) error
- func Lock(ctx context.Context, tconn *chrome.TestConn) error
- func PINFieldFinder(username string) (*nodewith.Finder, error)
- func PasswordFieldFinder(username string) (*nodewith.Finder, error)
- func ShowPassword(ctx context.Context, tconn *chrome.TestConn) error
- func SubmitPIN(ctx context.Context, tconn *chrome.TestConn) error
- func SwitchToPassword(ctx context.Context, tconn *chrome.TestConn) error
- func TypePassword(ctx context.Context, tconn *chrome.TestConn, username, password string, ...) error
- func Unlock(ctx context.Context, tconn *chrome.TestConn) error
- func UserPassword(ctx context.Context, tconn *chrome.TestConn, username string, pin bool) (*uiauto.NodeInfo, error)
- func WaitForAuthError(ctx context.Context, tconn *chrome.TestConn, timeout time.Duration) error
- func WaitForLoggedIn(ctx context.Context, tconn *chrome.TestConn, timeout time.Duration) error
- func WaitForPasswordField(ctx context.Context, tconn *chrome.TestConn, username string, ...) error
- func WaitForSmartLockReady(ctx context.Context, tconn *chrome.TestConn) error
- func WaitForSmartLockVisible(ctx context.Context, expectVisible bool, tconn *chrome.TestConn) error
- type State
Constants ¶
This section is empty.
Variables ¶
var AuthErrorFinder = nodewith.Role(role.AlertDialog).NameStartingWith("Your PIN or password couldn't be verified. Try again.").ClassName("LoginErrorBubble")
AuthErrorFinder is the finder for the authentication error shown on the first failure.
var ConsecutiveAuthErrorFinder = nodewith.Role(role.AlertDialog).NameStartingWith("Your PIN or password still couldn't be verified. Note: If you recently changed your password, use your old password. Your new password will be applied once you sign out.").ClassName("LoginErrorBubble")
ConsecutiveAuthErrorFinder is the finder for the authentication error shown on the consecutive failures.
var HidePasswordButton = nodewith.Role(role.ToggleButton).ClassName("ToggleImageButton").Name("Hide password")
HidePasswordButton is the finder for the "Hide password" button on Lock/Start screen.
var ShowPasswordButton = nodewith.Role(role.Button).ClassName("ToggleImageButton").Name("Show password")
ShowPasswordButton is the finder for the "Show password" button on Lock/Start screen.
var SmartLockArrowButtonFinder = nodewith.NameContaining("Unlocked by your phone. Tap or click to enter.").ClassName("ArrowButtonView")
SmartLockArrowButtonFinder is the finder for the button that needs to be clicked to complete authentication with Smart Lock.
var SubmitButton = nodewith.Name("Submit").Role(role.Button)
SubmitButton is the finder for the "Submit" button on Lock/Start screen.
var SwitchToPasswordButton = nodewith.Role(role.Button).ClassName("LabelButton").Name("Switch to password")
SwitchToPasswordButton is the finder for the "Switch to password" button on Lock/Start screen.
Functions ¶
func ClickSmartLockArrowButton ¶
ClickSmartLockArrowButton clicks the arrow button to login with Smart Lock.
func EnterPassword ¶
func EnterPassword(ctx context.Context, tconn *chrome.TestConn, username, password string, kb *input.KeyboardEventWriter) error
EnterPassword types password with carriage return at the end.
func HasPinPad ¶
HasPinPad checks whether the PIN pad is present, i.e., whether PIN unlock is enabled.
func HidePassword ¶
HidePassword clicks the "Hide password" button.
func PINFieldFinder ¶
PINFieldFinder generates Finder for the "PIN or password" field.
func PasswordFieldFinder ¶
PasswordFieldFinder generates Finder for the password field. The password field node can be uniquely identified by its name attribute, which includes the username, such as "Password for [email protected]". The Finder will find the node whose name matches the regex /Password for <username>/, so the domain can be omitted, or the username argument can be an empty string to find the first password field in the hierarchy.
func ShowPassword ¶
ShowPassword clicks the "Show password" button.
func SwitchToPassword ¶
SwitchToPassword clicks the "Switch to password" button which appears only when PIN autosubmit is enabled.
func TypePassword ¶
func TypePassword(ctx context.Context, tconn *chrome.TestConn, username, password string, kb *input.KeyboardEventWriter) error
TypePassword enters the given password (without submitting). Refer to PasswordFieldFinder for username options. It doesn't make any assumptions about the password being correct, so callers should verify the login/lock state afterwards.
func Unlock ¶
Unlock unlocks the screen, assuming that PIN / Password has already been entered by the user.
func UserPassword ¶
func UserPassword(ctx context.Context, tconn *chrome.TestConn, username string, pin bool) (*uiauto.NodeInfo, error)
UserPassword searches the PIN / Password field for a given user pod and returns the corresponding node.
func WaitForAuthError ¶
WaitForAuthError waits for the login error bubble that password or pin was not correct.
func WaitForLoggedIn ¶
WaitForLoggedIn is a wrapper around WaitState to wait for the user to be logged in.
func WaitForPasswordField ¶
func WaitForPasswordField(ctx context.Context, tconn *chrome.TestConn, username string, timeout time.Duration) error
WaitForPasswordField waits for the password text field for a given user pod to appear in the UI.
func WaitForSmartLockReady ¶
WaitForSmartLockReady waits for UI signal that the chromebook is ready to be unlocked by Smart Lock.
Types ¶
type State ¶
type State struct { LoggedIn bool `json:"isLoggedIn"` Owner bool `json:"isOwner"` Locked bool `json:"isScreenLocked"` ReadyForPassword bool `json:"isReadyForPassword"` // Login screen may not be ready to receive a password, even if this is true (crbug/1109381) RegularUser bool `json:"isRegularUser"` Guest bool `json:"isGuest"` Kiosk bool `json:"isKiosk"` Email string `json:"email"` DisplayEmail string `json:"displayEmail"` UserImage string `json:"userImage"` HasValidOauth2Token bool `json:"hasValidOauth2Token"` }
State contains the state returned by chrome.autotestPrivate.loginStatus, corresponding to 'LoginStatusDict' as defined in autotest_private.idl.