HLJ 发布于
2022-11-05 11:28:49

playwright 指令

指令:

open [options] [url]                   open page in browser specified via -b, --browser
codegen [options] [url]                open page and generate code for user actions
install [options] [browser...]         ensure browsers necessary for this version of Playwright are installed
install-deps [options] [browser...]    install dependencies necessary to run browsers (will ask for sudo permissions)
cr [options] [url]                     open page in Chromium
ff [options] [url]                     open page in Firefox
wk [options] [url]                     open page in WebKit
screenshot [options] <url> <filename>  capture a page screenshot
pdf [options] <url> <filename>         save page as pdf
show-trace [options] [trace...]        show trace viewer
test [options] [test-filter...]        run tests with Playwright Test
show-report [report]                   show HTML report
help [command]                         display help for command

实例:

npx playwright open good1230.com                在浏览器中打开页面
npx playwright codegen good1230.com             打开页面并为用户操作生成代码
install [options] [browser...]                  确保安装了此版本的剧作家所需的浏览器
install-deps [options] [browser...]             安装运行浏览器所需的依赖项(将请求 sudo 权限)
npx playwright cr good1230.com                  在谷歌中打开页面
npx playwright ff good1230.com                  在火狐中打开页面
npx playwright wk good1230.com                  在 WebKit 中打开页面
npx playwright screenshot good1230.com 123.png  捕获页面屏幕截图
npx playwright pdf good1230.com 123.pdf         将页面另存为 PDF
npx playwright show-trace trace123.zip          显示跟踪查看器
npx playwright test                             运行测试
npx playwright show-report 目录                 显示HTML报告
npx playwright help                             显示命令的帮助

https://playwright.dev/docs/intro

当前文章内容为原创转载请注明出处:http://www.good1230.com/detail/2022-11-05/613.html
最后生成于 2022-11-21 22:22:36