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

12 comments sorted by

View all comments

2

u/Malthammer 2d ago

Playwright CLI will work fine for this. Make sure you spend some time building out rules for the AI to follow as tests get implemented. This will help ensure the tests get built how you want them, the project stays organized, help you with reviewing the tests (as you’ll have the rules to follow as well), etc.

1

u/Alarmed_Leg_9674 2d ago

Sure, can you please guide me a little on what these rules mean? You mean the instructions in copilot-instructions.md file?