LogoLogo
v1.5.0
v1.5.0
  • 🌸What is Petal Pro?
  • πŸ’‘Changelog
  • ⏫Upgrade guide
  • Guides
    • πŸš€Creating a web app from start to finish
  • πŸ‘©β€πŸ³Recipes
    • πŸ’How to apply a recipe with git cherry pick
    • #️⃣UUIDs
    • ✍️First/Last name
    • πŸ“¦NPM packages
    • πŸ—ΊοΈGoogle Maps
  • Fundamentals
    • πŸ’ΏInstallation
    • πŸ“‚Folder structure
    • πŸ—ƒοΈIncluded Pages
    • πŸ˜€Users & Authentication
    • 🏒Organizations & Multitenancy
    • 🧊Components
    • ⬛Dark mode
    • 🎨Branding
    • 🌱Seeding
    • πŸ“„Layouts & Menus
    • πŸ› οΈBackground Tasks and Jobs
    • πŸ”§Util & Helpers
    • πŸ“§Emails
    • πŸͺJavascript Hooks
    • πŸ“šExtra Hex Libraries
    • πŸ—οΈGenerators & Page Builder
    • πŸ—£οΈTranslations
    • πŸ–οΈContributing
    • πŸ›«Deployment
    • πŸ›‘οΈTesting
Powered by GitBook
On this page

Was this helpful?

  1. Fundamentals

Testing

Wallaby

Wallaby allows you to write end-to-end tests as though you're operating a browser session. A test looks like this:

session
|> visit("/register")
|> assert_has(Query.text("Register"))
|> fill_in(text_field("user[name]"), with: "Bob")
|> fill_in(text_field("user[email]"), with: "bob@example.com")
|> fill_in(text_field("user[password]"), with: "password")
|> click(button("Create account"))
|> assert_has(Query.text("Welcome"))

You can see the full test in test/features/signup_test.exs.

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

v1.3.0 BUG WITH LIVE VIEW

We're sorry to report that since Live View 0.17.7, wallaby has stopped working properly. See the write-up here on how to fix it. We will be fixing this in the next version. Apologies about this.

If you really want e2e tests then we suggest either following the instructions in the link above or downgrading phoenix_live_view => 0.17.6.

PreviousDeployment

Last updated 2 years ago

Was this helpful?

πŸ›‘οΈ