在.gitignore中添加.env文件 添加dotenv依赖管理环境变量 重构测试用例使用环境变量代替硬编码URL 在playwright配置中加载dotenv并设置baseURL
16 lines
284 B
JSON
16 lines
284 B
JSON
{
|
|
"name": "test",
|
|
"version": "1.0.0",
|
|
"main": "index.js",
|
|
"scripts": {
|
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
},
|
|
"dependencies": {
|
|
"@playwright/test": "^1.51.1",
|
|
"dotenv": "^16.5.0"
|
|
},
|
|
"author": "",
|
|
"license": "ISC",
|
|
"description": ""
|
|
}
|