LogoLogo
v2.0.0
v2.0.0
  • 🌸What is Petal Pro?
  • πŸ’‘Changelog
  • ⏫Upgrade guide
  • Guides
    • πŸš€Creating a web app from start to finish
    • 🌎Deploy to Fly.io
    • πŸ’³Adding a subscription
    • πŸ”’Creating Your Own API
  • πŸ‘©β€πŸ³Recipes
    • πŸ’How to apply a recipe with git cherry pick
    • #️⃣UUIDs
    • ✍️First/Last name
    • πŸ—ΊοΈGoogle Maps
    • Password Hashing for Windows
  • Fundamentals
    • πŸ’ΏInstallation
    • πŸ“‚Folder structure
    • πŸ—ƒοΈIncluded Pages
    • πŸ˜€Users & Authentication
    • 🏒Organizations & Multitenancy
    • πŸ’³Stripe billing
    • πŸ””User Notifications
    • 🧊Components
    • ⬛Dark mode
    • 🎨Branding
    • 🌱Seeding
    • πŸ“„Layouts & Menus
    • πŸ–ΌοΈImage uploads
    • πŸ‘₯Impersonation
    • πŸ› οΈBackground Tasks and Jobs
    • πŸ”§Util & Helpers
    • πŸ“§Emails
    • πŸͺJavascript Hooks
    • πŸ“šExtra Hex Libraries
    • πŸ—οΈGenerators
    • πŸ—£οΈTranslations
    • πŸ–οΈContributing
    • πŸ›«Deployment
    • πŸ›‘οΈTesting
    • πŸ”’REST API
Powered by GitBook
On this page

Was this helpful?

  1. Fundamentals

Testing

PreviousDeploymentNextREST API

Last updated 9 months ago

Was this helpful?

Getting tests to work

Run mix test to run the tests.

Petal Pro also comes with some end-to-end (E2E) tests (see signup_test.exs). We use the library Wallaby for this.

Wallaby tests don't run by default as they can be slow. We have hidden them behind a "feature" flag.

# Run all tests, including wallaby:
mix test --include feature

# Run only wallaby
mix test --only feature

# Or use our alias to run only wallaby:
mix wallaby

For E2E tests to work, you must install , which will run the tests like you were clicking things in a browser. On a Mac, you can install it with:

brew install --cask chromedriver

Then to run the E2E tests run mix test --only feature. Or you could use our alias mix wallaby (see aliases defined in mix.exs).

On Mac, you may get the error:

Error: β€œchromedriver” cannot be opened because the developer cannot be verified. Unable to launch the chrome browser

If this happens, you can run this command:

xattr -d com.apple.quarantine $(which chromedriver)

πŸ›‘οΈ
Chromedriver