playwright-community / playwright-go

Playwright for Go a browser automation library to control Chromium, Firefox and WebKit with a single API.
https://playwright-community.github.io/playwright-go/
MIT License
1.94k stars 144 forks source link

Fix serializeValue to properly handle slices #411

Closed reginaldl closed 4 months ago

reginaldl commented 5 months ago

This change fixes serialization of slices when passed as argument to Evaluate(). I found two issues with how slices are serialized:

I also added a few tests.

I discovered that passing floats and time will not work. We do not correctly serialize valid floats but when I tried fixing it I got the following error: playwright: arg.value.v: expected one of (null|undefined|NaN|Infinity|-Infinity|-0)

Unfortunately, I wasn't able to fix this.

canstand commented 5 months ago

Thank you @reginaldl. There are multiple issues with serializeValue. I'll address it overall with another PR.

canstand commented 5 months ago

@reginaldl #412 merged and add you as co-authored.

canstand commented 4 months ago

close due to #412