Skip to content

Commit b461334

Browse files
committed
WhenAdminAddCountry.countryName{En,Ru}ShouldNotBeTooLong: port to Robot Framework.
Addressed to #530 No functional changes.
1 parent a7e9c31 commit b461334

File tree

2 files changed

+10
-21
lines changed

2 files changed

+10
-21
lines changed

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

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838

3939
import static ru.mystamps.web.tests.TranslationUtils.tr;
4040
import static ru.mystamps.web.tests.fest.PageWithFormAssert.assertThat;
41-
import static ru.mystamps.web.validation.ValidationRules.COUNTRY_NAME_MAX_LENGTH;
4241

4342
public class WhenAdminAddCountry extends WhenAnyUserAtAnyPageWithForm<AddCountryPage> {
4443

@@ -83,26 +82,6 @@ public void shouldHaveStandardStructure() {
8382
checkStandardStructure();
8483
}
8584

86-
@Test(groups = "invalid", dependsOnGroups = "std")
87-
public void countryNameEnShouldNotBeTooLong() {
88-
String longCountryName = StringUtils.repeat("e", COUNTRY_NAME_MAX_LENGTH + 1);
89-
page.addCountry(longCountryName, TEST_COUNTRY_NAME_RU);
90-
91-
assertThat(page)
92-
.field("name")
93-
.hasError(tr("value.too-long", COUNTRY_NAME_MAX_LENGTH));
94-
}
95-
96-
@Test(groups = "invalid", dependsOnGroups = "std")
97-
public void countryNameRuShouldNotBeTooLong() {
98-
String longCountryName = StringUtils.repeat("я", COUNTRY_NAME_MAX_LENGTH + 1);
99-
page.addCountry(TEST_COUNTRY_NAME_EN, longCountryName);
100-
101-
assertThat(page)
102-
.field("nameRu")
103-
.hasError(tr("value.too-long", COUNTRY_NAME_MAX_LENGTH));
104-
}
105-
10685
@Test(groups = "invalid", dependsOnGroups = "std")
10786
public void countryNameEnShouldBeUnique() {
10887
page.addCountry(existingCountryNameEn, TEST_COUNTRY_NAME_RU);

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ Create country with too short name
1515
Element Text Should Be id=name.errors Value is less than allowable minimum of 3 characters
1616
Element Text Should Be id=nameRu.errors Value is less than allowable minimum of 3 characters
1717

18+
Create country with too long name
19+
[Documentation] Verify validation of too long name
20+
${englishLetter}= Set Variable j
21+
${russianLetter}= Set Variable я
22+
Input Text id=name ${englishLetter * 51}
23+
Input Text id=nameRu ${russianLetter * 51}
24+
Submit Form id=add-country-form
25+
Element Text Should Be id=name.errors Value is greater than allowable maximum of 50 characters
26+
Element Text Should Be id=nameRu.errors Value is greater than allowable maximum of 50 characters
27+
1828
*** Keywords ***
1929
Before Test Suite
2030
[Documentation] Open browsers, register fail hook and login as admin

0 commit comments

Comments
 (0)