Token导航 LogoToken导航TokenDH.com
MCP Playwright Test logo
浏览器工具stdio官方级别未说明来源级核验

MCP Playwright Test

MCP Server

playwright

一个基于Playwright的测试自动化框架,提供模块化结构、环境变量管理、自动截图和代码生成等功能,适用于Web应用的自动化测试。

工具数

0

提示词数

0

GitHub Stars

4

资源数

0
浏览器自动化测试自动化JavaScript

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

fabioaraujoqa

提供方

fabioaraujoqa

最后核验

2026/5/17 20:21

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx playwright install

详细介绍

MCP Playwright Test

Automação de testes com Playwright + MCP (Model Context Protocol) - Padrões de qualidade e boas práticas

](https://nodejs.org/) ![Playwright](https://playwright.dev/) ![License](#license)


📋 Visão Geral

Este projeto é um template de qualidade para automação de testes com Playwright, seguindo boas práticas, padrões robustos e estrutura profissional.

Recursos principais:

  • ✅ Padrões robustos de seletores (Prioridade 1, 2, 3)
  • ✅ Variáveis de ambiente seguras (.env.*)
  • ✅ Helper de evidências (screenshots automáticas)
  • ✅ Estrutura modular e escalável
  • ✅ Documentação completa em docs/
  • ✅ Exemplos prontos para usar
  • ✅ Scripts npm otimizados
  • ✅ Configuração do Playwright pré-definida

🚀 Quick Start

1️⃣ Instalação

# Clonar ou baixar repositório
git clone 
cd mcp-playwright-test

# Instalar dependências
npm install

# Instalar browsers do Playwright
npx playwright install

2️⃣ Configurar Variáveis de Ambiente

# Copiar template
cp .env.example .env.sistema1

# Editar com suas credenciais
code .env.sistema1

Arquivo .env.sistema1:

SISTEMA_BASE_URL=https://sua-app.com.br
SISTEMA_USER=seu_usuario@example.com
SISTEMA_PASSWORD=sua_senha_123

3️⃣ Executar Testes

# Todos os testes
npm test

# Com interface gráfica
npm run test:headed

# Modo debug
npm run test:debug

# Interface visual
npm run test:ui

4️⃣ Gravar Testes com Codegen

O Codegen abre o navegador e gera código Playwright automaticamente conforme você interage com a página:

# Abre o navegador + painel de gravação
npm run test:codegen

# Ou já com uma URL específica
npm run test:codegen -- https://sua-app.com.br

Copie o código gerado para o seu arquivo .spec.js.

5️⃣ Ver Relatório

npm run test:report

📁 Estrutura do Projeto

mcp-playwright-test/
├── docs/                          # Documentação completa
│   ├── 00-ARQUITETURA.md         # Estrutura, convenções e como adicionar domínios
│   ├── 01-BOAS_PRATICAS.md       # Padrões de código, viewport, evidências
│   ├── 02-SELETORES_ROBUSTOS.md  # Estratégias de seletores
│   ├── 03-VARIAVEIS_AMBIENTE.md  # Configuração de .env.*
│   └── 04-CHECKLIST_QUALIDADE.md # Checklist antes de subir o teste
├── tests/
│   ├── helpers/
│   │   └── evidencia-helper.js   # Screenshots + loadEnv + validateEnv
│   ├── _templates/
│   │   └── exemplo-login.spec.js # Template para novos testes (não executado)
│   ├── devreferencias/           # Testes do devreferencias.com.br
│   ├── fiap/                     # Testes do fiap.com.br
│   ├── hub-leitura/              # Testes do hub-de-leitura.vercel.app
│   └── evidencias/               # Screenshots gerados (não sobe no Git)
├── scripts/
│   ├── setup.sh                  # Setup inicial
│   └── run-tests.sh              # Menu interativo
├── .env.example                  # Template de variáveis de ambiente
├── playwright.config.js
└── jsconfig.json

📚 Documentação


🎯 Exemplo Rápido

test('login bem-sucedido', async ({ page }, testInfo) => {
  const tiraFoto = await createEvidenciaHelper(page, testInfo);

  await page.goto('https://app.com');
  await page.getByLabel(/email/i).fill('user@example.com');
  await page.getByLabel(/senha/i).fill('password');
  await page.getByRole('button', { name: /entrar/i }).click();

  await expect(page).toHaveURL(/dashboard/);
  await tiraFoto('login-sucesso');
});

🛠️ Scripts npm

npm test                    # Rodar todos os testes
npm run test:headed         # Com navegador visível
npm run test:debug          # Modo debug
npm run test:ui             # Interface visual
npm run test:report         # Relatório HTML
npm run test:codegen        # Gravar ações e gerar código
npm run install:browsers    # Instalar browsers
npm run lint                # Code style
npm run format              # Formatar código

🔒 Segurança

  • ✅ Credenciais em .env.* (não commitar)
  • ✅ Usar .env.example como template
  • ✅ Compartilhar credenciais por canais seguros
  • ✅ Nenhuma credencial hardcoded no código

🚨 Troubleshooting

# Instalar dependências
npm install

# Instalar browsers
npx playwright install

# Copiar template de ambiente
cp .env.example .env.sistema1

📄 Referências


Desenvolvido com ❤️ usando Playwright + MCP

目录标签

目录标签

浏览器自动化测试自动化JavaScript本地部署Web测试Playwright模块化测试环境变量管理

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

session

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

playwright

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiosession部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP