|
| 1 | +*** Settings *** |
| 2 | +Documentation Tests fullpage screenshots |
| 3 | +Suite Setup Go To Page "forms.html" |
| 4 | +Resource ../resource.robot |
| 5 | +Force Tags Known Issue Internet Explorer |
| 6 | + |
| 7 | +*** Test Cases *** |
| 8 | +Capture fullpage screenshot to default location |
| 9 | + [Tags] NoGrid |
| 10 | + [Documentation] |
| 11 | + ... LOG 1:5 </td></tr><tr><td colspan="3"><a href="selenium-fullpage-screenshot-1.png"><img src="selenium-fullpage-screenshot-1.png" width="800px"></a> |
| 12 | + ... LOG 7:5 </td></tr><tr><td colspan="3"><a href="selenium-fullpage-screenshot-2.png"><img src="selenium-fullpage-screenshot-2.png" width="800px"></a> |
| 13 | + [Setup] Remove Files ${OUTPUTDIR}/selenium-fullpage-screenshot-*.png |
| 14 | + ${file} = Capture Fullpage Screenshot |
| 15 | + ${count} = Count Files In Directory ${OUTPUTDIR} selenium-fullpage-screenshot-*.png |
| 16 | + Should Be Equal As Integers ${count} 1 |
| 17 | + Should Be Equal ${file} ${OUTPUTDIR}${/}selenium-fullpage-screenshot-1.png |
| 18 | + Click Link Relative |
| 19 | + Wait Until Page Contains Element tag=body |
| 20 | + Capture Fullpage Screenshot |
| 21 | + ${count} = Count Files In Directory ${OUTPUTDIR} selenium-fullpage-screenshot-*.png |
| 22 | + Should Be Equal As Integers ${count} 2 |
| 23 | + |
| 24 | +Capture fullpage screenshot to custom file |
| 25 | + [Setup] Remove Files ${OUTPUTDIR}/custom-fullpage-screenshot.png |
| 26 | + Capture Fullpage Screenshot custom-fullpage-screenshot.png |
| 27 | + File Should Exist ${OUTPUTDIR}/custom-fullpage-screenshot.png |
| 28 | + |
| 29 | +Capture fullpage screenshot to custom directory |
| 30 | + [Setup] Remove Files ${TEMPDIR}/seleniumlibrary-fullpage-screenshot-test.png |
| 31 | + Create Directory ${TEMPDIR} |
| 32 | + Set Screenshot Directory ${TEMPDIR} |
| 33 | + Capture Fullpage Screenshot seleniumlibrary-fullpage-screenshot-test.png |
| 34 | + File Should Exist ${TEMPDIR}/seleniumlibrary-fullpage-screenshot-test.png |
| 35 | + |
| 36 | +Capture fullpage screenshot with index |
| 37 | + [Setup] Remove Files ${OUTPUTDIR}/fullpage-screenshot-*.png |
| 38 | + Capture Fullpage Screenshot fullpage-screenshot-{index}.png |
| 39 | + Capture Fullpage Screenshot fullpage-screenshot-{index}.png |
| 40 | + File Should Exist ${OUTPUTDIR}/fullpage-screenshot-1.png |
| 41 | + File Should Exist ${OUTPUTDIR}/fullpage-screenshot-2.png |
| 42 | + |
| 43 | +Capture fullpage screenshot with formatted index |
| 44 | + [Setup] Remove Files ${OUTPUTDIR}/fullpage-screenshot-*.png |
| 45 | + Capture Fullpage Screenshot fullpage-screenshot-{index:03}.png |
| 46 | + File Should Exist ${OUTPUTDIR}/fullpage-screenshot-001.png |
| 47 | + |
| 48 | +Capture fullpage screenshot embedded |
| 49 | + [Setup] Set Screenshot Directory EMBED |
| 50 | + ${result} = Capture Fullpage Screenshot |
| 51 | + Should Be Equal ${result} EMBED |
| 52 | + |
| 53 | +Capture fullpage screenshot base64 |
| 54 | + [Setup] Set Screenshot Directory BASE64 |
| 55 | + ${result} = Capture Fullpage Screenshot |
| 56 | + Should Not Be Empty ${result} |
| 57 | + Should Match Regexp ${result} ^[A-Za-z0-9+/=]+$ |
| 58 | + |
| 59 | +Capture fullpage screenshot with EMBED filename |
| 60 | + [Setup] Set Screenshot Directory EMBED |
| 61 | + ${result} = Capture Fullpage Screenshot EMBED |
| 62 | + Should Be Equal ${result} EMBED |
| 63 | + |
| 64 | +Capture fullpage screenshot with BASE64 filename |
| 65 | + [Setup] Set Screenshot Directory EMBED |
| 66 | + ${result} = Capture Fullpage Screenshot BASE64 |
| 67 | + Should Not Be Empty ${result} |
| 68 | + Should Match Regexp ${result} ^[A-Za-z0-9+/=]+$ |
| 69 | + |
| 70 | +Capture fullpage screenshot when no browser |
| 71 | + [Setup] Close All Browsers |
| 72 | + ${result} = Capture Fullpage Screenshot |
| 73 | + Should Be Equal ${result} ${None} |
0 commit comments