Back to MCP directory
publicPublicdnsLocal runtime

playwright-mcp-project

一个展示如何在Jenkins流水线中使用Playwright MCP服务器的项目

article

README

🚀 Playwright MCP 项目

本项目展示了 Playwright MCP 服务器的使用方法,并将其与 Jenkins 管道相结合,为测试流程的自动化和持续集成提供了有效的解决方案。

🚀 快速开始

先决条件

  • 已在您机器上安装 Node.js。
  • npm(Node 包管理器)随附于 Node.js。

安装

  1. 克隆仓库:
    git clone https://github.com/vikaskumarprofessional92/playwright-mcp-project.git
    cd playwright-mcp-project
    
  2. 安装依赖项:
    npm install
    
  3. 设置 Playwright MCP 服务器:
    • 确保您的 settings.json 文件配置了 Playwright MCP 服务器,如下所示:
      {
        "mcpServers": {
          "playwright": {
            "command": "npx",
            "args": [
              "@playwright/mcp@latest",
              "--vision"
            ]
          }
        }
      }
      

运行测试

要运行测试,请使用以下命令:

npx playwright test

测试规范

测试规范可在 src/tests/example.spec.ts 文件中找到。该文件包含一个测试套件,其中包括打开浏览器并导航到 Google.ca 网站的测试用例。

Jenkins 集成

此项目包括 Jenkins 管道配置用于持续集成。管道已配置为:

  • 安装依赖项
  • 运行测试
  • 生成并发布测试报告

📄 许可证

本项目采用 MIT 许可证。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client