Просмотр исходного кода

Fix scrolling behavior in openPutBackPageModal for better button interaction

Yuki Takei 10 месяцев назад
Родитель
Сommit
3c1fb4ed61
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      apps/app/playwright/20-basic-features/use-tools.spec.ts

+ 5 - 1
apps/app/playwright/20-basic-features/use-tools.spec.ts

@@ -34,9 +34,13 @@ const openPutBackPageModal = async(page: Page): Promise<void> => {
 
   // Scroll to the top of the page to prevent the subnav hide the button
   await page.evaluate(() => {
-    window.scrollTo(0, 0);
+    document.documentElement.scrollTop = 0;
+    document.body.scrollTop = 0; // For Safari and older browsers
   });
 
+  // Add a small delay to ensure scrolling is complete and the button is interactive
+  await page.waitForTimeout(200); // Increased delay
+
   await button.click();
   await expect(page.getByTestId('put-back-page-modal')).toBeVisible();
 };