End to End Testing Single Page Apps & APIs with Cucumber.js and Puppeteer - LNUG - April 2018
Vložit
- čas přidán 22. 08. 2024
- End-to-end testing Single Page Apps and APIs with Cucumber.js & Puppeteer
Paul Jensen
Developing web applications as separate front end and back end parts is a common practice, but brings with it the challenge of how to test those parts together in an end-to-end fashion.
In this talk, I will show you a strategy for being able to test your web application with Cucumber.js and Puppeteer, a library for running Google Chrome in headless mode. We'll also explore how to handle things like seeding the database for the API before running tests, how to select elements in the DOM via Cucumber step definitions, and how to do this in a nice fashion using Node 8's async/await feature.
My name is Paul Jensen, I'm the author of Manning's Cross Platform Desktop Applications, and I'm the Lead Innovation Engineer at Starcount. My twitter handle is paulbjensen.
still relevant in 2020. Thank you so much!
Glad you liked it - I've been using Cucumber since 2010 and it feels like one of those technologies that will stand the test of time whilst tech stacks change - ask anyone who used to use jQuery back then and now uses React.
is there a repo where you implemented cucumber and puppeteer available?
@@saurabhkapoor16 That's the one. Thanks for sharing that.
Puppeteer now supports firefox (experimental)
Works well in all of my tests
I will have to give that a try - also want to give Playwright a spin as well.
I cannot find part related to API...
The presumption of the "Product Guy" has a clear mind doesn't exit. The GAP is not between users or product manages with the developers, IT IS the users or product managers themselves: no clear ideas. This is not a complain, just telling the truth of the real world.
I know exactly what you mean - good product managers talk to real potential customers and test out ideas with them via prototypes, whereas some startup types tend to just make assumptions about what customers want and then blame sales reps when the product that was built doesn't sell (I saw that first-hand at a previous company).
Some good books that can help avoid these problems are Eric Ries' "The Lean Startup" (a well-known and highly-regarded book), and "Customers Included" by Mark Hurst - which has an jaw-dropping tale of an expensive and wasteful approach to monitoring the US-Mexico border on the state of Arizona, and demonstrates the importance of talking to customers.
Multiple scenario on single feature file?
Yes, I tend to group a set of scenarios for a particular user flow in one file. That particular project (Dashku) currently has 79 scenarios, so it helps to group related scenarios.