Skip to content

Commit 8b2758b

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

File tree

2 files changed

+44
-15
lines changed

2 files changed

+44
-15
lines changed

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import static ru.mystamps.web.tests.TranslationUtils.tr;
3434
import static ru.mystamps.web.tests.fest.PageWithFormAssert.assertThat;
3535
import static ru.mystamps.web.validation.ValidationRules.CATEGORY_NAME_MAX_LENGTH;
36-
import static ru.mystamps.web.validation.ValidationRules.CATEGORY_NAME_MIN_LENGTH;
3736

3837
public class WhenAdminAddCategory extends WhenAnyUserAtAnyPageWithForm<AddCategoryPage> {
3938

@@ -78,20 +77,6 @@ public void shouldHaveStandardStructure() {
7877
checkStandardStructure();
7978
}
8079

81-
@Test(groups = "invalid", dependsOnGroups = "std")
82-
public void categoryNameEnShouldNotBeTooShort() {
83-
page.addCategory("ee", TEST_CATEGORY_NAME_RU);
84-
85-
assertThat(page).field("name").hasError(tr("value.too-short", CATEGORY_NAME_MIN_LENGTH));
86-
}
87-
88-
@Test(groups = "invalid", dependsOnGroups = "std")
89-
public void categoryNameRuShouldNotBeTooShort() {
90-
page.addCategory(TEST_CATEGORY_NAME_EN, "яя");
91-
92-
assertThat(page).field("nameRu").hasError(tr("value.too-short", CATEGORY_NAME_MIN_LENGTH));
93-
}
94-
9580
@Test(groups = "invalid", dependsOnGroups = "std")
9681
public void categoryNameEnShouldNotBeTooLong() {
9782
String longCategoryName = StringUtils.repeat("e", CATEGORY_NAME_MAX_LENGTH + 1);
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
*** Settings ***
2+
Documentation Verify category creation validation scenarios
3+
Library Selenium2Library
4+
Suite Setup Before Test Suite
5+
Suite Teardown After Test Suite
6+
Test Setup Before Test
7+
Force Tags Category Validation
8+
9+
*** Test Cases ***
10+
Create category with too short name
11+
[Documentation] Verify validation of too short name
12+
Input Text id=name jj
13+
Input Text id=nameRu яя
14+
Submit Form id=add-category-form
15+
Element Text Should Be id=name.errors Value is less than allowable minimum of 3 characters
16+
Element Text Should Be id=nameRu.errors Value is less than allowable minimum of 3 characters
17+
18+
*** Keywords ***
19+
Before Test Suite
20+
[Documentation] Open browsers, register fail hook and login as admin
21+
Open Browser ${SITE_URL} ${BROWSER}
22+
Register Keyword To Run On Failure Log Source
23+
Log In As login=admin password=test
24+
25+
Before Test
26+
[Documentation] Open create category page
27+
Go To ${SITE_URL}/category/add
28+
29+
After Test Suite
30+
[Documentation] Log out and close browser
31+
Log Out
32+
Close Browser
33+
34+
Log In As
35+
[Documentation] Log in as a user
36+
[Arguments] ${login} ${password}
37+
Go To ${SITE_URL}/account/auth
38+
Input Text id=login ${login}
39+
Input Password id=password ${password}
40+
Submit Form id=auth-account-form
41+
42+
Log Out
43+
[Documentation] Log out current user
44+
Submit Form id=logout-form

0 commit comments

Comments
 (0)