Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: fix annotation position on screen (#39907)

Pavel Feldmana981727a1b9d
diff --git a/examples/todomvc/playwright.config.ts b/examples/todomvc/playwright.config.ts
index 2f6bdc9d4a..cb9e3e0ebf 100644
--- a/examples/todomvc/playwright.config.ts
+++ b/examples/todomvc/playwright.config.ts
@@ -50,8 +50,8 @@ export default defineConfig({
video: {
mode: 'on',
annotate: {
- action: {},
- test: {}
+ action: { position: 'top-left'},
+ test: { position: 'top-right' },
}
},
},
diff --git a/packages/injected/src/highlight.css b/packages/injected/src/highlight.css
index 6b79f90313..bfa4ee6e19 100644
--- a/packages/injected/src/highlight.css
+++ b/packages/injected/src/highlight.css
@@ -109,8 +109,6 @@ x-pw-action-point {
x-pw-title {
position: absolute;
- top: 6px;
- right: 6px;
backdrop-filter: blur(5px);
background-color: rgba(0, 0, 0, 0.5);
color: white;
diff --git a/packages/playwright/src/index.ts b/packages/playwright/src/index.ts
index 9153fe9478..b5733705b9 100644
--- a/packages/playwright/src/index.ts
+++ b/packages/playwright/src/index.ts
@@ -839,12 +839,12 @@ async function installScreencastTitleUpdater(testInfo: TestInfoImpl, context: Br
function createTestOverlay(parts: string[], position: string, fontSize: number) {
const positionStyles: Record<string, string> = {
- 'top-left': 'top: 3px; left: 3px;',
- 'top': 'top: 3px; left: 50%; transform: translateX(-50%);',
- 'top-right': 'top: 3px; right: 3px;',
- 'bottom-left': 'bottom: 3px; left: 3px;',
- 'bottom': 'bottom: 3px; left: 50%; transform: translateX(-50%);',
- 'bottom-right': 'bottom: 3px; right: 3px;',
+ 'top-left': 'top: 6px; left: 6px;',
+ 'top': 'top: 6px; left: 50%; transform: translateX(-50%);',
+ 'top-right': 'top: 6px; right: 6px;',
+ 'bottom-left': 'bottom: 6px; left: 6px;',
+ 'bottom': 'bottom: 6px; left: 50%; transform: translateX(-50%);',
+ 'bottom-right': 'bottom: 6px; right: 6px;',
};
const posStyle = positionStyles[position] ?? positionStyles['top-left'];
return `<div style="white-space: nowrap; font-size: ${fontSize}px; padding: 3px 6px; background: rgba(0,0,0,0.5); color: white; border-radius: 4px; position: absolute; ${posStyle}">