Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
fix: don't rely on requestAnimationFrame (#34065)
Simon Knott443b2a2bbc51
diff --git a/packages/html-reporter/src/links.tsx b/packages/html-reporter/src/links.tsxindex a6ea1e6695..b8db4c0e9e 100644--- a/packages/html-reporter/src/links.tsx+++ b/packages/html-reporter/src/links.tsx@@ -143,7 +143,7 @@ export function useIsAnchored(id: AnchorID) {export function Anchor({ id, children }: React.PropsWithChildren<{ id: AnchorID }>) {const ref = React.useRef<HTMLDivElement>(null);const onAnchorReveal = React.useCallback(() => {- requestAnimationFrame(() => ref.current?.scrollIntoView({ block: 'start', inline: 'start' }));+ ref.current?.scrollIntoView({ block: 'start', inline: 'start' });}, []);useAnchor(id, onAnchorReveal);diff --git a/tests/playwright-test/reporter-html.spec.ts b/tests/playwright-test/reporter-html.spec.tsindex 5568455d63..556d12e8a2 100644--- a/tests/playwright-test/reporter-html.spec.ts+++ b/tests/playwright-test/reporter-html.spec.ts@@ -936,6 +936,9 @@ for (const useIntermediateMergeReport of [true, false] as const) {await expect(attachment).not.toBeInViewport();await page.getByLabel('attach "foo-2"').getByTitle('link to attachment').click();await expect(attachment).toBeInViewport();++ await page.reload();+ await expect(attachment).toBeInViewport();});test('should highlight textual diff', async ({ runInlineTest, showReport, page }) => {