Uh oh!
There was an error while loading. Please reload this page.
fix(screencast): register AnnotatePosition enum serializer - #1948
Conversation
AnnotatePosition had no Gson serializer registered, so Screencast.showActions() sent the raw enum constant (e.g. TOP_RIGHT) to the driver, which rejected it with "position: expected one of (top-left|top|top-right|...)". Register it with ToLowerCaseAndDashSerializer so values serialize as top-right, matching the other dashed enums. Fixes: microsoft#1912
monkey (Develop-KIM)
commented
Jul 9, 2026
@microsoft-github-policy-service agree |
Yury Semikhatsky (yury-s)
left a comment
There was a problem hiding this comment.
The change looks good, let's update the test
| public class TestSerialization { | ||
| @Test | ||
| void annotatePositionSerializesToLowerCaseAndDash() { |
There was a problem hiding this comment.
let's turn it into and e2e test and check that actual playwright api call doesn't throw page.screencast().showActions(new Screencast.ShowActionsOptions().setPosition(AnnotatePosition.TOP_RIGHT))
monkey (Develop-KIM)
commented
Aug 4, 2026
Done — dropped the serializer unit test and moved the coverage into for (AnnotatePositionposition : AnnotatePosition.values()) {
AutoCloseabledisposable = page.screencast().showActions(
newScreencast.ShowActionsOptions().setPosition(position));
assertNotNull(disposable);
disposable.close();
}Ran it against a real browser both ways. Without the serializer registration every position fails with I looped over all six values rather than just |
Uh oh!
There was an error while loading. Please reload this page.
Summary
AnnotatePositionhad no Gson serializer registered, sopage.screencast().showActions(new Screencast.ShowActionsOptions().setPosition(AnnotatePosition.TOP_RIGHT))sent the raw constantTOP_RIGHTto the driver, which rejected it:position: expected one of (top-left|top|top-right|...).ToLowerCaseAndDashSerializer(as used forColorScheme,ServiceWorkerPolicy, …) so values serialize astop-rightetc.Fixes#1912