feat(cupang): 출고리스트 작성 팝업 — 입고센터별 카드 배경색
센터를 고르면 카드 배경·왼쪽 띠·제목 색이 센터마다 달라진다(팝업에 나온 순서대로 8색, 같은 센터는 같은 색, 미선택은 회색). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -91,6 +91,10 @@ async function pickDate(page, inputId, typed) {
|
||||
await pop.waitFor({ state: "detached" });
|
||||
}
|
||||
|
||||
const tone = card => card.evaluate(el => el.dataset.tone || null);
|
||||
// 배경색은 .15s 전환이 끝난 뒤에 읽는다
|
||||
const bg = card => card.page().waitForTimeout(250).then(() => card.evaluate(el => getComputedStyle(el).backgroundColor));
|
||||
|
||||
async function addProduct(card, text, qty) {
|
||||
await card.locator(".cpg-ol-search-input").fill(text);
|
||||
await card.locator(".cpg-ol-search-input").press("Enter");
|
||||
@@ -149,7 +153,11 @@ async function addProduct(card, text, qty) {
|
||||
// 첫 센터: 필수값 확인 → 인천32 파렛트, 제품 2개
|
||||
await page.locator("#cpg-ol-submit").click();
|
||||
assert.equal(await page.locator("#cpg-ol-error").innerText(), "입고센터를 선택해 주세요.");
|
||||
assert.equal(await tone(c1), null, "센터를 고르기 전엔 회색");
|
||||
const grayBg = await bg(c1);
|
||||
await c1.locator(".cpg-ol-center-sel").selectOption("인천32");
|
||||
assert.equal(await tone(c1), "0");
|
||||
assert.notEqual(await bg(c1), grayBg, "센터를 고르면 색이 생김");
|
||||
await page.locator("#cpg-ol-submit").click();
|
||||
assert.equal(await page.locator("#cpg-ol-error").innerText(), "제품을 1개 이상 추가해 주세요.");
|
||||
assert.ok(!(await c1.locator(".cpg-ol-lines").isVisible()), "제품이 없으면 표를 숨김");
|
||||
@@ -176,6 +184,8 @@ async function addProduct(card, text, qty) {
|
||||
assert.equal(await page.locator("#cpg-ol-error").innerText(), "입고센터 2: 입고센터를 선택해 주세요.");
|
||||
await c2.locator(".cpg-ol-center-sel").selectOption("__new__");
|
||||
await c2.locator(".cpg-ol-center-new").fill("이천1");
|
||||
assert.equal(await tone(c2), "1");
|
||||
assert.notEqual(await bg(c2), await bg(c1), "다른 센터는 다른 배경색");
|
||||
await addProduct(c2, "중형", 30);
|
||||
// 3번 카드를 만든 뒤 가운데(이천1) 카드를 지우면 번호가 다시 매겨진다
|
||||
await page.locator("#cpg-ol-add-center").click();
|
||||
@@ -185,7 +195,12 @@ async function addProduct(card, text, qty) {
|
||||
const c2b = cards.nth(1);
|
||||
assert.equal(await c2b.locator(".cpg-ol-center-no").innerText(), "입고센터 2");
|
||||
assert.equal(await c2b.locator(".cpg-ol-lines tbody tr").count(), 0, "지운 카드의 제품은 따라오지 않음");
|
||||
assert.equal(await tone(c2b), null);
|
||||
await c2b.locator(".cpg-ol-center-sel").selectOption("인천32");
|
||||
assert.equal(await bg(c2b), await bg(c1), "같은 센터는 같은 배경색");
|
||||
await c2b.locator(".cpg-ol-center-sel").selectOption("대구3");
|
||||
assert.equal(await tone(c2b), "1");
|
||||
assert.notEqual(await bg(c2b), await bg(c1));
|
||||
await addProduct(c2b, "중형", 30);
|
||||
await page.screenshot({ path: path.join(OUT, "cupang-outbound-dialog.png"), fullPage: true });
|
||||
|
||||
@@ -275,7 +290,7 @@ async function addProduct(card, text, qty) {
|
||||
await page.screenshot({ path: path.join(OUT, "cupang-outbound-mobile.png") });
|
||||
|
||||
assert.deepEqual(errors, [], "브라우저 JS 오류 없음");
|
||||
console.log("ALL PASS — 버튼, 날짜 팝업, 입고센터 카드(추가·삭제·번호·기본 택배), 코드표 검색, 진행 막대·%, 완료·실패, Esc, 모바일");
|
||||
console.log("ALL PASS — 버튼, 날짜 팝업, 입고센터 카드(추가·삭제·번호·기본 택배·센터별 색), 코드표 검색, 진행 막대·%, 완료·실패, Esc, 모바일");
|
||||
} finally {
|
||||
if (browser) await browser.close();
|
||||
await new Promise(resolve => server.close(resolve));
|
||||
|
||||
Reference in New Issue
Block a user