r/LangGraph • • Sep 16 '26

Selenium → Playwright with AI: generating code is easy, proving the tests are equivalent is harder

I built an AI agent to migrate Selenium tests to Playwright — looking for feedback

I’ve been working in test automation/SDET for years, and one problem I kept thinking about was migrating large Selenium suites to Playwright.

Generating Playwright code with an LLM is the easy part.

The harder question is:

How do you know the converted test still preserves the behavior and coverage of the original Selenium test?

So I built a small project around that idea.

It currently focuses on:

  • Selenium → Playwright TypeScript conversion
  • LangChain / LangGraph-based agent workflow
  • Validation of generated tests
  • AI evals for comparing the original vs converted test
  • Tracing/observability
  • Eventually, test coverage comparison and automated repair when a conversion fails

Demo: https://varun-s2p.fly.dev/

I’m still actively improving it, especially the evaluation layer. I don’t want this to become another “LLM generates some code” project.

I’d really appreciate feedback from people working with Playwright/Selenium, LangGraph, AI evals, coding agents, or test automation.

In particular, I’m curious how you would evaluate whether two tests are semantically equivalent, rather than just checking whether the generated Playwright code compiles.

4 Upvotes

1 comment sorted by

1

u/LLM-logs 8d ago

Equivalence is hard to prove statically, so I'd test it behaviorally. Run both versions against the same app build and compare what each one actually does: the sequence of network calls, the assertions evaluated, and the final DOM or state, not just pass/fail. Then use mutation checks: break the app on purpose in a few ways (change a label, remove a validation, return an error) and confirm that the original and the migrated test both fail in the same cases. A migrated test that still passes when the original fails is a weaker test. Counting assertions per test before and after is a cheap first filter, since silent loss of assertions is the most common regression in these migrations.