tjcsl / tin

Turn-In: A code autograder for CS classes
https://tin.tjhsst.edu
GNU General Public License v3.0
2 stars 6 forks source link

Add framework for UI testing via bs4 #62

Open JasonGrace2282 opened 1 month ago

JasonGrace2282 commented 1 month ago

This is mostly here so I can explore how I like this solution, and others can see my progress.

The main difference is this now uses BeautifulSoup4, so we can leverage the flexibility of that for more advanced queries. The simple but tedious cases are encapsulated in an Html class, which should be sufficient for most tests.

Testing plan

pytest

Progress

JasonGrace2282 commented 1 month ago

I feel pretty happy with this approach - what do you think @krishnans2006 ?

I did some benchmarking, and I found on my machine (for actual Tin pages):

And with python -O

So I'm not too concerned about performance. I've written some light tests to illustrate kind of what I was going for with the UI testing approach, any kind of feedback would be nice :)

JasonGrace2282 commented 1 month ago

As discussed internally

JasonGrace2282 commented 2 days ago

Looking back at this PR, it might be worth it to use Selenium instead of just parsing html...