Skip to content

Commit df0b728

Browse files
committed
WhenAdminAddCountry.countryShouldBeAvailableForChoosingAtPageWithSeries: port to Robot Framework.
Addressed to #530 No functional changes.
1 parent 7b24278 commit df0b728

File tree

2 files changed

+18
-32
lines changed

2 files changed

+18
-32
lines changed

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

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,18 @@
2121

2222
import org.springframework.beans.factory.annotation.Value;
2323

24-
import org.testng.SkipException;
2524
import org.testng.annotations.AfterClass;
2625
import org.testng.annotations.BeforeClass;
2726
import org.testng.annotations.BeforeMethod;
2827
import org.testng.annotations.Test;
2928

30-
import org.openqa.selenium.StaleElementReferenceException;
31-
32-
import static org.fest.assertions.api.Assertions.assertThat;
33-
34-
import ru.mystamps.web.Url;
35-
import ru.mystamps.web.tests.WebDriverFactory;
3629
import ru.mystamps.web.tests.page.AddCountryPage;
37-
import ru.mystamps.web.tests.page.AddSeriesPage;
3830

3931
import static ru.mystamps.web.tests.TranslationUtils.tr;
4032
import static ru.mystamps.web.tests.fest.PageWithFormAssert.assertThat;
4133

4234
public class WhenAdminAddCountry extends WhenAnyUserAtAnyPageWithForm<AddCountryPage> {
4335

44-
private static final String TEST_COUNTRY_NAME_EN = "Russia";
45-
4636
@Value("${valid_admin_login}")
4737
private String validAdminLogin;
4838

@@ -89,23 +79,6 @@ public void countryNameRuWithAllowedCharactersShouldBeAccepted() {
8979
assertThat(page).field("nameRu").hasNoError();
9080
}
9181

92-
@Test(groups = "logic")
93-
public void countryShouldBeAvailableForChoosingAtPageWithSeries() {
94-
page.open(Url.ADD_SERIES_PAGE);
95-
96-
AddSeriesPage seriesPage = new AddSeriesPage(WebDriverFactory.getDriver());
97-
98-
try {
99-
assertThat(seriesPage.getCountryFieldValues()).contains(TEST_COUNTRY_NAME_EN);
100-
101-
} catch (StaleElementReferenceException ex) {
102-
throw new SkipException(
103-
"Skipped because it fails with StaleElementReferenceException "
104-
+ "(see #280): " + ex.getMessage()
105-
);
106-
}
107-
}
108-
10982
@Override
11083
protected void checkServerResponseCode() {
11184
// Ignore this check because server always returns 403 for anonymous user and our test suite

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

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ Force Tags country logic
88

99
*** Test Cases ***
1010
Create country with name in English
11-
[Documentation] Verify creation of country by filling only mandatory fields
12-
Input Text id=name Germany
13-
Submit Form id=add-country-form
14-
Location Should Be ${SITE_URL}/country/germany
15-
Element Text Should Be id=page-header Stamps of Germany
11+
[Documentation] Verify creation of country by filling only mandatory fields
12+
Input Text id=name Germany
13+
Submit Form id=add-country-form
14+
Location Should Be ${SITE_URL}/country/germany
15+
Element Text Should Be id=page-header Stamps of Germany
16+
Go To ${SITE_URL}/series/add
17+
Country Field Should Be Germany
1618

1719
Create country with name in English and Russian
1820
[Documentation] Verify creation of country by specifying names in 2 languages
@@ -49,3 +51,14 @@ Log In As
4951
Log Out
5052
[Documentation] Log out current user
5153
Submit Form id=logout-form
54+
55+
Country Field Should Be
56+
[Documentation] Verify the selection of the select list that is using selectize.js
57+
[Arguments] ${value}
58+
# We can't use "List Selection Should Be" because
59+
# 1) it doesn't work with invisible elements (and selectize.js makes field invisible)
60+
# 2) selectize.js dynamically creates list of countries only when we're clicking on the field
61+
Click Element id=country-selectized
62+
${fieldXpath}= Set Variable
63+
... //*[contains(@class, "selectize-dropdown-content")]/*[text() = "${value}"]
64+
Xpath Should Match X Times xpath=${fieldXpath} expectedXpathCount=1

0 commit comments

Comments
 (0)