File tree 2 files changed +20
-4
lines changed
main/java/ru/mystamps/web/model
test/robotframework/country/creation 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 27
27
import lombok .Setter ;
28
28
29
29
import ru .mystamps .web .service .dto .AddCountryDto ;
30
+ import ru .mystamps .web .validation .jsr303 .DenyValues ;
30
31
import ru .mystamps .web .validation .jsr303 .UniqueCountryName ;
31
32
import ru .mystamps .web .validation .jsr303 .UniqueCountryName .Lang ;
32
33
import ru .mystamps .web .validation .jsr303 .UniqueCountrySlug ;
48
49
Group .Level4 .class ,
49
50
Group .Level5 .class ,
50
51
Group .Level6 .class ,
51
- Group .Level7 .class
52
+ Group .Level7 .class ,
53
+ Group .Level8 .class
52
54
})
53
55
public class AddCountryForm implements AddCountryDto {
54
56
@@ -82,8 +84,9 @@ public class AddCountryForm implements AddCountryDto {
82
84
groups = Group .Level5 .class
83
85
)
84
86
})
85
- @ UniqueCountryName (lang = Lang .EN , groups = Group .Level6 .class )
86
- @ UniqueCountrySlug (groups = Group .Level7 .class )
87
+ @ DenyValues (value = {"add" , "list" }, groups = Group .Level6 .class )
88
+ @ UniqueCountryName (lang = Lang .EN , groups = Group .Level7 .class )
89
+ @ UniqueCountrySlug (groups = Group .Level8 .class )
87
90
private String name ;
88
91
89
92
@ Size .List ({
@@ -115,7 +118,7 @@ public class AddCountryForm implements AddCountryDto {
115
118
groups = Group .Level5 .class
116
119
)
117
120
})
118
- @ UniqueCountryName (lang = Lang .RU , groups = Group .Level6 .class )
121
+ @ UniqueCountryName (lang = Lang .RU , groups = Group .Level7 .class )
119
122
private String nameRu ;
120
123
121
124
}
Original file line number Diff line number Diff line change @@ -79,6 +79,19 @@ Create country with non-existing name but existing slug
79
79
Clear Element Text id=nameRu
80
80
Submit Form id=add-country-form
81
81
Element Text Should Be id=name.errors Country with similar name already exists
82
+
83
+ Create country with forbidden names
84
+ [Documentation] Verify validation of forbidden names
85
+ # Open a page again to have a clean state (nameRu field has an invalid value)
86
+ Go To ${SITE_URL } /country/add
87
+ # 'add' is a forbidden value
88
+ Input Text id=name add
89
+ Submit Form id=add-country-form
90
+ Element Text Should Be id=name.errors Invalid value
91
+ # 'list' is a forbidden value
92
+ Input Text id=name list
93
+ Submit Form id=add-country-form
94
+ Element Text Should Be id=name.errors Invalid value
82
95
83
96
*** Keywords ***
84
97
Before Test Suite
You can’t perform that action at this time.
0 commit comments