Skip to content

Commit 048b6ab

Browse files
committed
WhenAdminAddCountry.countryName{En,Ru}ShouldBeUnique: port to Robot Framework.
Addressed to #530 No functional changes.
1 parent a7bfc12 commit 048b6ab

File tree

2 files changed

+8
-24
lines changed

2 files changed

+8
-24
lines changed

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ public class WhenAdminAddCountry extends WhenAnyUserAtAnyPageWithForm<AddCountry
5050
@Value("${valid_admin_password}")
5151
private String validAdminPassword;
5252

53-
@Value("${valid_country_name_en}")
54-
private String existingCountryNameEn;
55-
56-
@Value("${valid_country_name_ru}")
57-
private String existingCountryNameRu;
58-
5953
public WhenAdminAddCountry() {
6054
super(AddCountryPage.class);
6155
hasTitle(tr("t_add_country"));
@@ -82,24 +76,6 @@ public void shouldHaveStandardStructure() {
8276
checkStandardStructure();
8377
}
8478

85-
@Test(groups = "invalid", dependsOnGroups = "std")
86-
public void countryNameEnShouldBeUnique() {
87-
page.addCountry(existingCountryNameEn, TEST_COUNTRY_NAME_RU);
88-
89-
assertThat(page)
90-
.field("name")
91-
.hasError(tr("ru.mystamps.web.validation.jsr303.UniqueCountryName.message"));
92-
}
93-
94-
@Test(groups = "invalid", dependsOnGroups = "std")
95-
public void countryNameRuShouldBeUnique() {
96-
page.addCountry(TEST_COUNTRY_NAME_EN, existingCountryNameRu);
97-
98-
assertThat(page)
99-
.field("nameRu")
100-
.hasError(tr("ru.mystamps.web.validation.jsr303.UniqueCountryName.message"));
101-
}
102-
10379
@Test(groups = "valid", dependsOnGroups = "std")
10480
public void countryNameEnWithAllowedCharactersShouldBeAccepted() {
10581
page.addCountry("Valid-Name Country", "НазваниеСтраны");

src/test/robotframework/country/creation/validation.robot

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ Create country with name that ends with hyphen
5757
Element Text Should Be id=name.errors Value must not start or end with hyphen
5858
Element Text Should Be id=nameRu.errors Value must not start or end with hyphen
5959

60+
Create country with existing name
61+
[Documentation] Verify validation of non-unique name
62+
Input Text id=name Italy
63+
Input Text id=nameRu Италия
64+
Submit Form id=add-country-form
65+
Element Text Should Be id=name.errors Country already exists
66+
Element Text Should Be id=nameRu.errors Country already exists
67+
6068
*** Keywords ***
6169
Before Test Suite
6270
[Documentation] Open browsers, register fail hook and login as admin

0 commit comments

Comments
 (0)