-
Notifications
You must be signed in to change notification settings - Fork 49
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
test: add front-end tests for react code #769
test: add front-end tests for react code #769
Conversation
f0add92
to
795ee1d
Compare
8887a4b
to
762afbf
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
1aec9ac
to
e796a58
Compare
This comment was marked as resolved.
This comment was marked as resolved.
e796a58
to
0462838
Compare
This comment was marked as resolved.
This comment was marked as resolved.
I've tested it out with |
This comment was marked as resolved.
This comment was marked as resolved.
Apropos fast, you can add slomo. See: https://playwright.dev/python/docs/test-runners#cli-arguments |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
ah yes, thanks for the snippet! |
Playwright usually waits, you can also increase its timeout settings. I guess no need for sleeping. |
the test can also be finished via the front-end only: page.get_by_title("Edit catalog").first.click()
comment_locator = page.get_by_label("Comment")
expect(comment_locator).to_have_text(comment)
# Catalog
catalog = Catalog.objects.first()
# now it passes
assert catalog.comment == comment but now also the db |
Awesome, you already found a solution? Nice. |
If you want to play around with test generation, please try: |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
3472fab
to
1289f28
Compare
69aa5db
to
bf10c63
Compare
Done with this for now. Tests are passing. |
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.
that is awesome! thanks so much XD
You are welcome. |
d8dbae1
to
6cc0dbd
Compare
This comment was marked as resolved.
This comment was marked as resolved.
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.
Awesome, thanks this looks very good!
@@ -2,7 +2,7 @@ | |||
|
|||
from django.utils.translation import gettext_lazy as _ | |||
|
|||
DEBUG = False | |||
DEBUG = os.getenv("DJANGO_DEBUG", False) == "True" |
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.
I don't mind setting this always to True
, I don't think this makes the tests much slower.
Co-authored-by: David Wallace Fixes: rdmorganiser#715
bf10c63
to
28197f1
Compare
Description
This PR proposes the following changes:
fixtures
fixture to be reusable by other tests and fixturesHow to run e2e tests
Run the e2e tests with the custom marker:
Run the e2e tests with an actual visual browser:
Slow down the test execution:
# --slowmo: miliseconds between actions pytest -m e2e --headed --slowmo 500
Tests suggested by @MyPyDavid in #715 and related tasks
django.db.utils.OperationalError: database table is locked
ModelHelper
Related issue: #715
Types of Changes
Checklist