-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add framework for UI testing via bs4 #62
Conversation
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
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 :) |
As discussed internally
|
- `HTML.has_button` is now case insensitive for text - Better naming of `pytest.mark.parametrize` variables - Filter some warnings from 3rd party packages
ce64794
to
e2b6e6b
Compare
doctest_optionflags = "NORMALIZE_WHITESPACE NUMBER" | ||
filterwarnings = [ | ||
"error", |
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.
Due to pytest
's bad naming, this is a bit confusing, but the error
means to transform all warnings into exceptions. I'm not sure if this is wanted (or needed) but it should help during migrations between e.g. Django 4.2 - Django 5.2
Looking back at this PR, it might be worth it to use Selenium instead of just parsing html... |
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 anHtml
class, which should be sufficient for most tests.Testing plan
pytest
Progress
assignments
app to see if the framework is sufficiently useful.