|
13 | 13 | from playwright.sync_api import FilePayload, FloatRect, Locator, Page, Position |
14 | 14 | from playwright.sync_api import expect as playwright_expect |
15 | 15 |
|
16 | | -# Import `shiny`'s typing extentions. |
| 16 | +# Import `shiny`'s typing extensions. |
17 | 17 | # Since this is a private file, tell pyright to ignore the import |
18 | 18 | # (Imports split over many import statements due to auto formatting) |
19 | 19 | from shiny._typing_extensions import ( |
@@ -1090,31 +1090,29 @@ def expect_locator_values_in_list( |
1090 | 1090 | loc_container_orig = loc_container |
1091 | 1091 |
|
1092 | 1092 | # Find all items in set |
1093 | | - for item, i in zip(arr, range(len(arr))): |
1094 | | - # Get all elements of type |
1095 | | - has_locator = loc_item |
1096 | | - # Get the `n`th matching element |
1097 | | - has_locator = has_locator.nth(i) |
1098 | | - # Make sure that element has the correct attribute value |
1099 | | - has_locator = has_locator.locator( |
1100 | | - f"xpath=self::*[{_xpath_match_str(key, item)}]" |
1101 | | - ) |
1102 | | - |
1103 | | - # Given the container, make sure it contains this locator |
1104 | | - loc_container = loc_container.locator( |
1105 | | - # Return self |
1106 | | - "xpath=.", |
1107 | | - has=has_locator, |
1108 | | - ) |
1109 | | - |
1110 | | - # Make sure other items are not in set |
1111 | | - # If we know all elements are contained in the container, |
1112 | | - # and all elements all unique, then it should have a count of `len(arr)` |
| 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 | + # ) |
| 1107 | + |
| 1108 | + # Make sure other items are not in the set. |
| 1109 | + # If we know all elements are contained in the container |
| 1110 | + # and all elements are unique, then it should have a count of `len(arr)` |
1113 | 1111 | loc_inputs = loc_container.locator(loc_item) |
1114 | 1112 | try: |
1115 | 1113 | playwright_expect(loc_inputs).to_have_count(len(arr), timeout=timeout) |
1116 | 1114 | except AssertionError as e: |
1117 | | - # Debug expections |
| 1115 | + # Debug expectations |
1118 | 1116 |
|
1119 | 1117 | # Expecting container to exist (count = 1) |
1120 | 1118 | playwright_expect(loc_container_orig).to_have_count(1, timeout=timeout) |
|
0 commit comments