diff --git a/tests/test_ui.py b/tests/test_ui.py index a35dd0a..cd431fa 100644 --- a/tests/test_ui.py +++ b/tests/test_ui.py @@ -505,19 +505,21 @@ def test_server_status(page: Page, kea: KeaClient) -> None: def test_dhcp_subnets( page: Page, kea: KeaClient, family: str, subnets: Sequence[str] ) -> None: - page.get_by_role("link", name=f"DHCPv{family} Subnets").click() + for i, s in enumerate(subnets): + page.get_by_role("link", name=f"DHCPv{family} Subnets").click() + rows = page.locator("table > tbody > tr") + tds = rows.nth(i).locator("td") - locator = page.locator(".tab-content") - for s in subnets: - expect(locator).to_contain_text(s) + # Check Subnet column data + expect(tds.nth(0)).to_contain_text(s) - with page.expect_response(re.compile(f"/leases{family}/")) as r: - page.get_by_role("link", name=subnets[0]).click() - assert r.value.ok - expect(page.locator("#lease-search #id_q")).to_have_value(subnets[0]) - expect(page.locator("div.ss-single-selected > span.placeholder")).to_have_text( - "Subnet" - ) + with page.expect_response(re.compile(f"/leases{family}/")) as r: + page.get_by_role("link", name=s).click() + assert r.value.ok + expect(page.locator("#lease-search #id_q")).to_have_value(s) + expect(page.locator("div.ss-single-selected > span.placeholder")).to_have_text( + "Subnet" + ) @pytest.mark.parametrize("family", (4, 6)) @@ -529,6 +531,11 @@ def test_dhcp_subnets_configure_table(page: Page, kea: KeaClient, family: int) - ["Subnet", ""] ) + configure_table(page, "subnet", "shared_network_name") + expect(page.locator(".object-list > thead > tr > th > a")).to_have_text( + ["Subnet", "Shared Network Name", ""] + ) + @pytest.mark.parametrize( ("version", "by", "q"),