Back Button Testing
Cypress and Laravel Integration

Cypress and Laravel Integration

Cypress is a fantastic end-to-end testing framework. In this series, we'll learn, not just the ins and outs of Cypress, but also how it can be leveraged within a Laravel application to allow for everything from logging in, to seeding a database, to swapping environments.
Intermediate
7 episodes
1h 28m
7
Latest Episode in This Series

Added 2 months ago

Reaching into Iframes

Iframes can be a little tricky when using Cypress. In this episode, we'll leverage retry-ability to wait...

Watch
Cypress and Laravel Integration

Cypress and Laravel Integration

Cypress is a fantastic end-to-end testing framework. In this series, we'll learn, not just the ins and outs of Cypress, but also how it can be leveraged within a Laravel application to allow for everything from logging in, to seeding a database, to swapping environments.
Begin
7
Latest Episode in This Series

Added 2 months ago

Reaching into Iframes

Iframes can be a little tricky when using Cypress. In this episode, we'll leverage retry-ability to wait...
Watch

Your Teacher | Jeffrey Way

https://laracasts.s3.amazonaws.com/avatars/jeffrey-avatar.jpg's avatar
Hi, I'm Jeffrey. I'm the creator of Laracasts and spend most of my days building the site and thinking of new ways to teach confusing concepts. I live in Orlando, Florida with my wife and two kids.
  1. Section 1 Setup

    1. Free Episode Run Time 8:12

      We'll begin by setting up a fresh Laravel application and pulling in Cypress. We'll eventually require a variety of Laravel-specific helpers for logging in, seeding a database, triggering an Artisan command, and more. So with that in mind, we'll also pull in a Composer package of mine that I use in all my Laravel apps.

    2. Free Episode Run Time 13:37

      Let's begin by using TDD to drive the creation of a blog posts landing page. This will give us the opportunity to review and discuss a basic workflow you can expect to follow.

  2. Section 2 Examples

    1. Often in this series, we'll use BDD to drive our applications. However, the reality is that you'll often find yourself filling in tests after the fact. With that in mind, let's work with the actual Laracasts codebase and fill in a series of end-to-end tests for the site's login modal.

    2. Free Episode Run Time 13:41

      Let's take a few moments to discuss the difference between commands and assertions, while also reviewing the underlying Chai assertion library that Cypress makes use of.

    3. A true end-to-end test will span your entire system. This means no swapping things in the container, no faking third party APIs, and no stubbing endpoints. However, once you have at least one test that hits all necessary endpoints, the remaining tests are free to swap in fake data. This way, for example, you don't need to hit Stripe's server every time you test a portion of your registration form.

      In this episode, we'll review how to intercept any XHR request and fake its response with fixture data.

    4. Let's review another example using the Laracasts codebase. How would we go about testing registration that hits a third-party billing API, like Stripe?

    5. Free Episode Run Time 12:37

      Iframes can be a little tricky when using Cypress. In this episode, we'll leverage retry-ability to wait until an iframe has loaded before continuing with the necessary queries and assertions.

      View the source code for this episode on GitHub.

Series still in development robot

*Series still in development. Check back often for updates.