File tree 3 files changed +42
-2
lines changed
java/ru/mystamps/web/controller
webapp/WEB-INF/views/series
test/robotframework/series/sales
3 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ public class SeriesController {
112
112
}
113
113
114
114
@ InitBinder ("addSeriesForm" )
115
- protected void initBinder (WebDataBinder binder ) {
115
+ protected void initSeriesFormBinder (WebDataBinder binder ) {
116
116
StringTrimmerEditor editor = new StringTrimmerEditor (" " , true );
117
117
binder .registerCustomEditor (String .class , "michelNumbers" , editor );
118
118
binder .registerCustomEditor (String .class , "scottNumbers" , editor );
@@ -121,6 +121,11 @@ protected void initBinder(WebDataBinder binder) {
121
121
binder .registerCustomEditor (String .class , "comment" , new StringTrimmerEditor (true ));
122
122
}
123
123
124
+ @ InitBinder ("addSeriesSalesForm" )
125
+ protected void initSeriesSalesFormBinder (WebDataBinder binder ) {
126
+ binder .registerCustomEditor (String .class , "url" , new StringTrimmerEditor (true ));
127
+ }
128
+
124
129
@ GetMapping (Url .ADD_SERIES_PAGE )
125
130
public void showForm (
126
131
@ Category @ RequestParam (name = "category" , required = false ) LinkEntityDto category ,
Original file line number Diff line number Diff line change @@ -370,7 +370,12 @@ <h5 th:text="|#{t_who_selling_series}:|">Who was selling/buying this series:</h5
370
370
< div class ="row " togglz:active ="ADD_PURCHASES_AND_SALES " sec:authorize ="hasAuthority('ADD_SERIES_SALES') ">
371
371
< div class ="col-sm-12 ">
372
372
< h5 th:text ="|#{t_add_info_who_selling_series}:| "> Add info about selling/buying this series:</ h5 >
373
- < form method ="post " class ="form-horizontal " action ="info.html " th:action ="@{${ADD_SERIES_ASK_PAGE}(id=${series.id})} " th:object ="${addSeriesSalesForm} ">
373
+ < form id ="add-series-sales-form "
374
+ method ="post "
375
+ class ="form-horizontal "
376
+ action ="info.html "
377
+ th:action ="@{${ADD_SERIES_ASK_PAGE}(id=${series.id})} "
378
+ th:object ="${addSeriesSalesForm} ">
374
379
375
380
< div class ="form-group form-group-sm " th:classappend ="${#fields.hasErrors('date') ? 'has-error' : ''} ">
376
381
< label for ="date " class ="control-label col-sm-3 ">
Original file line number Diff line number Diff line change
1
+ *** Settings ***
2
+ Documentation Verify miscellaneous aspects of adding series sales
3
+ Library Selenium2Library
4
+ Resource ../../auth.steps.robot
5
+ Suite Setup Before Test Suite
6
+ Suite Teardown After Test Suite
7
+ Force Tags series sales misc
8
+
9
+ *** Test Cases ***
10
+ Url should be stripped from leading and trailing spaces
11
+ [Documentation] Verify removing of leading and trailing spaces from a URL
12
+ Input Text id=url ${SPACE * 2 } bad-value${SPACE * 2 }
13
+ Submit Form id=add-series-sales-form
14
+ # We can't use "Textfield Value Should Be" because it causes NPE:
15
+ # https://github.com/MarkusBernhardt/robotframework-selenium2library-java/issues/92
16
+ ${value } = Get Value id=url
17
+ Should Be Equal ${value } bad-value
18
+
19
+ *** Keywords ***
20
+ Before Test Suite
21
+ [Documentation] Login as admin and open a page with series
22
+ Open Browser ${SITE_URL } ${BROWSER }
23
+ Register Keyword To Run On Failure Log Source
24
+ Log In As login=admin password=test
25
+ Go To ${SITE_URL } /series/1
26
+
27
+ After Test Suite
28
+ [Documentation] Log out and close browser
29
+ Log Out
30
+ Close Browser
You can’t perform that action at this time.
0 commit comments