fix(실적): 수기 입력 뒤 새로고침해도 스크롤 위치 유지
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -101,6 +101,30 @@ async function stickyFlow(browser, file, label) {
|
||||
await p.waitForTimeout(120);
|
||||
const g4 = await geo();
|
||||
check(label + " 맨 위로 돌아오면 제자리", Math.abs(g4.headTop - g0.headTop) <= 1 && Math.abs(g4.totalTop - g4.headBottom) <= 1, g4);
|
||||
// 수기 입력 뒤 새로고침 — 세로·가로 스크롤 위치 그대로, 제목 행도 다시 화면 위(2026-11-02)
|
||||
const pos = function () {
|
||||
return p.evaluate(function () {
|
||||
const wrap = document.querySelector(".perf-main-wrap"), page = document.querySelector(".erp-page");
|
||||
return { top: page.scrollTop, left: wrap.scrollLeft, headTop: document.querySelector(".perf-main thead th").getBoundingClientRect().top, pageTop: page.getBoundingClientRect().top };
|
||||
});
|
||||
};
|
||||
await p.evaluate(function () { document.querySelector(".erp-page").scrollTop = 500; document.querySelector(".perf-main-wrap").scrollLeft = 120; });
|
||||
await p.waitForTimeout(80);
|
||||
const before = await pos();
|
||||
await Promise.all([p.waitForNavigation(), p.evaluate(function () {
|
||||
document.querySelector('td.is-manual-cell[data-date="2026-10-20"]').click();
|
||||
const input = document.querySelector(".perf-manual-input");
|
||||
input.value = "5000";
|
||||
input.blur();
|
||||
})]);
|
||||
await p.waitForTimeout(150);
|
||||
const after = await pos();
|
||||
check(label + " 수기 입력 뒤 새로고침해도 스크롤 위치 그대로", before.top === 500 && before.left > 0 && after.top === before.top && after.left === before.left &&
|
||||
Math.abs(after.headTop - after.pageTop) <= 1, { before: before, after: after });
|
||||
// 새로고침이 아닌 이동(같은 주소로 다시 들어옴)은 맨 위부터
|
||||
await p.goto("http://perf.test/performance/");
|
||||
await p.waitForTimeout(150);
|
||||
check(label + " 새로 들어오면 맨 위부터", (await pos()).top === 0);
|
||||
await ctx.close();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user