Open noi5e opened 4 months ago
Thanks @noi5e!
I think it could be good to look into non-profit programs with some of the possible services that we could use for automated testing. I personally use Docker in most of my work, and Dockerhub has a very open and generous program for non profits, so I do most of my automated testing (upon PR submission) via Github Actions and Docker. CircleCI and Bitrise could also be worth exploring.
After doing some research, I'm getting a good sense of how to approach end-to-end testing for our app.
My impression is that testing WebGL maps is difficult, roundabout, and that testing solutions are lacking. There are barriers to simulating or querying the current state of a <canvas>
element within a NodeJS testing environment.
These are a few of the approaches that I could find (definitely chime in if you know something that I don't!):
main
, and do a visual comparison with pull-request
to see if anything has broken<canvas>
element with JavaScriptOur app is pretty simple, so whatever tests we come up with don't need to be too complicated at the end of the day.
If we can get a good combination of 1, 2, and maybe 3, set up, AND cover our bases with 4 and automatic deployments on AWS (or DockerHub, thanks for the suggestion @rudokemper), that should be pretty decent coverage.
I'm starting work on writing Cypress visual regression tests ASAP.
Also dropping something that @kyleramirez mentioned on Slack:
Moving toward open-source and self-hosting sounds great to me, will be a long-term goal though 🤞🏽
Starting the conversation around setting up a CI/CD pipeline, particularly, automated testing.
Ultimately, the first iteration of NLD Web 2.0 is going to be pretty simple, just like the current site is (a map that displays polygons with links to pages containing more info about individual features).
I think it would be valuable in the long run to set up (since we're anticipating more open source contributions in the future) automated testing to protect the basic functions of the site, which mostly are centered around the front page Mapbox map.
Example
Perhaps a basic flow would be something like this:
The tests would be of the following nature:
The point is that since so much of the site revolves around the front page map—user interaction, how it looks, etc—we need automated browser testing so we can protect the basics, while still allowing for contributors to build out new features.
Next Steps and Details
native-land-web-2.0
is built with Mapbox, so that's what we have to work with.react-map-gl
to integrate Mapbox GL JS with React.There is a lot about this particular aspect that I'm learning as I go, but I'm reading around, and planning on tinkering with this soon and seeing what works and makes sense.
@gdomingu @kyleramirez @rudokemper