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

BadJSON parsing cookie expiry #135

Closed
dten opened this issue Oct 26, 2017 · 2 comments
Closed

BadJSON parsing cookie expiry #135

dten opened this issue Oct 26, 2017 · 2 comments

Comments

@dten
Copy link
Contributor

dten commented Oct 26, 2017

Recently (not sure when) the expiry time in cookies has sub section precision which causes BadJSON trying to parse it as an Integer

e.g. a cookie with "expiry":1509022264.455114
results in uncaught exception: BadJSON (BadJSON "Floating number specified for Integer: 1.509022264.455114e9")

https://github.com/kallisti-dev/hs-webdriver/blob/643d6ad02b52fb9dee8d9afec42d895d5f79af78/src/Test/WebDriver/Commands.hs#L356

Currently marked as an Integer in the type

Suspect this needs to be either a Double or a pair of something (often nanos is separated out)

@swamp-agr
Copy link
Contributor

Hi @dten,

Suggested by you fix works fine for me! I am able to dump and restore cookie data in my tests.

Thanks,
Andrey

@cvogt
Copy link

cvogt commented Oct 16, 2018

Experienced the same issue BadJSON "expected Integer, encountered floating number 1.571236758435066e9". Proposed fix looks correct!

Workaround:


import Data.Aeson
import Test.WebDriver.Commands.Internal
import Test.WebDriver.Class

...
   do
    ...
     c :: Value <- doSessCommand methodGet "/cookie" Null
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants