-
-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Integration tests (Cypress? Something from Rails? etc.) #48
Comments
The 0.15 release is pretty loaded, but as a stretch goal I think at least some foundational element of this could be included, perhaps as a blank folder in the site template or a suggested approach in the documentation. |
Ugh. Testing terminology. When I hear IE: Then there's End to End testing which would be something like: It seems like Capybara weirdly hits both aspects based on my limited knowledge. It can hook into Minitest or RSpec and work as integration testing. But it can also work as a Selenium driver (end to end testing) if I'm reading the docs correctly. Most of the Rails / Ruby community would probably prefer Capybara due to familiarity. But most of the front end world uses something like Enzyme / React-Testing-Library for integration tests and Cypress for end to end testing. Sorry, just thinking out loud here. I'd be happy to see if I could throw something together with either Cypress and Dom-testing-Library or Capybara. Theoretically they're both framework agnostic and shouldn't require anything special to get working. |
I started to go down a path of using Minitest + Nokogiri via a Bridgetown hook to test the literal HTML at the point it's been statically generated, and so far I'm liking that approach as one possibility. (see #69) If you want to give Cypress a spin for E2E testing, I think that'd be awesome. I've used Cypress a bit and it's pretty nifty, but I think it's mostly relevant only for parts of the site that are interactive and require JavaScript. |
I just remembered Rails has a DOM testing library. It uses Minitest / Nokogiri under the hood. I wonder if there would be any way to leverage those assertions. |
Oooo, those look very interesting. Thanks for the link!! |
The |
Sounds perfect to me. I see no issues with this. Let people decide if / how they want to test their site. Providing examples and an easy way to add them is definitely the way to do it as it prevents people feeling locked into any 1 specific suite. |
We should integrate and demonstrate how to write integration tests that can be run in CI or during development to verify various aspects of site output, routes, components, etc. The field is wide open as far as I'm concerned as to the best way to do that. If we can stick to something simple and Ruby-based, that's cool. But I'm also willing to go for something heavy-duty like Cypress if that will better serve the ecosystem in the long run.
The text was updated successfully, but these errors were encountered: