How important is acceptance testing in Phoenix vs something like Rails? Does functional code require less high level testing because the individual pieces are generally less tightly coupled?
Overall I don’t think there’s much difference to be honest? Both Ruby and Elixir are dynamically typed so even if your application modules are nicely structured and tested and decoupled, having some higher-level tests can definitely help.
How do you folks approach high level testing? (if at all?)
For server-side rendered HTML apps I’d write mostly Phoenix integration tests. These are easy to write, separated (thanks to Ecto Sandbox), pretty fast (no browser communication latency) and thanks to recycling the conn can be higher-level
If the app has a lot of client-side javascript, or/and if I need to test how the app renders in a real browser, I’d pick a bigger gun. Also I think even when most of the things are tested in Phoenix ConnCases, it’s good to test some of the most business-critical application paths with a real end-to-end testing framework.
The most common choice are WebDriver-based frameworks (“Selenium”). I would build something myself using the official Selenium WebDriver client libraries in Java, Ruby, etc, or use a nice framework with added conveniences like Capybara etc. There’s also Elixir Hound and Elixir Wallaby (which I’m currently working with), if you want to write the tests in Elixir. Either way, I wouldn’t run these tests with PhantomJS - it’s a dead project, and Chromedriver with headless Chrome is also pretty fast and can be used on the CI. For testing different browsers and mobile, there are platforms like Browserstack, Saucelabs or Crossbrowsertesting.
Using the “Chrome DevTools Protocol” for testing also seems appealing (maybe you’ve heard of puppeteer, which is a client for it), so if I had to test only Chrome and wanted to play with the “hot new tech” I’d try out Taiko. Seems a bit closer to the browser, it could be faster while being as capable as Selenium. Other browsers also could implement this protocol, Firefox is a WIP I think.
Overall while I don’t personally love it, JavaScript seems to be a good choice for end-to-end testing thanks to being event-driven (no need for “wait for” loops and less tinkering with custom timeouts).
Cypress seems like a nice choice with cool tooling and I’d like to try it out someday too. But Cypress runs entirely in the browser alongside the application code, so… I don’t know, it’s somewhere in the middle between Phoenix ConnCases and WebDriver? Not “truly” externally ran and end-to-end, can’t be used to test things like payment iframes or clicking through external services.