Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions panel/tests/ui/widgets/test_tabulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,9 +780,7 @@
assert not exception_handler_accumulator


@pytest.mark.parametrize("opt0", ['A', 'B'])
@pytest.mark.parametrize("opt1", ["1", "2"])
def test_tabulator_editors_nested(page, opt0, opt1):
def test_tabulator_editors_nested(page):
df = pd.DataFrame({"0": ["A"], "1": [1], "2": [None]})

options = {
Expand All @@ -801,15 +799,22 @@
cells = page.locator('.tabulator-cell.tabulator-editable')
expect(cells).to_have_count(3)

# Check the last column matches
cells.nth(2).click()
items = page.locator('.tabulator-edit-list-item')
expect(items).to_have_count(5)
item = page.locator('.tabulator-edit-list-item', has_text="4")
expect(item).to_have_count(1)

# Change the 0th column
cells.nth(0).click()
item = page.locator('.tabulator-edit-list-item', has_text=opt0)
item = page.locator('.tabulator-edit-list-item', has_text="B")
expect(item).to_have_count(1)
item.click(force=True)

# Change the 1th column
cells.nth(1).click()
item = page.locator('.tabulator-edit-list-item', has_text=opt1)
item = page.locator('.tabulator-edit-list-item', has_text="2")
expect(item).to_have_count(1)
item.click(force=True)

Expand All @@ -819,7 +824,7 @@
expect(items).to_have_count(5)

items_text = items.all_inner_texts()
expected = options[opt0][opt1] if opt0 == "B" else options[opt0]
expected = options["B"]["2"]
assert items_text == list(map(str, expected))


Expand Down Expand Up @@ -2351,7 +2356,7 @@
state.add_periodic_callback(stream_data, period=100, count=repetitions)

expected_len = len(df) * (repetitions + 1)
expect(page.locator('.tabulator-row')).to_have_count(expected_len)

Check failure on line 2359 in panel/tests/ui/widgets/test_tabulator.py

View workflow job for this annotation

GitHub Actions / ui:test-ui:ubuntu-latest

test_tabulator_streaming_default AssertionError: Locator expected to have count '12' Actual value: 3 Call log: - Expect "to_have_count" with timeout 5000ms - waiting for locator(".tabulator-row") 9 × locator resolved to 3 elements - unexpected value "3"
assert len(widget.value) == expected_len
assert widget.current_view.equals(widget.value)

Expand Down Expand Up @@ -2410,7 +2415,7 @@
state.add_periodic_callback(stream_data, period=100, count=repetitions)

# Wait until data is updated
wait_until(lambda: len(widget.value) == nrows1 + repetitions * nrows2, page)

Check failure on line 2418 in panel/tests/ui/widgets/test_tabulator.py

View workflow job for this annotation

GitHub Actions / ui:test-ui:ubuntu-latest

test_tabulator_streaming_no_follow TimeoutError: wait_until timed out in 5000 milliseconds

# Explicit wait to make sure the periodic callback has propagated
page.wait_for_timeout(500)
Expand Down
Loading