• Blog
  • Documentation
  • Courses
  • Changelog
  • AI Starters
  • UI Kit
  • FAQ
  • Supamode
    New
  • Pricing

Launch your next SaaS in record time with Makerkit, a React SaaS Boilerplate for Next.js and Supabase.

Makerkit is a product of Makerkit Pte Ltd (registered in the Republic of Singapore)Company Registration No: 202407149CFor support or inquiries, please contact us

About
  • FAQ
  • Contact
  • Verify your Discord
  • Consultation
  • Open Source
  • Become an Affiliate
Product
  • Documentation
  • Blog
  • Changelog
  • UI Blocks
  • Figma UI Kit
  • AI SaaS Starters
License
  • Activate License
  • Upgrade License
  • Invite Member
Legal
  • Terms of License
  • Auth Overview
  • Global Configuration
    • Setting up your Firebase Project
    • Setting up Firebase Functions
  • Writing data to Firestore
  • Commands
  • Introduction
  • Production Checklist
  • Introduction
  • Overview
  • Stripe Configuration
  • Running Tests
  • Introduction
  • Setting up Firebase Auth
  • Fetching data from Firestore
  • Technical Details
  • Extending Organizations
  • Stripe Webhooks
  • CI Tests
  • Initial Setup
  • React Hooks
  • Auth Flow
  • API requests
  • Code Style
  • Clone the repository
  • Security Rules
  • User Permissions
  • Limitations
  • Project Structure
  • Third-Party Providers
  • Reading data from Storage
  • Running the application
  • Subscription Permissions
  • One-Time Payments
  • Running the App
  • Email Link Authentication
  • Uploading data to Storage
  • Security Rules
  • Migrate to Lemon Squeezy
  • Project Configuration
  • Multi-Factor Authentication
  • Writing your own Fetch
  • Translations and Locales
  • Coding Conventions
  • Environment Variables
  • Architecture and Folder Structure
    • Structure your Application
    • Data Model
  • Requiring Email verification
  • Sending Emails
  • Tailwind CSS and Styling
  • Validating API payload with Zod
  • Authentication
  • Onboarding Flow
  • Logging
  • Development: adding custom features
  • Prevent abuse with AppCheck
  • Enable CORS
  • Encrypting Secrets
  • User Roles
  • Firestore: Data Fetching
  • Custom React Hooks
  • Custom React Hooks
  • Firestore: Data Writing
  • Troubleshooting
  • Forms
  • Application Pages
  • API Routes
  • API Routes Validation
  • Translations
  • Adding pages to the Marketing Site
  • Deploying to Production
  • Updating to the latest version
This kit is no longer maintained.

Running Cypress Tests with Firebase and Remix

Learn how to run Cypress E2E tests for your Makerkit application

The Makerkit SaaS boilerplate comes with a set of predefined tests with the following goals:

  1. Verify that the boilerplate application works well
  2. Provide instructions for building your own tests

As your application grows, the tests will inevitably need to be updated and maintained. We hope that our tests will be simple to understand and to change when you will need them.

Running the Remix development server

First, we have to run the following command to run Remix with a testing environment (i.e. using .env.test):

text
npm run dev

This command will start a Remix dev server at http://localhost:3000, so it's important to make sure you have no other Remix server running at the same port.

Additionally, we have to start the Firebase Emulator server:

text
npm run firebase:emulators:start

Running Cypress in development mode

While you build your tests, it can be handy to use a windowed version of the Cypress testing suite, so that you can easily retry the tests without having to re-run the while tests suite.

To do that, run the following command:

text
npm run cypress

Running All Cypress tests

Whenever you want to run all your tests at once, you can use the following commands:

text
npm run cypress:headless

This will run all the tests and exit.

Running Cypress in CI mode

Whenever you want to run all your tests in a CI environment, you can use the following commands:

text
npm test

The command above will:

  1. Start the Firebase Emulator
  2. Start the Remix environment
  3. Run the tests in headless mode
  4. Exit and close all the processes

As you may have noticed, this is the command to run in your CI environment.

Testing Stripe

Testing Stripe requires one more process to start, i.e. the official Stripe emulator.

The command below will require Docker installed, which is why you can choose to disable it by setting the environment variable ENABLE_STRIPE_TESTING to false from the .env.test environment file:

.env.test
ENABLE_STRIPE_TESTING=false

If instead, you want to test Stripe Checkout as well, run the command below:

text
npm run stripe:mock-server

As we've mentioned, this will require Docker running. Of course, we think it's worth it.

On this page
  1. Running the Remix development server
    1. Running Cypress in development mode
      1. Running All Cypress tests
        1. Running Cypress in CI mode
          1. Testing Stripe