Skip to content
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

docs: maybe explain date format required to fill input with date type #558

Open
TimoKramer opened this issue Aug 22, 2023 · 4 comments
Open
Labels

Comments

@TimoKramer
Copy link

Version
1.0.40

Platform
Operating System: Arch Linux
Clojure version: 1.11.0
Babashka version: -
JDK vendor and version: java-17-graalvm

Browser vendor: firefox
Browser version: 116.0.3
WebDriver version: 0.32.2

Symptom
e/fill does not work on {:tag :input}. It focuses it, you can see it as the first two numbers are blue but it does not enter anything. Does not work for e/fill-human as well.

Reproduction
I am uploading an html for you to try this:
(e/fill driver {:tag :input :name "cultivation-period"} "10222008")
(e/fill driver {:tag :input :name "cultivation-period"} "10/22/2008")

Actual behavior
date-input is not filled out

Expected behavior
date-input is filled out

Testfile renamed to txt because htm is not allowed:
yobst.htm.txt

Thanks so much for your work and any help is highly appreciated.

@lread
Copy link
Collaborator

lread commented Aug 22, 2023

Thanks for raising an issue @TimoKramer, I'll try to reproduce it locally sometime soon and get back to you.

@lread
Copy link
Collaborator

lread commented Aug 22, 2023

Apparently input type="date" fields are a bit picky as to what they accept.

I'm testing with Firefox 116.0.3 with geckodriver 0.33.0 matching your JVM via GraalVM CE 17.0.8+7.1 on Pop!OS.

Working from a fiddle directory, I copied your provided yobst.htm.txt to fiddle/issue558.html, then from a REPL I tried the following:

(require '[etaoin.api :as e]
         '[babashka.fs :as fs])

(def driver (e/firefox))

(e/go driver (->> "fiddle/issue558.html" fs/absolutize (str "file://")))

;; reproduced your experience
(e/fill driver {:tag :input :name "cultivation-period"} "10222008")

;; reproduced your experience
(e/fill driver {:tag :input :name "cultivation-period"} "10/22/2008")

;; yyyy-mm-dd seems to fill just fine
(e/fill driver {:tag :input :name "cultivation-period"} "2008-10-22")

(e/quit driver)

Can you try the yyyy-mm-dd format and see if that works for you?

@TimoKramer
Copy link
Author

Works! :) Thank you!
I could put up some update for the readme if that's of interest to you?!

@lread
Copy link
Collaborator

lread commented Aug 22, 2023

That's probably a good idea @TimoKramer, but I think I'd want to verify it works across all browsers * OSes that Etaoin supports. (The accepted date format is a function of the WebDriver and maybe the browser, not Etaoin itself).

We can leave this open as a reminder for me to add some tests/docs.

@lread lread added the question label Aug 22, 2023
@lread lread changed the title input type date can not be filled docs: maybe explain date format required to fill input with date type Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants