54 lines
1.5 KiB
Plaintext
54 lines
1.5 KiB
Plaintext
*** Settings ***
|
|
Library SeleniumLibrary run_on_failure=Nothing
|
|
|
|
*** Variables ***
|
|
${URL} https://git.dotya.ml/
|
|
${BROWSER} chrome
|
|
${DELAY} 0.2
|
|
|
|
${LOGIN_BUTTON} //*[@id="navbar"]/div[2]/a[2]
|
|
${SIGN_IN_BUTTON} //form/div[4]/button[1]
|
|
${USERNAME_FIELD} //*[@id="user_name"]
|
|
|
|
*** Keywords ***
|
|
Screenshot page
|
|
Capture Page Screenshot
|
|
|
|
Input Username
|
|
[Arguments] ${USERNAME_FIELD} ${USERNAME}
|
|
Input Text ${USERNAME_FIELD} ${USERNAME}
|
|
|
|
Login Should Have Failed
|
|
Title Should Be Sign In - dotya.ml Gitea Service
|
|
|
|
*** Test Cases ***
|
|
attempt login without password
|
|
${chrome_options} = Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys, selenium.webdriver
|
|
Call Method ${chrome_options} add_argument headless
|
|
Call Method ${chrome_options} add_argument no-sandbox
|
|
Call Method ${chrome_options} add_argument disable-dev-shm-usage
|
|
${options}= Call Method ${chrome_options} to_capabilities
|
|
|
|
Open Browser ${URL} browser=${BROWSER} desired_capabilities=${options}
|
|
Set Selenium Speed ${DELAY}
|
|
Set Window Size 1920 1080
|
|
|
|
Maximize Browser Window
|
|
|
|
Click Element ${LOGIN_BUTTON}
|
|
Sleep ${DELAY}
|
|
Screenshot page
|
|
Log Location
|
|
|
|
Input Username ${USERNAME_FIELD} dat_test_username
|
|
Screenshot page
|
|
|
|
Click Element ${SIGN_IN_BUTTON}
|
|
Sleep ${DELAY}
|
|
Screenshot page
|
|
Login Should Have Failed
|
|
Log Location
|
|
|
|
Post-conditions
|
|
Close Browser
|