回答編集履歴
1
locator.scrollIntoViewIfNeededを使うケースを追加
answer
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
-
以下の
|
1
|
+
以下の3つが思いつきました
|
2
2
|
|
3
3
|
mouse-wheelを使う
|
4
4
|
https://playwright.dev/docs/api/class-mouse#mouse-wheel
|
5
5
|
|
6
|
+
locator.scrollIntoViewIfNeededを使う
|
7
|
+
https://playwright.dev/docs/api/class-locator#locator-scroll-into-view-if-needed
|
8
|
+
|
6
9
|
jsを実行してscrollさせる
|
7
10
|
```typescript
|
8
11
|
await page.evaluate(() => window.scrollTo(0, 0));
|