File tree Expand file tree Collapse file tree 1 file changed +12
-14
lines changed
Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -1090,20 +1090,18 @@ def expect_locator_values_in_list(
10901090 loc_container_orig = loc_container
10911091
10921092 # Find all items in set
1093- for i in range (len (arr )):
1094- # Get ith element of type
1095- loc_item .nth (i )
1096- # # Make sure that element has the correct attribute value
1097- # has_locator = has_locator.locator(
1098- # f"xpath=self::*[{_xpath_match_str(key, item)}]"
1099- # )
1100- #
1101- # # Given the container, make sure it contains this locator
1102- # loc_container = loc_container.locator(
1103- # # Return self
1104- # "xpath=.",
1105- # has=has_locator,
1106- # )
1093+ xpath = f"""xpath=self::*[{
1094+ " or " .join ([
1095+ _xpath_match_str (key , item )
1096+ for item in arr
1097+ ])
1098+ } ]"""
1099+
1100+ loc_container = loc_container .locator (
1101+ # Return self
1102+ "xpath=." ,
1103+ has = loc_item .locator (xpath ),
1104+ )
11071105
11081106 # Make sure other items are not in the set.
11091107 # If we know all elements are contained in the container
You can’t perform that action at this time.
0 commit comments