Skip to content

Commit a42cd59

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

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
import static ru.mystamps.web.tests.TranslationUtils.tr;
3434
import static ru.mystamps.web.tests.fest.PageWithFormAssert.assertThat;
35-
import static ru.mystamps.web.validation.ValidationRules.CATEGORY_NAME_MAX_LENGTH;
3635

3736
public class WhenAdminAddCategory extends WhenAnyUserAtAnyPageWithForm<AddCategoryPage> {
3837

@@ -77,22 +76,6 @@ public void shouldHaveStandardStructure() {
7776
checkStandardStructure();
7877
}
7978

80-
@Test(groups = "invalid", dependsOnGroups = "std")
81-
public void categoryNameEnShouldNotBeTooLong() {
82-
String longCategoryName = StringUtils.repeat("e", CATEGORY_NAME_MAX_LENGTH + 1);
83-
page.addCategory(longCategoryName, TEST_CATEGORY_NAME_RU);
84-
85-
assertThat(page).field("name").hasError(tr("value.too-long", CATEGORY_NAME_MAX_LENGTH));
86-
}
87-
88-
@Test(groups = "invalid", dependsOnGroups = "std")
89-
public void categoryNameRuShouldNotBeTooLong() {
90-
String longCategoryName = StringUtils.repeat("я", CATEGORY_NAME_MAX_LENGTH + 1);
91-
page.addCategory(TEST_CATEGORY_NAME_EN, longCategoryName);
92-
93-
assertThat(page).field("nameRu").hasError(tr("value.too-long", CATEGORY_NAME_MAX_LENGTH));
94-
}
95-
9679
@Test(groups = "invalid", dependsOnGroups = "std")
9780
public void categoryNameEnShouldBeUnique() {
9881
page.addCategory(existingCategoryNameEn, TEST_CATEGORY_NAME_RU);

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ Create category 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 category 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-category-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)