{"id":13583261,"url":"https://github.com/prprprus/softest","last_synced_at":"2025-04-07T06:08:07.367Z","repository":{"id":46161307,"uuid":"198222171","full_name":"prprprus/softest","owner":"prprprus","description":"Recording Browser Interactions And Generating Test Scripts.","archived":false,"fork":false,"pushed_at":"2024-06-22T03:53:41.000Z","size":142928,"stargazers_count":225,"open_issues_count":14,"forks_count":24,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T21:09:58.346Z","etag":null,"topics":["automated-test","e2e-tests","generating-scripts","playback","puppeteer","record","test"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prprprus.png","metadata":{"files":{"readme":"README-zh.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-22T12:48:05.000Z","updated_at":"2025-03-16T03:33:49.000Z","dependencies_parsed_at":"2024-06-22T15:47:16.342Z","dependency_job_id":null,"html_url":"https://github.com/prprprus/softest","commit_stats":{"total_commits":149,"total_committers":1,"mean_commits":149.0,"dds":0.0,"last_synced_commit":"be8545f1725c2a866b9a18481704671d87844402"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prprprus%2Fsoftest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prprprus%2Fsoftest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prprprus%2Fsoftest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prprprus%2Fsoftest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prprprus","download_url":"https://codeload.github.com/prprprus/softest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601448,"owners_count":20964864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automated-test","e2e-tests","generating-scripts","playback","puppeteer","record","test"],"created_at":"2024-08-01T15:03:21.865Z","updated_at":"2025-04-07T06:08:07.347Z","avatar_url":"https://github.com/prprprus.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","others"],"sub_categories":[],"readme":"# softest\n\n\u003cimg src=\"https://i.loli.net/2019/09/21/5ybk4xDOeAgJwRL.png\" alt=\"logo\" width=\"600\"\u003e\u003c/a\u003e\n\n![build status](https://travis-ci.org/prprprus/softest.svg?branch=master)\n[![Known Vulnerabilities](https://snyk.io//test/github/prprprus/softest/badge.svg?targetFile=package.json)](https://snyk.io//test/github/prprprus/softest?targetFile=package.json)\n[![](https://img.shields.io/badge/npm-6.10.2-orange)]()\n[![license](https://img.shields.io/badge/license-license-yellow.svg)](./LICENSE)\n[![](https://img.shields.io/badge/EN-%E8%8B%B1%E6%96%87-%09%236495ED.svg)](./README.md)\n\nsoftest 是用于录制浏览器交互并生成测试脚本的测试工具，简单实用。让你不用写一行代码就可以得到测试脚本。\n\n[![softest2.png](https://i.loli.net/2019/09/21/O3kMSqW4Deny7Al.png)](https://www.bilibili.com/video/av64092242/)\n\n## 🔍 项目来由\n\n当我需要一个能够根据浏览器交互操作自动生成对应代码的工具时，找到了 [puppeteer-recorder](https://github.com/checkly/puppeteer-recorder) 和 [Selenium IDE](https://www.seleniumhq.org/selenium-ide/)，他们当然都是非常优秀的项目。但是在实际的使用中发现它们只能单 tab 录制，不支持多 tab，也不支持截图等功能，而且 Selenium IDE 在回放脚本时总是报错（应该是对滚动操作支持的问题），所以就自己造了个轮子。\n\n## 🔥 功能\n\n#### 支持的功能\n\n- 单标签页录制\n- 多标签页录制\n- 屏幕截图\n- 生成测试脚本\n- 下载测试报告（包括截图和测试脚本）\n\n#### 支持的浏览器交互\n\n- 点击\n- 新建标签页\n- 关闭标签页\n- 修改地址栏\n- 输入\n- 滚动页面\n\n标签页切换规则：暂时不支持用户手动的跨标签页切换操作。例如，现在打开了 3 个标签页，当前所在第三个标签页 tab3，此时就不可以手动地切换到 tab2 或者 tab1，因为这样会造成录制的不一致。但是你可以通过关闭 tab3 的方式回到 tab2，再关闭 tab2 回到 tab1。\n\n## ⚙️ 安装\n\n#### 依赖\n\n- Node \u003e= v10.16.3 (推荐 v12.8.0)\n- Npm (推荐 6.10.2)\n\n```bash\n$ npm i -g softest\n```\n\nsoftest 是基于 Puppeteer 构建的，而下载 Puppeteer 的时候会默认安装 Chromium。如果你在执行上面命令的时候看到下图，并且由于各种原因无法下载到 Chromium 的话，可以到[这里](https://pan.baidu.com/s/1-ejd6EsOrcYGNCrzbj1hYw)下载，提取码 4vxu（其实用 Chrome 也是可以的）。\n\n![softest3.png](https://i.loli.net/2019/09/21/fRx4vW9cXP1e73U.png)\n\n## 🚀 使用\n\n为了方便命令的执行，建议添加环境变量：\n\n```bash\n$ export PATH=$PATH:$HOME/.npm-global/bin\n```\n\n`softest` 只有少量的参数：\n\n```bash\n$ softest --help\nUsage: index [options]\n\nOptions:\n  -h, --host \u003chostname\u003e  Server hostname, optional. (default: \"127.0.0.1\")\n  -p, --port \u003cport\u003e      Server port, optional. (default: 2333)\n  -c, --chromium \u003cpath\u003e  The absolute path of the chromium execution file, necessary.\n  -r, --report \u003cpath\u003e    The absolute path of the test report, necessary.\n  -h, --help             output usage information\n```\n\n运行 `softest` 需要指定 Chromium 所在的目录，并且指定保存测试报告的目录（绝对路径）。\n\n```bash\n$ soft -c PATH_CHROMIUM -r PATH_REPORT\n```\n\n\u003e 如果你不清楚 Chromium 在哪个目录，可以启动 Chromium，在地址栏处输入 `chrome://version/` 就可以找到它的可执行文件所在的目录。\n\n如果你看到类似如下的输出，那么恭喜你成功了 🎉🎉🎉👏\n\n```bash\n _______  _______  _______  _______  _______  _______  _______\n|       ||       ||       ||       ||       ||       ||       |     status: running\n|  _____||   _   ||    ___||_     _||    ___||  _____||_     _|     host: 127.0.0.1\n| |_____ |  | |  ||   |___   |   |  |   |___ | |_____   |   |       port: 2333\n|_____  ||  |_|  ||    ___|  |   |  |    ___||_____  |  |   |\n _____| ||       ||   |      |   |  |   |___  _____| |  |   |\n|_______||_______||___|      |___|  |_______||_______|  |___|\n\n🎉 Running WebSocket server successfully\n\n🎉 Running HTTP server successfully\n```\n\n打开浏览器，输入 `host` 和 `port`，你会看到如下的 web 界面：\n\n![softest1.png](https://i.loli.net/2019/09/21/rpWZjdP5lkYwHJM.png)\n\n## ⭐️ 抬一手\n\n如果这个项目对你有所帮助或启发，请给个 ️️⭐️！\n\n## 👏 贡献\n\n如果你对该项目有任何问题或者需求，可以提交个 [issue](https://github.com/prprprus/softest/issues) 或者直接提交个 Pull Request 给我。\n\n## 🐞 报 Bug\n\n如果你发现了 bug，别犹豫，可以直接 [Issue](https://github.com/prprprus/softest/issues) 。\n\n## 📝 License\n\n详细信息请参考 [LICENSE](./LICENSE)。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprprprus%2Fsoftest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprprprus%2Fsoftest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprprprus%2Fsoftest/lists"}