Skip to content

Commit 5610456

Browse files
committed
WhenAdminAddCategory.categoryName{En,Ru}ShouldBeUnique: port to Robot Framework.
Addressed to #530 No functional changes.
1 parent a42cd59 commit 5610456

File tree

3 files changed

+10
-25
lines changed

3 files changed

+10
-25
lines changed

src/main/resources/test/spring/test-data.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ existing_yvert_number = 99
3434
existing_gibbons_number = 99
3535

3636
# this category should always exist
37-
# (used in WhenUserAddSeries, WhenAdminAddSeries and WhenAdminAddCategory)
37+
# (used in WhenUserAddSeries, WhenAdminAddSeries and
38+
# src/test/robotframework/category/creation/validation.txt)
3839
valid_category_name_en = Sport
3940
# ATTENTION: must be encoded by native2asscii (MRESOURCES-175)
4041
valid_category_name_ru = \u0421\u043f\u043e\u0440\u0442

src/test/java/ru/mystamps/web/tests/cases/WhenAdminAddCategory.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ public class WhenAdminAddCategory extends WhenAnyUserAtAnyPageWithForm<AddCatego
4444
@Value("${valid_admin_password}")
4545
private String validAdminPassword;
4646

47-
@Value("${valid_category_name_en}")
48-
private String existingCategoryNameEn;
49-
50-
@Value("${valid_category_name_ru}")
51-
private String existingCategoryNameRu;
52-
5347
public WhenAdminAddCategory() {
5448
super(AddCategoryPage.class);
5549
hasTitle(tr("t_create_category"));
@@ -76,24 +70,6 @@ public void shouldHaveStandardStructure() {
7670
checkStandardStructure();
7771
}
7872

79-
@Test(groups = "invalid", dependsOnGroups = "std")
80-
public void categoryNameEnShouldBeUnique() {
81-
page.addCategory(existingCategoryNameEn, TEST_CATEGORY_NAME_RU);
82-
83-
assertThat(page)
84-
.field("name")
85-
.hasError(tr("ru.mystamps.web.validation.jsr303.UniqueCategoryName.message"));
86-
}
87-
88-
@Test(groups = "invalid", dependsOnGroups = "std")
89-
public void categoryNameRuShouldBeUnique() {
90-
page.addCategory(TEST_CATEGORY_NAME_EN, existingCategoryNameRu);
91-
92-
assertThat(page)
93-
.field("nameRu")
94-
.hasError(tr("ru.mystamps.web.validation.jsr303.UniqueCategoryName.message"));
95-
}
96-
9773
@Test(groups = "valid", dependsOnGroups = "std")
9874
public void categoryNameEnWithAllowedCharactersShouldBeAccepted() {
9975
page.addCategory("Valid-Name Category", "InvalidRussianCategory");

src/test/robotframework/category/creation/validation.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ Create category with too long name
2525
Element Text Should Be id=name.errors Value is greater than allowable maximum of 50 characters
2626
Element Text Should Be id=nameRu.errors Value is greater than allowable maximum of 50 characters
2727

28+
Create category with existing name
29+
[Documentation] Verify validation of non-unique name
30+
Input Text id=name Sport
31+
Input Text id=nameRu Спорт
32+
Submit Form id=add-category-form
33+
Element Text Should Be id=name.errors Category already exists
34+
Element Text Should Be id=nameRu.errors Category already exists
35+
2836
*** Keywords ***
2937
Before Test Suite
3038
[Documentation] Open browsers, register fail hook and login as admin

0 commit comments

Comments
 (0)