-
Notifications
You must be signed in to change notification settings - Fork 165
Frontend regression testing #2566
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
base: main
Are you sure you want to change the base?
Conversation
9c2dc91 to
1dd288a
Compare
|
|
||
| import django.test | ||
| import django_webtest | ||
| import requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we also need to declare this dependency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, roughly how painful would it be to do this without requests? If it's just 10-ish more lines of python with urllib, I'm tempted to use that instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the other hand, we have requests in our uv.lock either way through mozilla-django-oidc; I don't have a strong opinion towards either direction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah if we already install it anyway, fine with me
(although mozilla-django-oidc is a candidate for removal as soon as possible :D)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The python standard library documentation explicitly recommends using the Requests package: https://docs.python.org/3/library/http.client.html
Considering that, I think it is fair to explicitly depend on it.
82622b2 to
4a7243f
Compare
ddcdc89 to
699a166
Compare
699a166 to
8ecae58
Compare
This PR adds a subclass of
LiveServerTest:VisualRegressionTestCase. This allows to write test cases likeStaffSemesterViewRegressionTest, which are standard live server tests where you can useself.trigger_screenshot(<identifier>).The screenshot is then compared to a known good screenshot and the testcase fails, if there is a large enough difference (as specified by us) between the two.
The CI needs to provide three environment variables for the test to establish a connection to testing api:
VRT_APIURLVRT_APIKEYVRT_PROJECT