MCPcopy
hub / github.com/streamlit/streamlit / get_date_input

Function get_date_input

e2e_playwright/shared/app_utils.py:305–330  ·  view source on GitHub ↗

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])

Source from the content-addressed store, hash-verified

303
304
305def 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
333def get_slider(locator: Locator | Page, label: str | re.Pattern[str]) -> Locator:

Calls 2

get_by_textMethod · 0.80
get_by_test_idMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…