Integrate (Vue)JS Components in a Symfony App, add E2E Tests with Panther

You don’t have access to this content, but if you attended SymfonyCon 2018 - log in with your SymfonyConnect account to get access for free.


SymfonyCon 2018 Presentation by Kévin Dunglas

Thanks to the new capabilities of the web platform (web components, Progressive Web Apps…) and the rise of modern JS libraries (Vue, React, Angular) almost all modern Symfony applications must leverage the frontend ecosystem. Symfony 4 embed many gems that make it easy to integrate modern JavaScript within the framework, including the first component entirely written in JS: Webpack Encore. In Symfony 4.2, another component that is super convenient for apps containing JS code has been released: Panther, a PHP library compatible with BrowserKit, that drives real web browsers to create end-to-end (E2E) tests with ease. During this talk, I'll show you how to cleanly integrate modern JavaScript code with Symfony and Twig and how to test such applications using Panther. The examples will use VueJS, because it’s probably the easiest JS framework to get started with as a PHP developer, but all the tips and tricks will be applicable with other libraries such as React or Angular.

Leave a comment!

  • 2019-04-03 Diego Aguiar

    Hey Krzysztof Krakowiak

    Yeah, it's impressive how fast (and easy?) Keving managed to develop a real time application!

  • 2019-04-02 Krzysztof Krakowiak

    Great talk, I use similar approach, but in addition I have decided to use a tiny wrapper around Vue components: to utilize the power of Web Components :D