scroll_component
django_spire.testing.playwright.components.scroll_component
SCROLL_SELECTOR = '[data-scroll-component]'
module-attribute
ScrollComponent
Playwright component for django_spire/component/scroll/scroll.html, the scroll a BaseScrollComponent renders.
Row markup belongs to the consumer, so pass the selector matching one row of the page under test. The first scroll on the page is used unless root_selector names the element that carries a particular scroll's x-data:
scroll = ScrollComponent(page, row_selector='tbody tr[data-scroll-key]')
scroll.scroll_until_row_count(60)
assert scroll.state()['hasMore'] is False
Source code in django_spire/testing/playwright/components/scroll_component.py
page = page
instance-attribute
row_selector = row_selector
instance-attribute
root_selector = root_selector
instance-attribute
data_expression
property
rows
property
state_expression
property
JavaScript for the scroll's state, to embed in an evaluate that must read it in the same turn as something else.
reload_items
Reload the list and return its state before it loads any further batch.