Permalink
Browse files

modify argument label=True to value=False

modify argument label=True to value=False
and the test cases.
  • Loading branch information...
1 parent f84682e commit 74049a4a214a5d8b6b0d7a153e9aa23a3789b58e @qitaos qitaos committed Jan 11, 2017
Showing with 19 additions and 19 deletions.
  1. +7 −7 src/Selenium2Library/keywords/_selectelement.py
  2. +12 −12 test/acceptance/keywords/lists.robot
@@ -8,24 +8,24 @@ class _SelectElementKeywords(KeywordGroup):
# Public
- def get_list_items(self, locator, label=True):
- """Returns the labels or values in the select list identified by `locator`.
+ def get_list_items(self, locator, value=False):
+ """Returns the values or labels in the select list identified by `locator`.
Select list keywords work on both lists and combo boxes. Key attributes for
select lists are `id` and `name`. See `introduction` for details about
locating elements.
Sample:
| ${labels1} = | Get List Items | xpath=//h1 |
- | ${labels2} = | Get List Items | xpath=//h1 | label=${True} |
- | ${values} = | Get List Items | xpath=//h1 | label=${False} |
+ | ${labels2} = | Get List Items | xpath=//h1 | value=${False} |
+ | ${values} = | Get List Items | xpath=//h1 | value=${True} |
| Should Be Equal | ${labels1} | ${labels2} |
"""
select, options = self._get_select_list_options(locator)
- if label:
- return self._get_labels_for_options(options)
- else:
+ if value:
return self._get_values_for_options(options)
+ else:
+ return self._get_labels_for_options(options)
def get_selected_list_label(self, locator):
"""Returns the visible label of the selected element from the select list identified by `locator`.
@@ -17,6 +17,18 @@ Get List Items From Multi-Select List
${expected}= Create List Males Females Others
Should Be Equal ${items} ${expected}
+Get List Values From Single-Select List
+ [Documentation] Get List Values From Single-Select List
+ ${values}= Get List Items preferred_channel value=${True}
+ ${expected}= Create List email phone directmail
+ Should Be Equal ${values} ${expected}
+
+Get List Values From Multi-Select List
+ [Documentation] Get List Values From Multi-Select List
+ ${values}= Get List Items interests value=${True}
+ ${expected}= Create List males females others
+ Should Be Equal ${values} ${expected}
+
Get Selected List Value
[Documentation] Get Selected List Value
${selected}= Get Selected List Value preferred_channel
@@ -148,18 +160,6 @@ List Should Have No Selections
... List 'interests' should have had no selection (selection was [ Males | Females | Others ])
... List Should Have No Selections interests
-Get List Values From Single-Select List
- [Documentation] Get List Values From Single-Select List
- ${values}= Get List Items preferred_channel label=${False}
- ${expected}= Create List email phone directmail
- Should Be Equal ${values} ${expected}
-
-Get List Values From Multi-Select List
- [Documentation] Get List Values From Multi-Select List
- ${values}= Get List Items interests label=${False}
- ${expected}= Create List males females others
- Should Be Equal ${values} ${expected}
-
*** Keywords ***
Unselect And Verify Selection
[Documentation] Unselect And Verify Selection

0 comments on commit 74049a4

Please sign in to comment.