-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathvalidation-admin.robot
69 lines (59 loc) · 3.21 KB
/
validation-admin.robot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
*** Settings ***
Documentation Verify series creation validation scenarios from admin
Library SeleniumLibrary
Resource ../../auth.steps.robot
Resource ../../selenium.utils.robot
Suite Setup Before Test Suite
Suite Teardown Close Browser
Test Setup Disable Client Validation add-series-form
Force Tags series validation
*** Test Cases ***
Create series with empty required fields
Submit Form id:add-series-form
Element Text Should Be id:category.errors Value must not be empty
Element Text Should Be id:quantity.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
Create series with both image and an image URL
Choose File id:image ${MAIN_RESOURCE_DIR}${/}test.png
Input Text id:image-url ${SITE_URL}/image/1
Submit Form id:add-series-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
Create series with invalid image URL
Input Text id:image-url invalid-url
Submit Form id:add-series-form
Element Text Should Be id:image-url.errors Value must be a valid URL
Create series with image URL with invalid response
Input Text id:image-url ${MOCK_SERVER}/series/response-400
Submit Form id:add-series-form
Element Text Should Be id:image-url.errors Could not download file
Create series with image URL to a file that does not exist
Input Text id:image-url ${MOCK_SERVER}/series/response-404
Submit Form id:add-series-form
Element Text Should Be id:image-url.errors File not found
Create series with image URL that causes a redirect
Input Text id:image-url ${MOCK_SERVER}/series/response-301
Submit Form id:add-series-form
Element Text Should Be id:image-url.errors URL must not redirect to another address
Create series with image URL to an empty file
Input Text id:image-url ${MOCK_SERVER}/series/empty-jpeg-file
Submit Form id:add-series-form
Element Text Should Be id:image-url.errors File must not be empty
Create series with image URL to a file of unsupported type (not an image)
Input Text id:image-url ${MOCK_SERVER}/series/not-image-file
Submit Form id:add-series-form
Element Text Should Be id:image-url.errors Invalid file type
Create series with too long comment
${letter}= Set Variable x
Click Element id:add-comment-link
Wait Until Element Is Visible id:comment
Input Text id:comment ${letter * 1025}
Submit Form id:add-series-form
Element Text Should Be id:comment.errors Value is greater than allowable maximum of 1024 characters
*** Keywords ***
Before Test Suite
Open Browser ${SITE_URL}/account/auth ${BROWSER}
Register Keyword To Run On Failure Log Source
Log In As login=admin password=test
Go To ${SITE_URL}/series/add