feat(안내문 발송): DM 수동 보내기를 별도 탭(/outreach/dm)으로
- 탭 [발송 리스트] [DM 수동 보내기] + 맨 오른쪽 설정 톱니(_tabs.html)
- /outreach/dm: 왼쪽 이름 넣기·이름 목록, 오른쪽 본문 — 이름 누르면 {이름} 바뀌고 복사 + 짧은 안내
- 리스트 화면의 DM 수동 버튼·창은 뺌
- outreach.js/css 캐시 버전 20261030b, 화면·브라우저 테스트
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -53,7 +53,8 @@ function check(name, cond, extra) {
|
||||
}
|
||||
return json({});
|
||||
}
|
||||
r.fulfill({ status: 200, contentType: "text/html; charset=utf-8", body: fs.readFileSync(path.join(__dirname, ".out", "outreach.html"), "utf8") });
|
||||
const page = url === "/outreach/dm" ? "outreach_dm.html" : "outreach.html"; // DM 수동 보내기 탭(2026-10-30)
|
||||
r.fulfill({ status: 200, contentType: "text/html; charset=utf-8", body: fs.readFileSync(path.join(__dirname, ".out", page), "utf8") });
|
||||
});
|
||||
const p = await ctx.newPage();
|
||||
p.on("dialog", function (d) { d.accept(); });
|
||||
@@ -120,16 +121,25 @@ function check(name, cond, extra) {
|
||||
await p.waitForTimeout(200);
|
||||
const sendCall = calls.find(function (c) { return c.url === "/outreach/api/send"; });
|
||||
check("고른 메일 보내기 → 메일·대기 줄만 보냄", !!sendCall && JSON.stringify(sendCall.body.ids) === "[1,3]", sendCall);
|
||||
// 설정 = 맨 오른쪽 톱니 아이콘(2026-10-30)
|
||||
// 탭 [발송 리스트][DM 수동 보내기] + 설정 = 맨 오른쪽 톱니 아이콘(2026-10-30)
|
||||
const gear = await p.evaluate(function () {
|
||||
const g = document.querySelector(".otr-gear"), top = document.querySelector(".otr-top").getBoundingClientRect(), r = g.getBoundingClientRect();
|
||||
const g = document.querySelector(".otr-gear"), top = document.querySelector(".otr-tabs").getBoundingClientRect(), r = g.getBoundingClientRect();
|
||||
return { href: g.getAttribute("href"), icon: g.textContent.trim(), right: Math.round(top.right - r.right),
|
||||
font: getComputedStyle(g.querySelector(".material-symbols-outlined")).fontFamily };
|
||||
});
|
||||
check("설정 = 맨 오른쪽 톱니(글자 대신 아이콘)", gear.href === "/outreach/settings" && gear.icon === "settings" && gear.right <= 2 &&
|
||||
/Material Symbols/.test(gear.font), gear);
|
||||
// DM 수동 보내기 — 이름 넣기 → 왼쪽 목록, 이름 누르면 오른쪽 문구 {이름} 바뀌고 복사 + 짧은 안내
|
||||
await p.click("#otr-dm-open");
|
||||
const tabs = await p.$$eval(".otr-tab", function (els) { return els.map(function (e) { return [e.textContent.trim(), e.getAttribute("href"), e.classList.contains("is-active")]; }); });
|
||||
check("탭 = 발송 리스트(선택됨) · DM 수동 보내기", JSON.stringify(tabs) === JSON.stringify([["forward_to_inbox발송 리스트", "/outreach/", true], ["chatDM 수동 보내기", "/outreach/dm", false]]), tabs);
|
||||
// DM 수동 보내기 탭 — 왼쪽 이름(넣기 + 목록) | 오른쪽 본문. 이름 누르면 문구 {이름} 바뀌고 복사 + 짧은 안내
|
||||
await p.click('.otr-tab[href="/outreach/dm"]');
|
||||
await p.waitForSelector("#otr-dm-names");
|
||||
const lay = await p.evaluate(function () {
|
||||
const l = document.getElementById("otr-dm-names").getBoundingClientRect(), r = document.getElementById("otr-dm-body").getBoundingClientRect();
|
||||
return { leftOfBody: l.right < r.left, active: document.querySelector(".otr-tab.is-active").getAttribute("href"),
|
||||
body: document.getElementById("otr-dm-body").textContent };
|
||||
});
|
||||
check("DM 탭 — 왼쪽 이름 목록, 오른쪽 본문({이름} 그대로)", lay.leftOfBody && lay.active === "/outreach/dm" && lay.body.includes("{이름}"), lay);
|
||||
await p.fill("#otr-dm-text", "이름\n김민지\t메모\n\n박서준, x\n김민지");
|
||||
await p.click("#otr-dm-load");
|
||||
const names = await p.$$eval("#otr-dm-names .otr-dm-name", function (els) { return els.map(function (e) { return e.textContent; }); });
|
||||
@@ -145,7 +155,8 @@ function check(name, cond, extra) {
|
||||
dm.clip === dm.body && /박서준 님 문구를 클립보드에 복사/.test(dm.toast), dm);
|
||||
await p.waitForTimeout(1800);
|
||||
check("안내는 잠깐 뒤 사라짐", await p.evaluate(function () { return document.getElementById("otr-toast").hidden; }));
|
||||
await p.click("#otr-dm-close");
|
||||
await p.goBack();
|
||||
await p.waitForSelector("#otr-add-open");
|
||||
// 리스트 추가 — 미리보기(판별) → 추가
|
||||
await p.click("#otr-add-open");
|
||||
await p.fill("#otr-add-text", "new@x.com 새사람\n@hong 홍\n홍길동");
|
||||
|
||||
Reference in New Issue
Block a user