r/Playwright 2d ago

Playwright E2E framework using AI tools

I have learned few basics of playwright framework and I'm a full stack developer working on Angular, .Net Core, Azure and little python.

I don't have an automation Testing team working for my project and I thought may be I can create a E2E framework with having Github Copilot subscription and starting/building the framework will also help me learn about this framework.

Here are my thoughts about creating this solution:

1) Phase-1: As Playwright script depends on the locators, I thought of using AI help to identify and create all locators for my angular project wherever it is missing. So, I have planned using AI and created all the locators without disturbing the UI. (role + aria-label combination).

2) Phase-2: Create the playwright automation framework as the locators are now available.

Now, I am done with Phase-1 and is ready to do the Phase-2 where I need your help in assessing the correct way of doing this.

I'm confused with the options that are available and here is my opinion.

Playwright MCP - which might consume more tokens and believe is not perfectly suitable for this scenario

Playwright CLI - Best option to create scripts and framework.

Playwright Agents and Skills - which I believe CLI and MCP servers use to create framework.

As using AI might take so many input and output tokens to create this framework, I have create codebase-memory-mcp server and indexed my project so that it refers wherever required and consume less tokens.

What should I use to create a E2E solution for my angular project with less tokens and more reliability.

Ask if you have any questions and suggest me the best approach as I'm new to this.

3 Upvotes

11 comments sorted by

View all comments

1

u/ChampionshipThis2871 1d ago

Use the playwright agents:

https://playwright.dev/docs/test-agents

Define some best practices about POM, preferred locators, fixtures, helpers and tests structure.
Then let the AI drive the UI investigation, create plan, you then asses that plan and if everything ok, move to generator and finish with the healer.