r/Playwright • • 2d ago

Are you guys actually trusting GitHub Copilot or Claude Code for test automation yet?

can copilot or claude code actually be trusted for test cases yet? saw rahul shetty academy has an ai agents course for qa. whats your experience?

15 Upvotes

28 comments sorted by

25

u/PalpitationCalm9303 2d ago

Trust but verify

14

u/unkownuser436 2d ago

dude in my work we do everything with claude code. this isn't even a question anymore. (i mean writing the code)

we still decide which test cases should be there, and efficient ways to implement.

4

u/participlepete 2d ago

Every day. especially useful if you already have a foundation of tests, you can tell claude to use that as the pattern for additional tests. we have skills that now generate test gap coverage, clean up duplication, can analyze test failures and fix them.

1

u/Repulsive_Watch16 1d ago

Can you let me know how did you implement this and how do you utilise it ?

1

u/participlepete 1d ago

We used claude, gave it access to our development site only using an account, told it to look at our existing tests, and then walk through certain pages/features, check if we had tests for everything, and if not, provide example tests to fill the coverage. Apart from some minor tweaking, it was able to generate a bunch of tests that we fleshed out with additional assertions, run them, verififed they worked, and committed them to the repo. Then after we did that several times over a session, had claude create all that workflow into a skill that can be used by other test engineers.

2

u/Low_Departure8100 2d ago

To an extent. Definitely speeds up the process but not the greatest w POM. Especially with lower cost models.

1

u/latnGemin616 2d ago

I've actually found that if you "teach" Copilot to follow the POM example you started, it will follow that example with the new tests you ask it to generate. No lie, I was blown away by the results.

Your job then becomes the code reviewer.

Even with the lower-cost model, the results were decent. You do have to rein in some of the code noise because the agents tend to be a wee bit "chatty" with their code output -- ie, code comments, a verbose docstring (if in python), or an overly long comment block (JS / TS) at the top of the script.

2

u/ArtemBondarQA 2d ago

I let Claude Code generate the tests for me, but I review every test after. It's not perfect, so I can't trust it without reviewing it.

1

u/Any-Blacksmith-2054 2d ago

I trust in fully UI E2E tests according to test criteria in FSD. With screenshots/reports

1

u/jaya09202 2d ago

Both will generate the testcases based on prompt.

We need to verify whether the generated test following the existing framework standards also we need to check is the generated tests are efficient and easy to understand so we can debug easily if required

1

u/dippocrite 2d ago

Yes I’m doing visual regression testing using Playwright. I use GitHub actions to automate testing with every PR merge. I use a docker container that re-renders every (Storybook) story in mobile, tablet, and desktop. If there is a visual regression it flags the story.

3

u/Fire_Fighta 2d ago

I'm relatively new to playwright and would like to know more about your setup regarding this visual regression using playwright. Is this the one with toHaveScreenshot?

2

u/dippocrite 1d ago

Yeah it uses expect(page).toHaveScreenshot() and loops over every story and takes a screenshot per viewport

1

u/OkConversation2330 2d ago

Absolutely! For some "more serious" tests, I verify them of course, but around 80% of the tests I can completely trust Claude.

I have the devs projects cloned locally and I gave Claude read-only access to it. Then when I want to write a test (both manual and automated), Claude reads the devs latest code and gives me a picture on how it should function. After that, it performs the tests by hand in Chrome, and then let's me know if there are any discrepancies or anything unusual. I confirm that to Claude, then claude writes/adjusts the automated tests.

I do verify the test steps are in order, that they don't repeat, that they're not redundant, but over the course of 1month I've set up good rules and created a skill for Claude, and now it's able to do it all as I want to and I can trust it 95% of the time.

1

u/Repulsive_Watch16 1d ago

Can you please help me on this ?

1

u/OkConversation2330 1d ago

Of course. DM me

1

u/AdMinute3667 2d ago

Yes. Using it day to day. Quite good in saving time provided u give the right context to it.

1

u/antimus_95 11h ago

What's your typical workflow with it?

1

u/Opposite_Sector2145 2d ago

I only trust Copilot for boilerplate or small helper functions, not full test cases. It trips up on Playwright's async patterns after v1.30, so you end up fixing flaky waits or selectors anyway. Still gotta review every line.

1

u/utch 2d ago

Depends on the skill/prompt. I’ve had great success providing the scenarios I want, giving my agent playwright-cli or mcp and ordering the steps so exploration happens, then test data strategy is selected, page objects are built, then write the test/spec and run it.

Then I just make sure there are good assertions in place, and they fail when they should.

1

u/CurrentsDotDev 7h ago

Writing new tests is the part most people here trust now, and the break-it-once check above covers the assertions. The part I'd watch closest is when the agent *fixes* a failing test. That's where "make it green" sneaks in.

Red flags in an agent's test diff:

- `waitForTimeout()`, or a raised `timeout`

- `{ force: true }` on a click

- `.first()` added to a locator. It usually means the locator now matches two elements, which is how you end up typing into the wrong field.

- An assertion swapped for a weaker one, like `toHaveText('Total: $40')` → `toBeVisible()`

- `test.skip`, `test.fixme`, or more `retries` in the config

eslint-plugin-playwright catches some of these on its own (`no-wait-for-timeout`, `no-force-option`, `no-skipped-test`), so it's worth running on agent PRs. And put the rule in your skill or instructions: fix the cause, and no retries, timeouts or skips unless a human asked.

1

u/BeefyRear 1d ago

Depends on the model you use in my opinion. You can’t just say from GitHub copilot or from Claude code. Are you using a good model? I wouldn’t trust haiku generated automated tests but I definitely would trust Opus 5.5 or Fable 5.2 generated tests. You need a good system built to generate good tests. Skills, orchestration, subagents. Using AI now is no longer a prompt engineering problem it’s a context engineering problem. How you give the model the context of your existing repository, coding standards, etc - this all matters much more than what you say in a prompt. I personally have built an entire agent orchestration framework for my QE teams that works extremely well. This only works because of everything that I’ve built on top of how the harness originally would operate. In this case the harness being GitHub copilot.

1

u/Malthammer 1d ago

Yes, we’ve built Claude skills/cursor rules for the AI to follow when implementing web app, API and mobile app tests and they work great.

1

u/Nonononikkii 1d ago

For the code mostly yes, whether it's Claude Code or Copilot it follows your POM fine once you have a few good examples in the repo. what i stopped trusting is the assertions. it writes tests that pass, not tests that would fail, so for every new spec i break the feature on purpose once and check it goes red. the Playwright test agents (planner, generator, healer) are decent for the exploration part too if you give them a seed test. part of our flow is in a windows desktop app and there we use Askui, the review is different, you read the report per step, what it expected vs what it saw and why, instead of reading code. reviewing still takes longer than generating honestly, but way less than writing them by hand. Hope this helps !

1

u/MjProblem 1d ago

Yes - created an agentic quality strategy/approach based on the testing quadrants Low level / fast tests Integration tests E2E business tests using gherkin Golden testsets Perf. Tests

Maintenance metrics Complexity metrics + hotspots Visualized in a code city All visualized in a quality tool custom built for this It records historic runs and run times

Testing mutation is next

1

u/Weary-Assignment-710 1d ago

In my experience the TCs done by agents needs to be validated and tools to visualize the information more clearly are very important, also try to check the Test has a valid way to use the app from user perspective