publiclab / spectral-workbench

Web-based tools for collecting, analyzing, and sharing data from a DIY spectrometer
http://spectralworkbench.org
GNU General Public License v3.0
126 stars 157 forks source link

Protect critical interfaces (/capture, /capture/v2, /upload, /spectrums/0000) with system tests #673

Open jywarren opened 3 years ago

jywarren commented 3 years ago

https://github.com/publiclab/spectral-workbench/pull/660 introduced a new page - let's protect it with some system tests:

https://github.com/publiclab/spectral-workbench/tree/main/test/system

what can we brainstorm that we should test for?

We can similarly improve our confidence and speed merging other things if we protect other critical systems with system tests.

unnati914 commented 3 years ago

could you guide me to this?

waridrox commented 3 years ago

I think the tests for capture/v2 would make more sense once we implement the styling for that page. And that way we are able to target specific elements on the webpage in the tests.

As a result, other pages could be looked into before like /capture /upload and /spectrums/0000.

Since things like uploading and going to the specific spectrum would require logging in to the app. We could test from simply going to the webpage...then logging in the app with some admin account...Capturing the spectra and saving the data at /spectrums/0000

The upload test could be carried out similarly, difference being that the image could be uploaded instead of captured which would also require user login.

@jywarren, thoughts ?

waridrox commented 3 years ago

Hi @unnati914 🙌 if you would like to contribute you might want to first install the software on your local machine and take a look at how plots2 tests are written - https://github.com/publiclab/plots2/tree/main/test/system. This might give you some idea how system tests work...

unnati914 commented 3 years ago

Hi thank you so much for the help :)

waridrox commented 3 years ago

CC: @jywarren

unnati914 commented 3 years ago

Even I had thought of implementing this only 😄

waridrox commented 3 years ago

/capture, /capture/v2 and /upload implemented in #702