feat(performance): 셀 메모를 모든 쇼핑몰 날짜 칸에서 — API 쇼핑몰 칸도 우클릭 메모
메모 대상을 수동 입력 칸(td.is-manual-cell)에서 쇼핑몰 날짜 칸 전부(td[data-memo-code])로 넓힘. 왼쪽 클릭은 그대로(입력 칸 = 금액 입력, API 칸 = 주문 내역). 그룹 열·주간합계·합계 줄은 아님. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,7 @@ function page(file) {
|
||||
.replace(/<script src="\/static\/performance\.js[^"]*" defer><\/script>/, function () { return "<script>" + js + "</script>"; });
|
||||
}
|
||||
|
||||
async function memoFlow(browser, file, kind, code, day, hasMemo, label) {
|
||||
async function memoFlow(browser, file, kind, code, day, hasMemo, label, manual) {
|
||||
const ctx = await browser.newContext({ viewport: { width: 1400, height: 900 } });
|
||||
const p = await ctx.newPage();
|
||||
const puts = [];
|
||||
@@ -40,10 +40,10 @@ async function memoFlow(browser, file, kind, code, day, hasMemo, label) {
|
||||
return Array.from(document.querySelectorAll(".perf-main tbody [title]")).map(function (n) { return n.tagName + ":" + n.getAttribute("title"); });
|
||||
});
|
||||
check(label + " 표 칸에 풍선 도움말(title) 없음", tips.length === 0, tips.slice(0, 5));
|
||||
const td = '[data-manual-code="' + code + '"][data-date="' + day + '"]';
|
||||
const td = 'td[data-memo-code="' + code + '"][data-date="' + day + '"]';
|
||||
// 표를 스크롤하면 열린 메뉴는 닫힌다(사람은 스크롤한 뒤 우클릭) — 오른쪽 끝 열(기타광고비)은 먼저 보이게 스크롤해 둔다
|
||||
const show = async function (sel) { await p.locator(sel).scrollIntoViewIfNeeded(); await p.waitForTimeout(80); };
|
||||
const memoed = '[data-manual-code="' + hasMemo[0] + '"][data-date="' + hasMemo[1] + '"]';
|
||||
const memoed = 'td[data-memo-code="' + hasMemo[0] + '"][data-date="' + hasMemo[1] + '"]';
|
||||
// 기존 메모 = 빨간 삼각형 + 마우스 올리면 메모 상자
|
||||
const mark = await p.evaluate(function (sel) {
|
||||
const el = document.querySelector(sel);
|
||||
@@ -87,9 +87,10 @@ async function memoFlow(browser, file, kind, code, day, hasMemo, label) {
|
||||
await p.waitForFunction(function (sel) { return !document.querySelector(sel).classList.contains("has-memo"); }, td);
|
||||
check(label + " 메모 삭제 → 빈 메모로 저장, 표시 사라짐", puts[puts.length - 1].memo === "");
|
||||
check(label + " 저장한 뒤에도 칸에 풍선 도움말 없음", !(await p.getAttribute(td, "title")));
|
||||
// 칸 왼쪽 클릭은 예전처럼 금액 입력
|
||||
// 칸 왼쪽 클릭은 예전처럼 — 입력 칸은 금액 입력, API 쇼핑몰 칸은 입력 칸이 아님(값 있으면 주문 내역)
|
||||
await p.click(td);
|
||||
check(label + " 칸 클릭은 그대로 금액 입력", !!(await p.$(td + " .perf-manual-input")));
|
||||
if (manual !== false) check(label + " 칸 클릭은 그대로 금액 입력", !!(await p.$(td + " .perf-manual-input")));
|
||||
else check(label + " API 쇼핑몰 칸은 입력 칸이 아님(우클릭 메모만)", !(await p.$(td + " .perf-manual-input")) && !(await p.$(td + ".is-manual-cell")));
|
||||
await ctx.close();
|
||||
}
|
||||
|
||||
@@ -97,6 +98,8 @@ async function memoFlow(browser, file, kind, code, day, hasMemo, label) {
|
||||
const browser = await chromium.launch(process.env.PJ_TEST_BROWSER ? { executablePath: process.env.PJ_TEST_BROWSER } : {});
|
||||
try {
|
||||
await memoFlow(browser, "perf_dash.html", "sales", "coupang", "2026-10-06", ["coupang", "2026-10-05", "행사 매출 포함\n2차 정산 예정"], "[매출]");
|
||||
// 2026-10-22 — API 쇼핑몰(카페24, 수동 입력 아님) 칸도 메모
|
||||
await memoFlow(browser, "perf_dash.html", "sales", "cafe24", "2026-10-06", ["coupang", "2026-10-05", "행사 매출 포함\n2차 정산 예정"], "[매출·API 쇼핑몰]", false);
|
||||
await memoFlow(browser, "perf_ads.html", "ad", "etc", "2026-10-06", ["coupang_wing", "2026-10-05", "쿠폰 광고"], "[광고비]");
|
||||
|
||||
// 광고비 표 — 기타광고비 열, 열 너비 = 내용, 날짜 열 고정
|
||||
|
||||
Reference in New Issue
Block a user