-
Notifications
You must be signed in to change notification settings - Fork 8
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
Can try to reuse a closed browser #3
Comments
@pfeodrippe: to be honest I don't mind much about this particular issue, it's just that it made the README snippet less robust, which isn't a good look! However, I'm finding the following issue more practical:
I would suggest either of two solutions:
Such an alternative pattern could be e.g.: (-> (wally/make-page)
(doto (w/fill "//*[@id=\"loginForm\"]/div/div[1]/div/label/input"
"my-username"))
(doto (w/fill "//*[@id=\"loginForm\"]/div/div[2]/div/label/input"
"some-password"))) Which removes the need for repeating a I wouldn't enjoy being too pushy - just leaving these for your consideration! Cheers - V |
Thanks for the suggestions!! I guess making a I guess any performance issue for |
Hey! Sorry for the delay.
Yes, for instance would seem satisfactory to me: (defonce ^:dynamic *page*
(if (#{"true" "1"} (System/getProperty "pfeodrippe.wally.no-default-page"))
nil
(make-page)))
Yes, that's entirely true. I just pointed it out as one of the usual cons which, as I have perceived it, have made dynvars less "modern" as of recent years.
Say one integrated core.async with Wally, it might become less usable, since dynamic bindings are lost across Anyway, I thought of another, more practical issue: dyn vars propagate across vanilla java threads. While playwright-java is not thread-safe. So a dyn var makes unsafe code more likely to happen, e.g.: (wally/with-page page
(pmap (fn [x]
(wally/foo x)) ;; this is thread-unsafe, and the underying dynamic binding makes it easy to forget that
xs)) I created #5 to expand on that. Cheers - V |
I also scratched my head a bit over this, so some documentation or something would help. |
(w/with-page (w/make-page) (w/navigate "https://clojars.org/metosin/jsonista") (w/fill :#search "reitit") ) If you do the demo like this instead, you can reliable re-run the demo, by closing the brower window after each run. However, if you just re-run without closing, you get an exception. so its still not very good for a demo |
Yes, need to get back on this, guess I will review @vemv’s PR this weekend, thanks for the feedback |
FWIW my preference would be to add the page argument explicitly, for me it makes it easier to think about the code. |
Hey there!
Thank you for your project.
I followed https://github.com/pfeodrippe/wally/tree/f6a6979731cdd37ad7ba36fa88cd4a4f411fd686#usage , and for the sake of experimentation, I closed the browser and tried to perform the same steps again.
The first step
(w/navigate "https://clojars.org/metosin/jsonista")
failed with:Perhaps it's worthwhile / feasible to...
Thanks - V
The text was updated successfully, but these errors were encountered: