You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

28 lines
1.1 KiB

from __future__ import annotations
from playwright.sync_api import Page, expect
from tests.e2e.helpers import expect_sidebar_link, login
def test_admin_can_open_account_audit_and_csv_pages(
page: Page,
base_url: str,
admin_credentials: dict[str, str],
) -> None:
login(page, base_url, username=admin_credentials["username"], password=admin_credentials["password"])
expect(page).to_have_url(f"{base_url}/")
expect_sidebar_link(page, "账号管理")
page.get_by_role("link", name="账号管理").click()
expect(page.get_by_role("heading", name="账号管理")).to_be_visible()
expect(page.get_by_role("link", name="新增账号")).to_be_visible()
page.get_by_role("link", name="审计日志").click()
expect(page.get_by_role("heading", name="审计日志")).to_be_visible()
expect(page.get_by_role("button", name="筛选")).to_be_visible()
page.goto(f"{base_url}/csv/households/import")
expect(page.get_by_role("heading", name="CSV 导入导出")).to_be_visible()
expect(page.get_by_label("上传 CSV 文件")).to_be_visible()
expect(page.get_by_role("button", name="生成导入预览")).to_be_visible()