brunty,
@brunty@brunty.social avatar

folks, what framework-agnostic tooling (as in not / / etc) are you using for running headless browser-based tests these days via something like ?

I'm looking at setting something up in on , I've tried Symfony Panther and it's been a shitshow of errors and not being able to get or running in Docker :/

itsjoshbruce,
@itsjoshbruce@phpc.social avatar

@brunty: Honest question: What in the architecture of the solution and user need requires testing in a browser?

SamStrong,
@SamStrong@hachyderm.io avatar

@brunty If you’d prefer not to use JavaScript, could PHPUnit call a PHP Selenium wrapper? (I assume there’s one of those for every language ever invented at this point)

brunty,
@brunty@brunty.social avatar

@SamStrong yeah, there's always Selenium 😅

pieceofthepie,
@pieceofthepie@n8e.dev avatar

@brunty It's not without its flaws but we use Behat to drive a headless Chrome in Docker.

brunty,
@brunty@brunty.social avatar

@pieceofthepie Symfony Panther promises to do the same thing and I've not yet been able to get it to work 😅

pieceofthepie,
@pieceofthepie@n8e.dev avatar

@brunty Yeah, Panther didn't exist when we built this 😂

lewiscowles1986,
@lewiscowles1986@phpc.social avatar

@brunty you'll be trading frameworks, but what about Cypress, or playwright? They are not PHP bindings, but for a browser, do you care?

Flyingmana,
@Flyingmana@phpc.social avatar

@brunty if its fully framework agnostic, then I still go with one of the js based ones, as thats closer on native APIs 👀

else its probably codeception in php

brunty,
@brunty@brunty.social avatar

@Flyingmana JS-based could be an option TBH 🤔

SamStrong,
@SamStrong@hachyderm.io avatar

@brunty @Flyingmana I assumed everyone used Cypress or Playwright. We’re considering migrating from Cypress to Playwright right now since our Cypress tests are unpredictably flakey.

lewiscowles1986,
@lewiscowles1986@phpc.social avatar

@SamStrong @brunty @Flyingmana
Every single frontend test, of a non-legacy system, or any system with bugs (all of them), will be flakey, and expensive.

The further out you go from unit testing, this is an inescapable truth. It happens later, often not by the folks building; their tools (looking at you webpack, emotion, etc) mangle the source tree; require hacks like waiting up to n seconds for elements to be in a desired state.

If your frontend is de-coupled, you might gain more win from API

SamStrong,
@SamStrong@hachyderm.io avatar

@lewiscowles1986 @brunty @Flyingmana I’m not sure what you’re suggesting. Just writing unit tests? We need more than that in our testing triangle. And we need tools that use real browsers to run them.

lewiscowles1986,
@lewiscowles1986@phpc.social avatar

@SamStrong @brunty @Flyingmana
I did not suggest only writing unit tests, I merely acknowledged the truth that the further out from them you get, the more expensive, time consuming and fragile those tests become.

At no point did I say don't write any type of test.

brunty,
@brunty@brunty.social avatar

@lewiscowles1986 @SamStrong @Flyingmana please untag me from this, I'm not interested in yet-another-testing-pyramid-unit-vs-higher-level-tests-discussion thanks - that's not what my question was about

  • All
  • Subscribed
  • Moderated
  • Favorites
  • php
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines