Sponsored by Deepsite.site

Playwright Test Framework Example for AI & Playwright MCP Course by jaktestowac.pl

Created By
jaktestowac7 months ago
This repository provides an empty Playwright test framework that was designed to test AI and Playwright MCP (Model Context Protocol) in course
Content

Playwright Test Framework Example for AI & Playwright MCP Course by jaktestowac.pl

This repository provides an empty Playwright test framework that was designed to test AI and Playwright MCP (Model Context Protocol) in course

(Polish: "Playwright z AI – czyli jak usprawnić swoją pracę" - "Playwright with AI - how to improve your work")

by jaktestowac.pl team.

Overview

Repository contains tests for the following topics:

  • UI Tests with Page Object Model: Automated browser tests for user registration, login, and viewing articles, using Playwright and the Page Object Model pattern for maintainability.

  • API Testing: End-to-end API tests for health, about, users, including user registration, login and viewing articles.

  • Fixtures and Helpers: Custom Playwright fixtures for page objects to promote code reuse and clarity.

  • Test Reporting and Configuration: Example Playwright configuration for multiple reporters (HTML, JUnit, JSON), test directory structure, and device emulation.

Tests and Covered Areas

The repository includes the following test files and their coverage:

  • tests/register.spec.ts: UI test for user registration and login with unique credentials.
  • tests/login.spec.ts: UI test for logging in with valid credentials.
  • tests/articles.spec.ts: UI test for viewing articles as a guest user.
  • tests/logged-articles.spec.ts: UI test for viewing articles as a logged-in user.

These tests cover:

  • User registration and authentication flows
  • Viewing articles (both as guest and logged-in user)

Who we are?

We are Test Architects and Senior Lead Tech Quality Engineers, who are passionate about testing. We are constantly looking for new ways to improve our skills and share our knowledge with others.

We are actively involved in the Playwright community, contributing to the project and sharing our knowledge with others. We have been using Playwright in different companies and projects since 2021.

We believe in the power of open source and the importance of giving back to the community.

Read more about our Contribution to Playwright and Community

Prerequisites

Before you start, make sure you have the following installed:

Project Structure

Test files are located in the tests directory. Each test file contains a set of tests that cover a specific functionality or feature of the application.

Configuration in file playwright.config.ts contain all global settings for project.

Setup

  1. Clone the repository:

    git clone https://github.com/jaktestowac/playwright-test-framework-mcp-example.git
    cd playwright-test-framework-mcp-example
    
  2. Install dependencies:

    npm install
    
  3. Optionally install Playwright browsers:

    npx playwright install
    
  4. Optionally install extensions for VSCode:

Navigate to "Extensions" tab in VSCode, filter extensions using "@recommended" filter

Running Tests

Run all tests:

npm run test

Run specific test file:

npx playwright test tests/login.spec.ts

Run tests with UI mode:

npx playwright test --ui

Generate test report:

npx playwright show-report

Troubleshooting

Common issues and solutions:

  1. Tests fail on first run

    • Ensure 🦎 GAD application is running (by default on http://localhost:3000)
    • Check if correct Node.js version is installed
  2. Browser launch fails

    npx playwright install
    

Resources

Contact

Feel free to reach out to us:

Happy testing and automating tests!🚀

jaktestowac.pl Team 💚❤️

PS. For more resources and updates, follow us on our website and GitHub.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
CursorThe AI Code Editor
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
WindsurfThe new purpose-built IDE to harness magic
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
ChatWiseThe second fastest AI chatbot™
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Tavily Mcp
DeepChatYour AI Partner on Desktop
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Amap Maps高德地图官方 MCP Server
Serper MCP ServerA Serper MCP Server
Playwright McpPlaywright MCP server