Skip to content

Commit 7726bba

Browse files
committed
refactor: move "Country Field Should Have Option" to selenium.utils.robot
No functional changes.
1 parent dd762ea commit 7726bba

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,3 @@ Before Test Suite
3636

3737
Before Test
3838
Go To ${SITE_URL}/country/add
39-
40-
Country Field Should Have Option
41-
[Documentation] Verify the selection of the select list that is using selectize.js
42-
[Arguments] ${value}
43-
# We can't use "List Selection Should Be" because
44-
# 1) it doesn't work with invisible elements (and selectize.js makes field invisible)
45-
# 2) selectize.js dynamically creates list of countries only when we're clicking on the field
46-
Click Element id=country-selectized
47-
${dropdownXpath}= Set Variable //*[contains(@class, "selectize-dropdown-content")]
48-
Wait Until Page Contains Element xpath=${dropdownXpath}/*[contains(@class, "option")]
49-
Xpath Should Match X Times xpath=${dropdownXpath}/*[text() = "${value}"] expectedXpathCount=1

src/test/robotframework/selenium.utils.robot

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ Select Country
3939
Wait Until Page Contains Element xpath=${countryOption}
4040
Click Element xpath=${countryOption}
4141

42+
Country Field Should Have Option
43+
[Documentation] Verify the selection of the select list that is using selectize.js
44+
[Arguments] ${value}
45+
# We can't use "List Selection Should Be" because
46+
# 1) it doesn't work with invisible elements (and selectize.js makes field invisible)
47+
# 2) selectize.js dynamically creates list of countries only when we're clicking on the field
48+
Click Element id=country-selectized
49+
${dropdownXpath}= Set Variable //*[contains(@class, "selectize-dropdown-content")]
50+
Wait Until Page Contains Element xpath=${dropdownXpath}/*[contains(@class, "option")]
51+
Xpath Should Match X Times xpath=${dropdownXpath}/*[text() = "${value}"] expectedXpathCount=1
52+
4253
Link Should Point To
4354
[Documentation] Verify that "href" attribute of the element refers to a link
4455
[Arguments] ${locator} ${expectedUrl}

0 commit comments

Comments
 (0)