feat(실적): 카페24(실적) 열·합계 기준 통일·공통 보기 설정·일 합계 고정
매출 실적 - "카페24" 열 → "카페24(전체)", 바로 오른쪽 "카페24(실적)" = 전체 − 자사몰(공동구매), 광고비 줄은 카페24(전체)의 구글·메타 그대로 (예전 "공구 제외" 열 대체) - 합계 기준 통일: 일 합계·ROAS·KPI·추이·비중·월/연 누적 = 카페24(실적) + 공동구매 + 나머지 (카페24(전체)에 공동구매가 들어 있어 이중 합산 제거, 그래프·누적의 카페24 줄 = 카페24(실적)) - 실적 설정 "공통 보기 설정"(관리자, perf_settings, 모든 사용자 적용): 매출 단위(예전 브라우저 쿠키 perf_unit 대체), 표 열 숨기기(열만, 합계 그대로) 표 열 너비는 사람(브라우저)마다 그대로 매출 실적·광고비 공통 - 일 합계 열을 날짜 오른쪽으로, 날짜와 함께 가로 고정 - 이전달·다음달 = 날짜 바로 옆 진한 회색 화살표 SVG(글자 높이) - 광고비 탭 매출 대비 광고비·합계 ROAS 도 공동구매 이중 합산 제거 CSS·JS 캐시 버전 20261102a. 새 마이그레이션 없음(011 perf_settings 사용). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -35,7 +35,7 @@ function page(file) {
|
||||
});
|
||||
};
|
||||
const h0 = await heads();
|
||||
check("그룹 열이 하위 열 바로 앞", JSON.stringify(h0.slice(1, 7)) === JSON.stringify(["카페24", "네이버", "오프라인", "매장A ✎", "매장B ✎", "행사 ✎"]), h0);
|
||||
check("그룹 열이 하위 열 바로 앞", JSON.stringify(h0.slice(1, 9)) === JSON.stringify(["일 합계", "카페24(전체)", "카페24(실적)", "네이버", "오프라인", "매장A ✎", "매장B ✎", "행사 ✎"]), h0);
|
||||
const expanded = function () { return p.getAttribute('[data-group-toggle="group_off"]', "aria-expanded"); };
|
||||
// 열 너비 = 내용 길이 — 표가 화면보다 좁으면 늘이지 않는다, 각 열은 그 열의 가장 긴 글자 + 여백 정도
|
||||
const fit = await p.evaluate(function () {
|
||||
|
||||
@@ -72,9 +72,9 @@ function gross(td) { return td.querySelector(".v-gross").textContent.trim(); }
|
||||
const e = await env("perf_dash.html");
|
||||
const heads = Array.from(e.d.querySelectorAll(".perf-main thead th")).map(function (th) { return th.textContent.replace("✎", "").trim(); });
|
||||
check("[순서] 카페24·네이버·쿠팡·토스·GS샵·11번가 다음 나머지", heads.join(",") ===
|
||||
"날짜,카페24,네이버,쿠팡,토스,GS샵,11번가,오늘의집,G마켓,카카오,롯데ON,일 합계", heads);
|
||||
check("[수동] 수동 입력 쇼핑몰 제목에 ✎ 표시", /✎/.test(e.d.querySelectorAll(".perf-main thead th")[3].textContent) &&
|
||||
!/✎/.test(e.d.querySelectorAll(".perf-main thead th")[1].textContent));
|
||||
"날짜,일 합계,카페24(전체),카페24(실적),네이버,쿠팡,토스,GS샵,11번가,오늘의집,G마켓,카카오,롯데ON", heads);
|
||||
check("[수동] 수동 입력 쇼핑몰 제목에 ✎ 표시", /✎/.test(e.d.querySelectorAll(".perf-main thead th")[5].textContent) &&
|
||||
!/✎/.test(e.d.querySelectorAll(".perf-main thead th")[2].textContent));
|
||||
// 2026-10-21 — 앞으로의 날도 입력 칸(사용자 요청). 주간합계 줄은 여전히 아님
|
||||
check("[수동] 날짜 칸은 앞으로의 날도 입력 칸(주간합계 아님), 수동 값 칸은 파란 표시",
|
||||
!!cell(e, "coupang", "2026-10-07") && !!cell(e, "coupang", "2026-10-08") && cell(e, "coupang", "2026-10-05").classList.contains("is-manual") &&
|
||||
@@ -112,7 +112,7 @@ function gross(td) { return td.querySelector(".v-gross").textContent.trim(); }
|
||||
check("[입력] 숫자가 아니면 저장 안 하고 안내", e.alerts.some(function (m) { return /숫자/.test(m); }) &&
|
||||
e.calls.filter(function (c) { return c.method === "PUT"; }).length === 1, e.alerts);
|
||||
}
|
||||
// ── 카페24(공구 제외) 열(2026-10-30) — 공동구매 칸 저장 → 같은 줄 차이 칸 = 카페24 − 새 값(dashboard._cafe24_ex_gb_column) ──
|
||||
// ── 카페24(실적) 열 — 공동구매 칸 저장 → 같은 줄 칸 = 카페24 − 새 값(dashboard._cafe24_real_column) ──
|
||||
{
|
||||
const e = await env("perf_dash.html");
|
||||
const td5 = cell(e, "coupang", "2026-10-05");
|
||||
@@ -182,7 +182,7 @@ function gross(td) { return td.querySelector(".v-gross").textContent.trim(); }
|
||||
check("[광고비] 광고비 탭이 고른 탭", e.d.querySelector(".perf-tab-ads").classList.contains("is-active"));
|
||||
const heads = Array.from(e.d.querySelectorAll(".perf-main thead th")).map(function (th) { return th.textContent.replace("✎", "").replace("table_view", "").trim(); });
|
||||
check("[광고비] 열 = 구글·메타·네이버·쿠팡(윙)·쿠팡(로켓)·오늘의집·G마켓·카카오·GS샵·11번가·롯데ON·토스·애터미아자몰·기타광고비(2026-10-22)",
|
||||
heads.join(",") === "날짜,구글,메타,네이버,쿠팡(윙),쿠팡(로켓),오늘의집,G마켓,카카오,GS샵,11번가,롯데ON,토스,애터미아자몰,기타광고비,일 합계", heads);
|
||||
heads.join(",") === "날짜,일 합계,구글,메타,네이버,쿠팡(윙),쿠팡(로켓),오늘의집,G마켓,카카오,GS샵,11번가,롯데ON,토스,애터미아자몰,기타광고비", heads);
|
||||
const wing = cell(e, "coupang_wing", "2026-10-05");
|
||||
check("[광고비] 칸 = 광고비(ROAS%) — 쿠팡(윙) 29,000 · 쿠팡 매출 87,000 → 300%",
|
||||
wing.textContent.trim() === "29,000(300%)" && !cell(e, "naver", "2026-10-05").querySelector(".perf-roas"), wing.textContent);
|
||||
@@ -312,6 +312,40 @@ function gross(td) { return td.querySelector(".v-gross").textContent.trim(); }
|
||||
await settle();
|
||||
check("[설정] 저장 실패(002 미적용) → 되돌리고 안내", !box2.checked && e.alerts.some(function (m) { return /마이그레이션/.test(m); }), e.alerts);
|
||||
}
|
||||
// ── 설정: 공통 보기 설정 — 매출 단위·열 숨기기, 모든 사용자에게 적용(서버 저장, 쿠키 아님) ──
|
||||
{
|
||||
const e = await env("perf_settings.html");
|
||||
check("[매출 단위] 공통 카드로 이동, 표 열 너비는 보기 설정에 그대로",
|
||||
e.d.querySelectorAll("#perf-shared-view [data-unit]").length === 3 && !e.d.querySelector("#perf-view-opts [data-unit]") && !!e.d.querySelector("#perf-view-opts [data-colw]"));
|
||||
const thousand = e.d.querySelector('#perf-shared-view [data-unit="thousand"]');
|
||||
thousand.click();
|
||||
await settle();
|
||||
const unitPut = e.calls.find(function (c) { return c.method === "PUT"; });
|
||||
check("[매출 단위] 누르면 서버에 저장·쿠키 안 씀", unitPut && unitPut.url === "/performance/api/display-unit" && unitPut.body.unit === "thousand" &&
|
||||
thousand.classList.contains("is-active") && !/perf_unit/.test(e.d.cookie), e.calls);
|
||||
e.status = 503;
|
||||
const million = e.d.querySelector('#perf-shared-view [data-unit="million"]');
|
||||
million.click();
|
||||
await settle();
|
||||
check("[매출 단위] 저장 실패 → 그대로·안내", !million.classList.contains("is-active") && thousand.classList.contains("is-active") && e.alerts.length > 0, e.alerts);
|
||||
}
|
||||
{
|
||||
const e = await env("perf_settings.html");
|
||||
const list = Array.from(e.d.querySelectorAll("#perf-shared-view [data-hide]")).map(function (x) { return x.dataset.hide; });
|
||||
check("[숨기기] 목록 = 표 열(카페24 바로 뒤 카페24(실적))", list.slice(0, 3).join(",") === "cafe24,cafe24_ex_gb,naver", list);
|
||||
const box = e.d.querySelector('#perf-shared-view [data-hide="naver"]');
|
||||
box.checked = true;
|
||||
box.dispatchEvent(new e.w.Event("change", { bubbles: true }));
|
||||
await settle();
|
||||
const put = e.calls.find(function (c) { return c.method === "PUT"; });
|
||||
check("[숨기기] 체크 → 서버에 바로 저장", put && put.url === "/performance/api/hidden-marketplaces" && put.body.codes.join(",") === "naver", e.calls);
|
||||
check("[숨기기] 쿠키에 안 남김", !/perf_hidden/.test(e.d.cookie), e.d.cookie);
|
||||
e.status = 503;
|
||||
box.checked = false;
|
||||
box.dispatchEvent(new e.w.Event("change", { bubbles: true }));
|
||||
await settle();
|
||||
check("[숨기기] 저장 실패 → 되돌리고 안내", box.checked && e.alerts.length > 0, e.alerts);
|
||||
}
|
||||
console.log(fails.length ? "\n" + fails.length + " FAILED" : "\nALL PASS");
|
||||
process.exit(fails.length ? 1 : 0);
|
||||
})();
|
||||
|
||||
@@ -73,6 +73,23 @@ async function stickyFlow(browser, file, label) {
|
||||
const g2 = await geo();
|
||||
check(label + " 가로 스크롤해도 기간 합계 날짜 칸은 왼쪽 고정", Math.abs(g2.labelLeft - g2.wrapLeft) <= 1.5 && g2.hitLabel &&
|
||||
Math.abs(g2.headTop - g2.pageTop) <= 1, g2);
|
||||
// 일 합계 열 — 날짜 열 바로 오른쪽에 함께 고정(제목·기간 합계·일 행 모두), 위에 다른 칸이 안 겹침(2026-11-02)
|
||||
const tg = await p.evaluate(function () {
|
||||
const box = function (s) { return document.querySelector(s).getBoundingClientRect(); };
|
||||
const hit = function (s) { const r = box(s), n = document.elementFromPoint(r.left + r.width / 2, r.top + r.height / 2); return !!n.closest(s); };
|
||||
const label = box(".perf-main thead th.perf-th-label");
|
||||
const rows = [".perf-main thead th.perf-th-total", ".perf-main tbody tr.perf-row-total:first-child > .perf-td-total", ".perf-main tbody tr.perf-row-day > .perf-td-total"];
|
||||
return { labelRight: label.right, lefts: rows.map(function (s) { return box(s).left; }), hits: rows.slice(0, 2).map(hit), scrolled: document.querySelector(".perf-main-wrap").scrollLeft };
|
||||
});
|
||||
check(label + " 가로 스크롤해도 일 합계 열은 날짜 열 바로 옆 고정", tg.scrolled > 0 && tg.lefts.every(function (x) { return Math.abs(x - tg.labelRight) <= 1.5; }) && tg.hits.every(Boolean), tg);
|
||||
// 기간 이동 — 날짜 바로 좌우 화살표 SVG(글자 높이), 글자 없음
|
||||
const nv = await p.evaluate(function () {
|
||||
const a = document.querySelectorAll(".perf-nav-btn"), lb = document.querySelector(".perf-nav-label").getBoundingClientRect();
|
||||
const svg = a[0].querySelector("svg");
|
||||
return { text: a[0].textContent.trim() + a[1].textContent.trim(), h: svg.getBoundingClientRect().height, size: parseFloat(getComputedStyle(document.querySelector(".perf-nav-label")).fontSize),
|
||||
stroke: getComputedStyle(svg).stroke, gapL: lb.left - a[0].getBoundingClientRect().right, gapR: a[1].getBoundingClientRect().left - lb.right };
|
||||
});
|
||||
check(label + " 기간 이동 = 날짜 바로 옆 글자 높이 화살표(진한 회색)", nv.text === "" && Math.abs(nv.h - nv.size) <= 1 && nv.gapL <= 3 && nv.gapR <= 3 && nv.stroke === "rgb(68, 68, 68)", nv);
|
||||
// 표 끝을 넘어가면 같이 올라간다(표 밖으로 나가지 않음)
|
||||
await p.evaluate(function () { const pg = document.querySelector(".erp-page"); pg.scrollTop = pg.scrollHeight; });
|
||||
await p.waitForTimeout(120);
|
||||
|
||||
Reference in New Issue
Block a user