Get a date input with the given label. Parameters ---------- locator : Locator | Page The locator to search for the element. label : str or Pattern[str] The label of the element to get. Returns ------- Locator The element.
(locator: Locator | Page, label: str | re.Pattern[str])
| 303 | |
| 304 | |
| 305 | def get_date_input(locator: Locator | Page, label: str | re.Pattern[str]) -> Locator: |
| 306 | """Get a date input with the given label. |
| 307 | |
| 308 | Parameters |
| 309 | ---------- |
| 310 | locator : Locator | Page |
| 311 | The locator to search for the element. |
| 312 | |
| 313 | label : str or Pattern[str] |
| 314 | The label of the element to get. |
| 315 | |
| 316 | Returns |
| 317 | ------- |
| 318 | Locator |
| 319 | The element. |
| 320 | """ |
| 321 | if isinstance(label, re.Pattern): |
| 322 | label_locator = locator.get_by_test_id("stWidgetLabel").filter(has_text=label) |
| 323 | else: |
| 324 | label_locator = locator.get_by_test_id("stWidgetLabel").get_by_text( |
| 325 | label, exact=True |
| 326 | ) |
| 327 | |
| 328 | element = locator.get_by_test_id("stDateInput").filter(has=label_locator) |
| 329 | expect(element).to_be_visible() |
| 330 | return element |
| 331 | |
| 332 | |
| 333 | def get_slider(locator: Locator | Page, label: str | re.Pattern[str]) -> Locator: |
searching dependent graphs…