1、打开百度网站
from playwright.sync_api import Page
def test_baidu(page:Page):
page.goto(url="https://www.baidu.com")
page.wait_for_timeout(5_000)
page.locator('//input[@name="wd"]').fill("playwright")
page.get_by_text("百度一下").click()
2、ini插件安装:https://www.cnblogs.com/coker/p/13324946.html
第六章_pytest-playwright提供的命令行参数的使用
新建 pytest.ini 文件,输入下面代码
点击终端 terminal 对话框中,输入 pytest --help,可以查看playwright命令
[pytest] addopts: --headed --browser=firefox标签:www,playwright,六章,--,第一条,pytest,ini,编写,page From: https://www.cnblogs.com/ckapple/p/18332974