Scroll event not triggering correctly?
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- html, java, javascript
- 領域
- testing
調査の方向性
Start by reproducing the supplied JUnit test with both ChromeDriver and HtmlUnitDriver; the issue does not name repository files or existing tests to use. Investigate how HtmlUnit handles scrollIntoView and IntersectionObserver, then add a regression test for the behavior. Done means the observer callback increments the count as expected in HtmlUnit, while the Chrome comparison still passes.
索引モデルが issue の本文から書いたものです。
説明
I've ran into a case where triggering javascript scrollintoView has no effect, not triggering an event that is supposed to dynamically load the next page of data.
Here is a basic test case:
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
public class ScrollTest {
public static final String PAGE;
static {
try {
PAGE = Files.readString(Path.of(ScrollTest.class.getClassLoader().getResource("testPage1.html").toURI()));
} catch (IOException | URISyntaxException e) {
throw new RuntimeException(e);
}
}
private static final HtmlUnitDriver huDriver = new HtmlUnitDriver(true);
private static final WebDriver chromeDriver = new ChromeDriver();
@AfterAll
static void closeAll(){
huDriver.close();
chromeDriver.close();
}
@Test
void givenPageWithTable_whenScrollTo_TriggerEvent(){
runTest(chromeDriver);
runTest(huDriver);
}
private static void runTest(WebDriver driver) {
driver.get(PAGE);
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView()", driver.findElement(By.id("last")));
Assertions.assertEquals(1L,
((JavascriptExecutor) driver).executeScript("return count"));
}
}
and here is the html file I used for testing, feel free to add more table rows if needed
data:text/html,
<table>
<tr>row</tr>
<br>
<tr id="last"></tr>
</table>
<script>
var count = 0;
const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
console.log("triggered");
count++;
})
});
observer.observe(document.getElementById("last"));
</script>
The results are incosistent:
org.opentest4j.AssertionFailedError:
Expected :1
Actual :0
<Click to see difference>
at ScrollTest.runTest(ScrollTest.java:45)
at ScrollTest.givenPageWithTable_whenScrollTo_TriggerEvent(ScrollTest.java:39)
...removed rest of generic stack trace...
- 主要言語
- JavaScript
- スター
- 952
- フォーク
- 183
- 平均マージ
- 2日 1時間
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
HtmlUnit/htmlunit のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
HtmlUnit/htmlunit の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
account: profile bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 5 日以内に返信
-
ai-driven-fuzzing bug claude Minor
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
linagora/cozy-client#1777 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
NanmiCoder/dsh-agent-teams#326 ·
メンテナーはふだん 1 日以内に返信
-
[guide] AGENTS.md claims the coverage gate, e2e and full lint run on every PR after ADR 0011 focused validation対応中かも @hivecommons-hive が今日担当しました。 オープンagent/guide documentation hive/claimed-by-guide stage/040-covered-by-pr
難易度 2/5 1〜3時間 初心者へのやさしさ 81/100
cncf/endusers#2006 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信