fix(provider-webdriver): send an empty JSON object on bodyless POSTs
Merged
OK
2mo ago+48+48+01234567890123456789-2-2-0123456789
Summary
back failed on every AWS Device Farm session with Device Farm's 1 validation error detected: Value null at 'payload' failed to satisfy constraint: Member must not be null. The WebDriver transport sent POST /session/:id/back with no body. The W3C protocol makes every POST body a JSON object, and Device Farm's remote access gateway enforces that in front of Appium, while Appium itself accepts either.
WebDriverTransport now sends {} for a POST with no parameters, with Content-Type: application/json. GET and DELETE stay bodyless. One production file, one test file.
agent-device connect aws-device-farm --platform android --aws-project-arn <arn> --aws-device-arn <arn> --aws-app-arn <arn>
agent-device open com.example.app
agent-device back
Validation
Tested commit: 6019584.
pnpm check:affected --runon 6019584: all runnable checks passed (122 files, 773 tests).- New transport test: a local driver records that
POSTarrives with body{}and a JSON content type whileDELETEandGETarrive without a body. - Live: this branch's build against a Google Pixel 8 (Android 15) on AWS Device Farm,
connect aws-device-farmthenopen dev.e2e.benchmark,click @e19,back,back. Bothbackrequests finishedstatus: okin the session request log (request.finished,command: back, 1262 ms and 608 ms). Before the change the same command failed with the Device Farm validation error above on agent-device 0.21.20. - Not covered live: BrowserStack and Limrun, which accepted bodyless POSTs before and accept
{}per the W3C protocol.