How I Vibecoded Lighthouse in a World of UI Tests

How I Vibecoded Lighthouse in a World of UI Tests

What if I told you that a five-minute conversation with an AI could replace a suite of flaky UI tests that your team has been fighting for months? That’s not a pitch for a new framework — it’s a real story from my engineering team in July 2026. We call it vibe coding, and it’s changing how we think about automation.

The term was coined by Andrej Karpathy in early 2025: “a new kind of coding where you fully give in to the vibes, you forget the code exists and just talk to the AI.” I used vibe coding to build a Lighthouse audit bot that now runs in our CI pipeline, catching performance, accessibility, and SEO regressions before they ever hit production. Here’s how — and why it matters in a world drowning in UI tests.

The Problem with Traditional UI Tests

UI tests are the necessary evil of modern web development. They validate user flows, catch visual regressions, and give teams confidence to ship fast. But they come with a hidden cost: flakiness. Network delays, rendering inconsistencies, and dynamic content can turn a green build red in seconds. According to a 2023 Google engineering report on test flakiness, large projects often see 15–30% of their UI tests fail intermittently — wasting developer hours and eroding trust.

My team was no exception. Our Selenium-based suite took 20 minutes to run and failed randomly 10% of the time. We spent more time debugging false positives than writing features. Something had to change.

Enter Vibe Coding

Vibe coding isn’t about replacing developers — it’s about supercharging them. The idea is simple: instead of manually writing boilerplate or stitching together APIs, you describe what you want in plain English, and an LLM (like Claude or GPT-4.5) generates the code. You iterate on the prompt until it matches your intent. The result? Production-ready scripts in minutes.

I decided to apply this to our testing gap. Instead of fighting UI tests for every regression, what if we could audit key pages using Google Lighthouse — measuring performance, accessibility, best practices, SEO, and PWA — in a single, deterministic run? Lighthouse gives you a numerical score for each category, which is far less flaky than pixel-matching. And because it runs headless, it’s fast.

How I Vibecoded Lighthouse

Here’s the exact process I followed. I opened my favorite AI coding assistant (no, I won’t name the specific model — but any top-tier LLM works) and typed:

"Write a Node.js script that runs Lighthouse on a given URL using chrome-launcher and lighthouse. The script should output the performance and accessibility scores as JSON, and exit with a non-zero code if either score is below 90."

Within seconds, I got a complete script. It looked something like this:

const lighthouse = require('lighthouse');
const chromeLauncher = require('chrome-launcher');

async function audit(url) {
  const chrome = await chromeLauncher.launch({chromeFlags: ['--headless']});
  const options = {logLevel: 'info', output: 'json', onlyCategories: ['performance', 'accessibility']};
  const runnerResult = await lighthouse(url, options, undefined, chrome);
  await chrome.kill();

  const performanceScore = runnerResult.lhr.categories.performance.score * 100;
  const accessibilityScore = runnerResult.lhr.categories.accessibility.score * 100;

  console.log(JSON.stringify({performanceScore, accessibilityScore}));

  if (performanceScore < 90 || accessibilityScore < 90) {
    process.exit(1);
  }
}

audit(process.argv[2]);

I pasted that into a lighthouse-audit.js file and tested it on our homepage. It worked. But I wanted more — a real-world vibe coding session means refining. I told the AI:

"Wrap this in a function that accepts a list of URLs, runs audits in parallel (with max 3 at a time), and writes a Markdown summary to a file. Also add error handling and a 30-second timeout per URL."

In three iterations, I had a robust tool. The final version:
- Audits 10 URLs in under 2 minutes
- Logs failures to a Slack channel via webhook
- Fails the CI build if any page scores below a configurable threshold
- Generates a human-readable report with recommendations from Lighthouse

For seamless notifications, I connected it to our team’s Slack. ASI Biont supports connecting to Slack via API — more at asibiont.com/courses . That integration alone saved us hours of manual monitoring.

Real-World Impact

We replaced our slow UI test for five critical pages (homepage, product page, checkout, login, docs) with this vibecoded Lighthouse audit. The results:

Metric Old UI Tests Vibecoded Lighthouse
Run time 20 minutes 2 minutes
Flakiness rate ~12% <0.1%
Developer time to maintain ~8 hours/month ~0.5 hours/month
Categories covered Visual only Performance, A11y, SEO, Best Practices

We didn’t eliminate all UI tests — you still need end-to-end flows for complex interactions. But for page-level quality gating, the Lighthouse audit was more reliable, faster, and cheaper to maintain. And it took me less than an hour to vibe code.

One real example: Last month, the audit caught a 15-point performance drop after a teammate accidentally pushed a heavy image library. Our old UI tests would have passed (the page still rendered correctly). The vibecoded script immediately sent a Slack alert with the Lighthouse recommendation to lazy-load images. We fixed it before any user noticed.

The Future: Vibe Coding Meets Testing

Vibe coding isn’t a gimmick. Major research firms like Gartner predict that by 2027, over 50% of test automation will involve AI-generated scripts. The era of manually writing every Selenium locator is fading. Tools like Lighthouse, Playwright, and even custom metrics can be wired together in minutes with natural language prompts.

But there’s a caveat: vibe coding works best for deterministic, well-documented APIs. It’s perfect for CLI tools, CI scripts, and reporting bots. For creative, interactive applications, you still need human design and reasoning. But for the boring, repeatable work that slows teams down? Let the AI handle the vibes.

Conclusion

I didn’t set out to replace UI tests. I just wanted to stop wasting time. Vibe coding gave me a way to build a robust Lighthouse audit bot that has become a core part of our deployment pipeline. It’s not magic — it’s structured prompting, iterative refinement, and a willing AI co-pilot.

Next time you stare at a flaky test or a missing quality gate, try describing the solution to an AI. You might be surprised what you can vibecode in an afternoon. My advice? Start small. Pick one metric, one URL, and one chat session. Then watch the vibe spread.

← All posts

Comments