-
Notifications
You must be signed in to change notification settings - Fork 79
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
Nbb UI tests: first cut #97
Conversation
This reverts commit d053a66.
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 general approach here is to browse to all notebooks in the static build and assert they don't log any console errors, correct?
Did you verify that viewer errors are logged and lead to a failure or should we still do that?
Correct.
I verified this in the REPL, but we can verify this by making a test commit which should trigger this. Do you know of anything that should trigger a console error in a clerk notebook? |
@mk Addressed everything, except one comment about the extra dir. Imo it's better to start coding in a separate file and use bb.edn only for hooking up code to task names, but given that the code is relatively thin, I'd be ok with moving it to the bb.edn for now. Just let me know. |
Hmm, somehow removing package lock json causes an error, I'll look into it. |
Running |
@mk We solved the problem that the viewer JS is "refreshed" as needed on google cloud before anything else runs. Having that in place, I could test and confirm that logging with https://github.com/nextjournal/clerk/runs/5467522586?check_suite_focus=true I consider this PR mergeable. Let me know if you agree. |
Was about to merge this until I saw that you added an explicit |
I think you made a mistake with f71bcb4 since the tests contain a static build test which needs the JS asset to already be present. Triggering a rebuild will likely fail the tests. |
@borkdude you mean this one? clerk/test/nextjournal/clerk_test.clj Lines 17 to 27 in e031d51
If yes that should not be a problem since it's not asserting anything about this. In general, I'd like to keep the fast feedback loop the clojure tests currently bring and would prefer it if we managed to keep them without a dependency on the viewer js build. |
Oh, I see what you mean now. The slurp will fail if the js hasn't been compiled yet. I guess we can pass an override setting for the tests. |
This reverts commit f9e7b1f.
This adds browser tests based on Nbb using playwright. It operates on the static build and browses through all notebooks and asserts that no errors are logged via
js/console.errror
.