${full_name}= Set Variable If '${login_with_provider}' == 'email' ${username}@example.com ${username}
${head_username}= Set Variable If '${username_claim}' == 'email' xpath=//harbor-app/harbor-shell/clr-main-container/navigator/clr-header//clr-dropdown//button[contains(.,'${full_name}')] xpath=//harbor-app/harbor-shell/clr-main-container/navigator/clr-header//clr-dropdown//button[contains(.,'${username}')]
Init Chrome Driver
Go To ${url}
Retry Element Click ${log_oidc_provider_btn}
Run Keyword If '${login_with_provider}' == 'email' Retry Element Click ${login_with_email_btn}
Run Keyword If '${login_with_provider}' == 'ldap' Retry Element Click ${login_with_ldap_btn}
Retry Text Input ${dex_login_btn} ${full_name}
Retry Text Input ${dex_pwd_btn} ${password}
Retry Element Click ${submit_login_btn}
Retry Element Click ${grant_btn}
#If input box for harbor user name is visible, it means it's the 1st time login of this user,
# but if this user has been logged into harbor successfully, this input box will not show up,
# so there is condition branch for this stituation.
${isVisible}= Run Keyword And Return Status Element Should Be Visible ${oidc_username_input}
Run Keyword If ${is_onboard} == ${true} Should Not Be True ${isVisible}
Run Keyword If '${isVisible}' == 'True' Run Keywords Retry Text Input ${oidc_username_input} ${username} AND Retry Element Click ${save_btn}