1
0
mirror of synced 2026-08-10 09:27:03 +00:00

fix(screencast): register AnnotatePosition enum serializer (#1948)

This commit is contained in:
monkey
2026-08-05 01:59:25 +09:00
committed by GitHub
parent c9cdbf9de0
commit 382398631c
2 changed files with 19 additions and 0 deletions
@@ -45,6 +45,7 @@ class Serialization {
.registerTypeAdapter(Date.class, new DateSerializer())
.registerTypeAdapter(LocalDateTime.class, new LocalDateTimeSerializer())
.registerTypeAdapter(SameSiteAttribute.class, new SameSiteAdapter().nullSafe())
.registerTypeAdapter(AnnotatePosition.class, new ToLowerCaseAndDashSerializer<AnnotatePosition>())
.registerTypeAdapter(BrowserChannel.class, new ToLowerCaseAndDashSerializer<BrowserChannel>())
.registerTypeAdapter(ColorScheme.class, new ToLowerCaseAndDashSerializer<ColorScheme>())
.registerTypeAdapter(Contrast.class, new ToLowerCaseAndDashSerializer<Contrast>())
@@ -16,6 +16,7 @@
package com.microsoft.playwright;
import com.microsoft.playwright.options.AnnotatePosition;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
@@ -247,4 +248,21 @@ public class TestScreencast extends TestBase {
context.close();
}
}
@Test
void screencastShowActionsShouldAcceptEveryPosition() throws Exception {
BrowserContext context = browser.newContext();
Page page = context.newPage();
try {
page.navigate(server.EMPTY_PAGE);
for (AnnotatePosition position : AnnotatePosition.values()) {
AutoCloseable disposable = page.screencast().showActions(
new Screencast.ShowActionsOptions().setPosition(position));
assertNotNull(disposable);
disposable.close();
}
} finally {
context.close();
}
}
}