Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
/series/info: add tests
  • Loading branch information
php-coder committed Oct 1, 2017
commit 6b1a552c6720f79d8c369ccf872a98900cf9efe5
12 changes: 10 additions & 2 deletions src/test/robotframework/series/add-image/logic.robot
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@ Test Setup Before Test
Force Tags series add-image logic

*** Test Cases ***
Add additional image
[Documentation] Verify adding an additional image to a series
Add additional image by providing a file
[Documentation] Verify uploading an additional image to a series
Page Should Not Contain Image id=series-image-2
Choose File id=image ${MAIN_RESOURCE_DIR}${/}test.png
Submit Form id=add-image-form
Location Should Be ${SITE_URL}/series/1
Page Should Contain Image id=series-image-2

Add additional image by providing a URL to image
[Documentation] Verify downloading an additional image to a series
Page Should Not Contain Image id=series-image-3
Input Text id=image-url ${SITE_URL}/image/1
Submit Form id=add-image-form
Location Should Be ${SITE_URL}/series/1
Page Should Contain Image id=series-image-3

*** Keywords ***
Before Test Suite
[Documentation] Open browser, register fail hook and login as admin
Expand Down
45 changes: 42 additions & 3 deletions src/test/robotframework/series/add-image/validation.robot
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,56 @@ Suite Teardown After Test Suite
Force Tags series add-image validation

*** Test Cases ***
Add image but without filling a required field
[Documentation] Verify validation of a required field
Add image with empty required fields
[Documentation] Verify validation of mandatory fields
Submit Form id=add-image-form
Element Text Should Be id=image.errors Value must not be empty
Element Text Should Be id=image.errors Image or image URL must be specified
Element Text Should Be id=image-url.errors Image or image URL must be specified

Add image with empty file
[Documentation] Verify validation of an empty file
Choose File id=image ${TEST_RESOURCE_DIR}${/}empty.png
Submit Form id=add-image-form
Element Text Should Be id=image.errors File must not be empty

Add image with both image and an image URL
[Documentation] Verify validation of an image and an image URL provided at the same time
Choose File id=image ${MAIN_RESOURCE_DIR}${/}test.png
Input Text id=image-url ${SITE_URL}/image/1
Submit Form id=add-image-form
Element Text Should Be id=image.errors Image or image URL must be specified
Element Text Should Be id=image-url.errors Image or image URL must be specified

Add image with image URL with invalid response
[Documentation] Verify validation of invalid response from a server
Input Text id=image-url ${SITE_URL}/test/invalid/response-400
Submit Form id=add-image-form
Element Text Should Be id=image-url.errors Could not download file

Add image with image URL to a file that does not exist
[Documentation] Verify validation of URL to non existing file
Input Text id=image-url ${SITE_URL}/test/invalid/response-404
Submit Form id=add-image-form
Element Text Should Be id=image-url.errors File not found

Add image with image URL that causes a redirect
[Documentation] Verify validation of URL with redirect
Input Text id=image-url ${SITE_URL}/test/invalid/response-301
Submit Form id=add-image-form
Element Text Should Be id=image-url.errors URL must not redirect to another address

Add image with image URL to an empty file
[Documentation] Verify validation of URL to an empty file
Input Text id=image-url ${SITE_URL}/test/invalid/empty-jpeg-file
Submit Form id=add-image-form
Element Text Should Be id=image-url.errors File must not be empty

Add image with image URL to not an image file
[Documentation] Verify validation of URL to a file of unsupported type
Input Text id=image-url ${SITE_URL}/test/invalid/not-image-file
Submit Form id=add-image-form
Element Text Should Be id=image-url.errors Invalid file type

*** Keywords ***
Before Test Suite
[Documentation] Login as admin and open a page with a series info
Expand Down