|
| 1 | +*** Settings *** |
| 2 | +Test Setup Go To Page "forms/named_submit_buttons.html" |
| 3 | +Resource ../resource.robot |
| 4 | + |
| 5 | +*** Test Cases *** |
| 6 | +Choose File |
| 7 | + [Setup] Navigate To File Upload Form And Create Temp File To Upload |
| 8 | + Choose File file_to_upload ${CURDIR}${/}temp.txt |
| 9 | + # Not sure do you get "C:\fakepath\" prefix with all browsers but at least |
| 10 | + # Chrome and Firefox use it regardless the OS. |
| 11 | + Textfield Value Should Be file_to_upload C:\\fakepath\\temp.txt |
| 12 | + [Teardown] Remove File ${CURDIR}${/}temp.txt |
| 13 | + |
| 14 | +Choose File And File Does Not Exist |
| 15 | + [Setup] Go To Page "forms/file_upload_form.html" |
| 16 | + Run Keyword And Expect Error |
| 17 | + ... InvalidArgumentException: Message:* |
| 18 | + ... Choose File file_to_upload ${CURDIR}${/}NotHere.txt |
| 19 | + |
| 20 | +Choose File And Folder |
| 21 | + [Setup] Go To Page "forms/file_upload_form.html" |
| 22 | + Choose File file_to_upload ${CURDIR} |
| 23 | + Textfield Value Should Be file_to_upload C:\\fakepath\\keywords |
| 24 | + |
| 25 | +Choose File With Grid |
| 26 | + [Documentation] |
| 27 | + ... LOG 2:6 DEBUG GLOB: POST*/session/*/file*"file": "* |
| 28 | + [Tags] OnlyGrid |
| 29 | + [Setup] Touch ${CURDIR}${/}temp2.txt |
| 30 | + Choose File file_to_upload ${CURDIR}${/}temp2.txt |
| 31 | + Textfield Value Should Be file_to_upload C:\\fakepath\\temp2.txt |
| 32 | + [Teardown] Remove File ${CURDIR}${/}temp2.txt |
| 33 | + |
| 34 | +Input Text Should Work Same Way When Not Using Grid |
| 35 | + [Documentation] |
| 36 | + ... LOG 2:5 DEBUG GLOB: POST*/session/*/clear {"* |
| 37 | + ... LOG 2:7 DEBUG Finished Request |
| 38 | + ... LOG 2:8 DEBUG GLOB: POST*/session/*/value*"text": "* |
| 39 | + ... LOG 2:10 DEBUG Finished Request |
| 40 | + ... LOG 2:11 DEBUG NONE |
| 41 | + [Tags] NoGrid |
| 42 | + [Setup] Touch ${CURDIR}${/}temp.txt |
| 43 | + Input Text file_to_upload ${CURDIR}${/}temp.txt |
| 44 | + Textfield Value Should Be file_to_upload C:\\fakepath\\temp.txt |
| 45 | + [Teardown] Remove File ${CURDIR}${/}temp.txt |
| 46 | + |
| 47 | +Input Text Should Work Same Way When Using Grid |
| 48 | + [Tags] OnlyGrid |
| 49 | + [Setup] Touch ${CURDIR}${/}temp3.txt |
| 50 | + Input Text file_to_upload ${CURDIR}${/}temp3.txt |
| 51 | + Textfield Value Should Be file_to_upload C:\\fakepath\\temp3.txt |
| 52 | + [Teardown] Remove File ${CURDIR}${/}temp3.txt |
| 53 | + |
| 54 | +Running Keyword Is Saved Correctly |
| 55 | + ${keyword_method} = get_running_keyword |
| 56 | + Should Be Equal get_running_keyword ${keyword_method} |
| 57 | + ${keyword_method} = Get Running Keyword |
| 58 | + Should Be Equal get_running_keyword ${keyword_method} |
| 59 | + ${keyword_method} = Get Running Keyword By Decorator |
| 60 | + Should Be Equal Get Running Keyword By Decorator ${keyword_method} |
| 61 | + ${keyword_method} = get_running_keyword_by_decorator |
| 62 | + Should Be Equal Get Running Keyword By Decorator ${keyword_method} |
| 63 | + |
| 64 | +Running Keyword Is Cleared Correctly |
| 65 | + ${sl} = Get Library Instance SeleniumLibrary |
| 66 | + Should Be Equal ${sl._running_keyword} ${None} |
| 67 | + ${keyword_method} = Get Running Keyword |
| 68 | + Should Be Equal get_running_keyword ${keyword_method} |
| 69 | + ${sl} = Get Library Instance SeleniumLibrary |
| 70 | + Should Be Equal ${sl._running_keyword} ${None} |
| 71 | + |
| 72 | +Running Keyword Is Cleared Correctly When Error |
| 73 | + ${sl} = Get Library Instance SeleniumLibrary |
| 74 | + Should Be Equal ${sl._running_keyword} ${None} |
| 75 | + Run Keyword And Expect Error Page should have contained text 'Is not here' but did not. |
| 76 | + ... Page Should Contain Is not here |
| 77 | + ${sl} = Get Library Instance SeleniumLibrary |
| 78 | + Should Be Equal ${sl._running_keyword} ${None} |
| 79 | + |
| 80 | +*** Keywords *** |
| 81 | +Navigate To File Upload Form And Create Temp File To Upload |
| 82 | + Cannot Be Executed in IE |
| 83 | + Go To Page "forms/file_upload_form.html" |
| 84 | + Touch ${CURDIR}${/}temp.txt |
0 commit comments