r/Playwright • • 29d ago

Manual tester with basic coding, now expected to write Playwright tests with Claude Code. Anyone going through this, how are you doing it?

Manual tester (~5 years exp) with basic coding and have no experience with test frameworks like Playwright or Selenium.

Currently, my devs are shipping a lot faster with Claude code, and we only have 2 automation engineers. Leadership now wants us manual testers to also contribute to the automation test suite. So I looked up low-code tools, but the company already bought Claude licences, so the expectation is Claude + Playwright.

I tried writing a few tests. Claude tells me they work and they pass, but I can’t tell if the tests are good or, if they’ll break next sprint. One of our SDETs helped me review them once or twice, but I can’t keep pulling him in.

So fellow manual testers who have been through this recently:

Are you able to write automation scripts with Claude? SDET help, or trial and error with AI?

When a test breaks, who fixes and maintians it, you with Claude or the SDETs help?

Is the solution working for you, or what challenges are you facing to make it work? How do I solve them?

52 Upvotes

46 comments sorted by

2

u/the-liquidian 29d ago

What was your manager / team leads responses to these questions?

1

u/LinterCheck2026 29d ago

My manager just bluntly put it that I need to figure out and take whatever help I can get from automation folks. They feel we dont need much help with Claude and Playwright. So i am not sure with the direction. Definitely feels like its on me to figure out a path

3

u/the-liquidian 29d ago

Maybe start with talking to the devs. They might have some tips. They also need to help to produce the spec.

1

u/North_South-West 22d ago

Sounds like they are phasing out manual testing and if the manual testers cant adapt they wont be around long.

3

u/koraynar 29d ago

The reason Claude's tests pass today and break next sprint is that Claude optimizes for "make the terminal green right now"—so if a button takes 800ms to render or a selector is awkward, it will happily drop in a brittle CSS chain or a hard sleep unless you constrain it.

Here is a workflow that lets you catch 90% of those issues yourself before you ever ask an SDET for a review:

  1. **Put your SDETs' conventions into a `CLAUDE.md` file in the repo:** Ask one of your SDETs a single time: *"Which 2 test files in our repo are the best examples of how we write Playwright here?"* Then create a short `CLAUDE.md` (or prompt template) that tells Claude:

    - Always mirror the fixture and Page Object patterns in `tests/example-good.spec.ts`.

    - Only use user-facing locators (`getByRole`, `getByLabel`, `getByTestId`)—never XPath, `nth-child`, or deep CSS classes.

    - Never use `page.waitForTimeout()`.

    - Always use web-first assertions (`await expect(locator).toBeVisible()`) instead of `expect(await locator.isVisible()).toBe(true)`.

  2. **Do a 60-second "3 Red Flags" scan on the diff before trusting a green run:** Even with basic coding experience, you can check three things in the file Claude wrote:

    - **Search for `waitForTimeout`:** If it's there, tell Claude to remove it and wait on the actual UI element or API response instead.

    - **Look at the locators:** If a locator looks like `locator('div.main > div:nth-child(3) > button')`, it will break next sprint. Open `npx playwright codegen` on that page, click the element, and hand Claude the clean `getByRole(...)` locator.

    - **Check the `expect` line at the end:** Make sure the test actually asserts the business outcome (e.g., the toast message, URL change, or table row content) rather than just clicking through without verifying the result.

  3. **Run `npx playwright test <your-file> --repeat-each=5` before opening a PR:** A flaky AI test will often pass once by luck. Running it 5 times in a row (and using `npx playwright show-trace` if one fails) catches timing and race-condition bugs locally so your SDETs only review clean, stable PRs.

1

u/LinterCheck2026 29d ago

My team have also created a test review skill. So I am hoping if I follow the workflow that you suggested and let claude use that skill, i get to a decent shape in terms of test creation. Do you also help your manual testers scale up? If so, you are doing a great job

1

u/LinterCheck2026 23d ago

This makes sense for running it on my machine. What happens after the PR is merged? Does the test automatically run with every build, or do I need to do something to run them? And if it passes for me but fails there, would that be on me to fix? Is Claude good enough to figure out why it failed there, or do I need the SDETs?

1

u/Ornery-Pension7089 15d ago

I only started 1.5 years ago (and not with much training, where I work they give you a primer and the rest is done via having merge requests feedback): I think that depends on what system you use. 

We use Teamcity. The tests run twice a day automatically. If the test is designed well usually it will pass in TC but there are small things that can make them fail.

Presumably if your test has passed the PR/MR process and it's been merged in Main it's now running with the others.

Whether the test is for you to fix or not will depend on your system: we have decided that if the test was done within the last month or so it goes back to its author regardless of where it is, otherwise it depends on which shard it's in. Our test suite is split into shards and these are evenly split between Scrum teams. I check mine every morning to make sure they're green and if not I investigate, but they've been green for a fair while now as we aorked really hard to modernise tests that had been written ages ago and to fix problems that occurred only in Teamcity. 

8

u/cultofqa 28d ago

I’ve been in the industry for 20 years and am currently helping people do this successfully.
I’d be happy to jump on a zoom or something and answer any of your questions.

I’m not selling anything… I don’t want money, I want quality in my world.

1

u/oburo227 29d ago

I created a skill in claude code maybe you can study and use if you want. I’m currently using it in my part time but its as good as how you shape the app context but it will test edge cases. It’s been so good on my end that it detects things I would have missed manually.

https://github.com/fmoliva/artemis-starter-kit

1

u/LinterCheck2026 17d ago

Thanks, will try it. You said it's only as good as the app context you give it, and that's where I'm unsure. Do you feed it test cases, or mostly prompt it? And which skills helped most when you were starting?

1

u/oburo227 17d ago

At first I fed it test cases as a start to explore how I can use it. After that I manage to structure it to explore the app as well and with that ut slowly built the context. I only correct the context every now and then if it drips. So my context contains overview of the app, modules, submodules and test cases within those modules. I also added processes and navigation guides, edge cases etc. Basically i created the format of what references it will need as guide and of course context to know which is which.

1

u/Party_Vanilla_5810 26d ago

God damn it's great 🙏

1

u/sugarcaine82 29d ago

In my case, I use Claude with MCP playwright. The MCP server is just a Docker container published by Microsoft, and I map the port from the container to my machine. Claude with the Playwright MCP can access my web application and capture requests/responses from the browser, combining them with the reading of test cases I have prepared. It is pretty decent so far.

1

u/LinterCheck2026 17d ago

This is close to what I'm trying, but I'm still working out the setup since not comfortable with IDE or CLI. Are you using Claude Code in the terminal or VS Code, or the desktop app with the MCP? When you feed your test cases, is that enough, or do you add prompts on top? And before you call a test done from Claude, how do you verify before giving it for peer review? That's the part I struggle with most.

1

u/ArtemBondarQA 29d ago

You can outsource the coding, but you can't outsource the judgment. So I would recommend spending some time learning a few Playwright best practices and understanding how the framework works. Not to write the code manually, no, but to make the right decisions when you review generated code.

And yes, Claude can debug and fix tests for you, but YOU will point the direction, how you want it done, since Claude can do it many ways to please you. That's his goal: to make you happy.

So, spend couple of weeks learning Playwright, how it works, best practices etc. Then create your rules and skills around how you want things to be done in your project.

Here are the skills I have created, based on how I like things to be done. Feel free to use it: https://github.com/bondar-artem/playwright-scripting-skills

1

u/LinterCheck2026 17d ago

Agree I need the judgment part. With basic JS, Which of your skills would you pick up first? And do you feed Claude the test cases, or mostly prompt it? I'm trying to work out what works better.

1

u/Bright_worgan 29d ago

Clarifying question: Does the two SDETs review each other's code before it goes to Production?

Because if so they could create some best practises and internal standards for your Claude to follow and then review your code after you think it's ready.

1

u/LinterCheck2026 29d ago

So the only part I am aware of is the test review skill they created and they mentioned some rules they have added that I should use

1

u/Bright_worgan 29d ago

Okay then if you want to, you could add tests and use their skill and docs! If the tests then fail the next sprint that is not on you - it's on the code owner/ person you maintains the skill

1

u/Zestyclose_Web_6331 29d ago

So good man, you are getting handson experience of it. We have to make our own projects for that and than show it in interviews.

1

u/LinterCheck2026 29d ago

Didnt get you? Even for Manual tester interviews, you need to show these projects? Are you an automation engineer

1

u/Zestyclose_Web_6331 29d ago

Bro you can take it that there are no manual job posts, they will put automation tester job post and then put you into manual but interview will be for automation

2

u/No-Reaction-9364 29d ago

The tests shouldn't break that much if your framework is good. Not unless they actually change the workload. If they change the application then maybe you update your locators, but then the test should pass. 

Claude is extremely good at writing tests and building out the framework if you are using the correct model. 

1

u/XabiAlon 28d ago

If you have any manual regression tests, ask Claude to look at them first so it doesn't just write tests to pass.

The regression tests will already be based on lived experience of the system so you know the data and what needs validated is real.

1

u/Spare_Bison_1151 28d ago

Yes, you can do it. Just provide claude enough details to get the job done. Start claude in your project's folder and get cracking.

Keep asking it to use proper selector and also tell it to keep an eye on the network traffic, errors. that will give you some extra bugs.

where you reading test cases from btw ? I'm an SDET and lately is appears it doesn't matter much.

1

u/First_Hovercraft_600 28d ago

A quick way to review Claude's locators yourself, without an SDET: for each one, ask "what would a dev have to change for this to break?"

  • getByRole('button', { name: 'Save' }) breaks only if the button's text changes. That's a real change, so the test should fail.

  • .css-1x9a > div:nth-child(3) button breaks if someone adds a wrapper, reorders cards, or the CSS build regenerates class names. None of those are bugs, so that's a flaky test waiting to happen.

If the answer is "a styling or layout change", push back. Tell Claude: "no generated class names, no nth-child, no positional indexes. Anchor on text a user can see."

The hard case is when there's no clean role or label, like a pricing page with three identical "Select" buttons, or a form whose labels aren't wired to the inputs. That's where Claude reaches for nth(). You can anchor on the visible text next to the element instead:

// the "Select" button inside the card whose heading is "Pro"
page.locator(`xpath=//h3[normalize-space()='Pro']/ancestor::*[.//button][1]//button[normalize-space()='Select']`)

// the input that follows the "Email" label, even when the label has no for=""
page.locator(`xpath=//label[normalize-space()='Email']/following::input[1]`)

The first one walks up from the heading to the nearest container that has a button, then down to that button. Cards can be reordered or restyled and it still finds the right one. The second just takes the first input after the label text.

Two more cheap checks before you trust a test: change the expected text so it should fail and make sure it actually goes red, and run it with --repeat-each=10 once. If both pass and the locators survive the question above, you're in good shape.

1

u/AutomaticVacation242 26d ago

It's like an antique store - you break it you buy it. Make devs fix tests they break. After all, they should prove to QA that the stuff that they build actually works. Can't do that with failing tests.

1

u/Party_Vanilla_5810 26d ago

This post has alot of thing for reading 🙏

1

u/0xCZZC 18d ago

Some things to help with this:

* Try to prompt it with "use maintainable CSS selectors" as the path that it arrives at. If you tell it "like medv/finder" ( https://www.npmjs.com/package/@medv/finder ) this will help get it into the space of understanding you want element selectors that will be less likely to break across iterations.

* You likely want to give it a browser to work with if you aren't already. Claude can confidently infer lots of things ( usually correctly? ) just from code, but, you probably want it to be able to experience your tests through the context of a browser, and then work backwards how ti's supposed to cosntruct the test. A good free choice for this sort of thing is agent-browser: https://agent-browser.dev .

* I make something that could help: a commercial "browser" called ZShot ( https://zshot-app.com ) that you can install and just tell Claude about. Once it's installed, you can just say things like "test this, record your actions as a playwright test, and also give me a video", and it should do the right thing. Free trial, so you can give it a shot and see if it fixes your problem. Once it's installed on your system with its skills, you can just say "Can you use ZShot to test <feature> on <url>? I want a playwright test for reproduction and a video of the process.". You'll get both so you can validate that what you wanted to happen actually happened.

1

u/Clay_Ferguson 29d ago

It's extremely simple. For example, every one of the videos on this page https://clay-ferguson.github.io/videos was generated by running a playwright script which was totally written by AI. All you need to do is ask Claude to write a Playwright script and it can easily do the entire thing.

In my case I have two special script functions which are: one to take a screenshot, and another to write a 'narration' file. And Claude writes all that too. Then I simply feed into my "kocreator" app all screenshots and narration text files, and it spits out a fully complete video.

Imagine how happy your boss will be when you can not only create and run tests, but you have a video evidence of each script run!!

2

u/Party_Vanilla_5810 26d ago

Thank you so much 🙏❤️‍🔥

0

u/Snow-Sure 29d ago

Claude will do what you will do?

12

u/[deleted] 29d ago

[removed] — view removed comment

1

u/LinterCheck2026 29d ago

Thanks - this is helpful. I will try this out tomorrow on few of my test cases and see how this works out. Have you also gone through this phase of doing manual testing only to automation? Any other challenges for me to keep in mind

1

u/Head-Bureaucrat 29d ago

Also get familiar with page object model (iirc there's a page on it in the playwright docs,) and make sure Claude is following that. It helps keep the code organized so will make things easier to maintain longer term.

1

u/Zelma-Bistolfi 28d ago

agreed, reviewing scenarios before code exists is where manual testers actually add the most value tbh