Skip to content

Commit 890a33d

Browse files
committed
Add integration test for adding additional image to a series.
Fix #96
1 parent ef4dcc8 commit 890a33d

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

src/main/webapp/WEB-INF/views/series/info.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@
8787

8888
<div class="row" th:if="${allowAddingImages}" togglz:active="ADD_ADDITIONAL_IMAGES_TO_SERIES">
8989
<div class="col-sm-8 col-sm-offset-2">
90-
<form method="post" class="form-horizontal" enctype="multipart/form-data" th:action="@{${ADD_IMAGE_SERIES_PAGE}(id=${series.id})}" th:object="${addImageForm}">
90+
<form id="add-image-form"
91+
method="post"
92+
class="form-horizontal"
93+
enctype="multipart/form-data"
94+
th:action="@{${ADD_IMAGE_SERIES_PAGE}(id=${series.id})}"
95+
th:object="${addImageForm}">
9196
<div class="form-group" th:classappend="${#fields.hasErrors('image') ? 'has-error' : ''}">
9297
<input type="file" id="image" style="box-shadow: none; border: 0px;" required="required" accept="image/png,image/jpeg" th:field="*{image}" />
9398
<!--/*/
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
*** Settings ***
2+
Documentation Verify scenarios of adding additional image to a series
3+
Library Selenium2Library
4+
Resource ../../auth.steps.robot
5+
Suite Setup Before Test Suite
6+
Suite Teardown After Test Suite
7+
Test Setup Before Test
8+
Force Tags series add-image logic
9+
10+
*** Test Cases ***
11+
Add additional image
12+
[Documentation] Verify adding an additional image to a series
13+
Page Should Not Contain Image id=series-image-2
14+
Choose File id=image ${MAIN_RESOURCE_DIR}${/}test.png
15+
Submit Form id=add-image-form
16+
Location Should Be ${SITE_URL}/series/1
17+
Page Should Contain Image id=series-image-2
18+
19+
*** Keywords ***
20+
Before Test Suite
21+
[Documentation] Open browser, register fail hook and login as admin
22+
Open Browser ${SITE_URL} ${BROWSER}
23+
Register Keyword To Run On Failure Log Source
24+
Log In As login=admin password=test
25+
26+
Before Test
27+
[Documentation] Open a page with a series info
28+
Go To ${SITE_URL}/series/1
29+
30+
After Test Suite
31+
[Documentation] Log out and close browser
32+
Log Out
33+
Close Browser

0 commit comments

Comments
 (0)