Skip to content
Programing

Pest v5 Launch: Native AI Agent Support and Parallel Browser Testing

Published: Duration: 4:19
0:00 0:00

Transcript

Guest: Thanks so much for having me, Alex! I’ve been looking forward to chatting about this. Honestly, I’ve been living in Pest v5 for the last few weeks, and it’s one of those updates where you start using it and immediately think, "How did I do this before?" Host: That is exactly what I wanted to hear! So, let’s jump right into the big headline: "AI-Ready" testing. When I first read that in the release notes, my brain went straight to "Is the AI going to write all my tests now?" But it’s actually a bit deeper than that, right? What does "native AI agent support" actually mean for a dev sitting at their keyboard? Guest: Right? It sounds like marketing speak at first, but it’s actually quite a strategic move by Nuno Maduro and the team. The idea of an "AI-ready" test suite is that the syntax is so expressive and minimalistic that it's basically a perfect dataset for an AI agent. Host: Oh! So it’s almost like we’re documenting our app in a way that the robots can actually understand and help us with. It’s like giving the AI a better map of the territory. Guest: Exactly. It’s about reducing the friction between the developer’s brain and the machine. I’ve actually tried using some AI coding assistants with v5, and because the syntax is so clean, the suggestions for assertions and refactors are just... they're much more "on the nose" than they used to be. It’s like the AI "gets" what I’m trying to achieve much faster. Host: That’s wild. I love that it’s not just about "automation," but about "intelligence." But okay, let's pivot to something a bit more... "brute force" in a way? Performance. I think every developer has had that moment where they push code, go to grab a coffee, come back, and the browser tests are *still* running. Pest v5 is promising native parallel browser testing. How much of a difference are we talking about here? Guest: Oh, Alex, it’s a night-and-day difference. Truly. So, browser tests—like when you're using Laravel Dusk to actually open a Chrome instance and click buttons—are notoriously slow. They’re heavy. In the past, running them in parallel was... a bit of a headache. You usually needed some custom shell scripts or a third-party package that was a pain to configure. Host: A minute?! That’s huge for the feedback loop. I mean, four minutes is long enough to get distracted by Twitter, but one minute is "stay in the zone" time. Guest: Exactly! And the "aha moment" for me was how easy it was to set up. I actually expected to spend an afternoon tweaking config files, but it just... worked. And you can even specify the number of processes, like `--processes=4`, so if you're on a beefy CI server, you can just crank it up and watch those tests fly. Host: That’s incredible. And I saw that it’s also fully compatible with PHP 8.4? Guest: Yeah, and that’s a big deal too. PHP 8.4 brings some really cool property hooks and new syntax features, and Pest v5 is built to embrace that. It feels very "future-proof." You aren’t fighting the framework to use the latest language features. It feels like the whole ecosystem is moving forward together. Host: You know, one thing I always wonder with these big "v5" updates is the migration struggle. For someone listening who has a massive Pest v4 suite, is this going to be a "clear the calendar for three days" kind of upgrade? Guest: Honestly? No. Actually, it was surprisingly smooth for me. The core syntax hasn’t been ripped up; it’s just been refined and added to. Most of the work in v5 is under the hood or adding these new capabilities. If you’re already on a recent version of PHP, the upgrade is pretty painless. The team has always been really good about providing upgrade guides that are actually readable. Host: That’s a relief. I think we’ve all had those "major version" nightmares where everything breaks. Guest: (Laughs) Oh, for sure. But I think what’s cool about Pest v5 is that it’s not just an "update," it’s a statement of where PHP is going. It’s saying that PHP isn’t this "old" language; it’s a modern, AI-integrated, high-performance tool. When I’m writing these tests, it feels as modern as anything I’d do in the TypeScript or Go ecosystems. Host: I love that. It really does feel like PHP is having a bit of a renaissance lately, and Pest is right at the heart of that. Before we wrap up, Marco, if a developer is just starting out with Pest v5 today, what’s the one feature they should try first—besides the parallel flag? Guest: I would say try the new `todo()` and metadata features for the AI. Even if you aren't using an AI agent yet, start writing your tests with that high-level intent. It changes how you think about your code. And then, honestly, just run it in parallel once. Seeing that progress bar zip across the screen is a serious hit of dopamine! Host: (Laughs) I can imagine! I’m definitely going to be trying that out on my next project. Marco, thank you so much for coming on and sharing your experience. This was super insightful. Guest: My pleasure, Alex! Thanks for having me.

Tags

ai agents php testing laravel symfony performance pest