Revert "fix(507-1 노출형 횡단수로 · 개거 = 횡단면 표시만): 부품 상자 형상 「표시만」(mark · 읽는 칸 없음 · 그림 없음) · 두 종류 처음값 = 측점 세움(anchor) + 표시만 · B05 「횡단」 판 · 임시 횡단 창 = 머리 걷기 전 구조물 이름 칩 남김 — 요구 311-2"
This reverts commit 254b5267ff.
This commit is contained in:
@@ -156,10 +156,8 @@ export function routeCrossCard(
|
||||
box,
|
||||
);
|
||||
// 그래프만(393-3) — 카드 머리 · 줌 단추 · 발(암 경계 · 요약) 걷음 · 벽 · 선 · 면적 고름 막음
|
||||
// 경고 칩(빈칸 · 기본값 · 사면 열림) · 구조물 이름(표시만 종류 · 507-1)만 그래프 오른쪽 위에 겹쳐 남김(505-3)
|
||||
const chips = card.querySelectorAll(
|
||||
":scope > header .b06-cross-card__warning, :scope > header .b06-cross-card__structure",
|
||||
);
|
||||
// 경고 칩(빈칸 · 기본값 · 사면 열림)만 그래프 오른쪽 위에 겹쳐 남김(505-3)
|
||||
const chips = card.querySelectorAll(":scope > header .b06-cross-card__warning");
|
||||
if (chips.length) {
|
||||
const box = document.createElement("div");
|
||||
box.className = "b05-cross-chips";
|
||||
|
||||
@@ -150,12 +150,6 @@
|
||||
"읽는 칸": ["pave_spec", "height_m", "widening_off"],
|
||||
"자리꼴": ["interval"],
|
||||
"정본": ["structures"]
|
||||
},
|
||||
"mark": {
|
||||
"이름": "표시만(형상 없음 · 측점 · 이름만)",
|
||||
"읽는 칸": [],
|
||||
"자리꼴": ["point", "interval", "site"],
|
||||
"정본": ["pipe_points", "structures"]
|
||||
}
|
||||
},
|
||||
"3D": {
|
||||
@@ -229,16 +223,16 @@
|
||||
},
|
||||
"cross_drain_exposed": {
|
||||
"목록": "both",
|
||||
"횡단도": "anchor",
|
||||
"횡단도": "none",
|
||||
"카드이름": "name",
|
||||
"형상": "mark",
|
||||
"형상": "none",
|
||||
"3D": "none"
|
||||
},
|
||||
"open_ditch": {
|
||||
"목록": "both",
|
||||
"횡단도": "anchor",
|
||||
"횡단도": "none",
|
||||
"카드이름": "name",
|
||||
"형상": "mark",
|
||||
"형상": "none",
|
||||
"3D": "none"
|
||||
},
|
||||
"cross_underdrain": {
|
||||
|
||||
@@ -53,8 +53,8 @@ const enabled = (id) => def.types.find((t) => t.type_id === id).enabled;
|
||||
const own = (id) => clone(reflect.reflectOf(def)[id] ?? null);
|
||||
reflect.setReflect(def, "wildlife_path", "목록", "both");
|
||||
reflect.setReflect(def, "retaining_wall", "목록", "b06");
|
||||
reflect.setReflect(def, "open_ditch", "횡단도", "anchor");
|
||||
reflect.setReflect(def, "cross_drain_exposed", "횡단도", "none");
|
||||
reflect.setReflect(def, "open_ditch", "횡단도", "none");
|
||||
reflect.setReflect(def, "cross_drain_exposed", "횡단도", "anchor");
|
||||
const setBefore = reflect.isSet(def, "cross_drain_exposed", "횡단도");
|
||||
reflect.setShapeOpt(def, "soil_guard", "weep", true);
|
||||
const weepOn = own("soil_guard");
|
||||
@@ -95,8 +95,8 @@ const steps = [];
|
||||
reflect.setReflect(work, "masonry_wet", "목록", "both");
|
||||
steps.push(reflect.differs(work, base));
|
||||
reflect.setReflect(work, "masonry_wet", "목록", "hidden");
|
||||
reflect.setReflect(work, "open_ditch", "횡단도", "none");
|
||||
reflect.setReflect(work, "open_ditch", "횡단도", "anchor");
|
||||
reflect.setReflect(work, "open_ditch", "횡단도", "none");
|
||||
reflect.setShapeOpt(work, "soil_guard", "form", "콘크리트");
|
||||
reflect.setShapeOpt(work, "soil_guard", "form", "통나무·목재틀");
|
||||
reflect.setShown(work, "pipe", ["wing_wall_type"], false);
|
||||
|
||||
@@ -41,7 +41,7 @@ PIPES = [
|
||||
},
|
||||
]
|
||||
STRUCTURES = [
|
||||
# 노출형 = 구조물 표 횡단도 anchor · 형상 표시만(507-1 · 요구 311-2) — 측점 심음
|
||||
# 노출형 = 구조물 표 횡단도 none(322-1 ★1) — 측점 안 심음
|
||||
{"type_id": "cross_drain_exposed", "placement": "point", "chainage_m": 120.0},
|
||||
{
|
||||
"type_id": "retaining_wall",
|
||||
@@ -67,7 +67,7 @@ STRUCTURES = [
|
||||
},
|
||||
{"type_id": "evac_road", "placement": "point", "chainage_m": 720.0},
|
||||
]
|
||||
EXPECTED = [95, 120, 160, 230, 300, 395, 400, 410, 500, 510, 530, 545, 560]
|
||||
EXPECTED = [95, 160, 230, 300, 395, 400, 410, 500, 510, 530, 545, 560]
|
||||
# 368-2 추가 측점 — 47 만 듦(95 관 · 300 세월교 자리는 그쪽이 이김)
|
||||
PLUS = [47.0, 95.0, 300.0]
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ TABLE = {
|
||||
"box_culvert": ("both", "anchor", "name", "box", "box"),
|
||||
"ford_pavement": ("both", "anchor", "name", "ford_pavement", "chute"),
|
||||
"ford_bridge": ("both", "anchor", "name", "ford", "ford"),
|
||||
"cross_drain_exposed": ("both", "anchor", "name", "mark", "none"), # 표시만(요구 311-2 · 507-1)
|
||||
"open_ditch": ("both", "anchor", "name", "mark", "none"), # 표시만(요구 311-2 · 507-1)
|
||||
"cross_drain_exposed": ("both", "none", "name", "none", "none"),
|
||||
"open_ditch": ("both", "none", "name", "none", "none"),
|
||||
"cross_underdrain": ("both", "anchor", "name", "underdrain", "surface"),
|
||||
**{
|
||||
t: ("hidden", "none", "name", "none", "none")
|
||||
|
||||
@@ -63,7 +63,7 @@ def _cases() -> dict[str, tuple[dict, dict | None]]:
|
||||
bad["부품"] = {"형상.zz": False, "횡단도.span3": "no", "끔": False}
|
||||
cases["shape_bad"] = (bad, real)
|
||||
rule = copy.deepcopy(real)
|
||||
rule["반영"] = {"mirror": {"횡단도": "anchor"}} # 형상 없음(개거 = 표시만 · 507-1)
|
||||
rule["반영"] = {"open_ditch": {"횡단도": "anchor"}}
|
||||
cases["rule218"] = (rule, real)
|
||||
mismatch = copy.deepcopy(real)
|
||||
mismatch["반영"] = {"retaining_wall": {"형상": "pipe_set"}, "berm": {"횡단도": "anchor"}}
|
||||
@@ -126,7 +126,7 @@ def test_check_rules(ts: dict) -> None:
|
||||
"부품 「횡단도.span3」 — 참거짓",
|
||||
"부품 「끔」 — 없는 부품",
|
||||
]
|
||||
assert got["rule218"] == ["「반사경」 형상이 「없음」이면 횡단도도 「안 만듦」"]
|
||||
assert got["rule218"] == ["「개거(겉도랑)」 형상이 「없음」이면 횡단도도 「안 만듦」"]
|
||||
assert got["mismatch"] == ["「옹벽」 형상 「배관 세트」 — 구간 · 구조물에 안 맞음"]
|
||||
assert got["hide_read"] == [
|
||||
"「배관」 형상 「배관 세트」 이 쓰는 칸 「흙막이 기초」 — 숨길 수 없음"
|
||||
@@ -158,8 +158,8 @@ def test_reflect_edits(ts: dict) -> None:
|
||||
r = ts["reflect"]
|
||||
assert r["wildlife"] == [None, True] # b06 → both = enabled 참이 곧 처음 값 짝(반영 안 남음)
|
||||
assert r["wall"] == [None, False] # both → b06 = enabled 거짓
|
||||
assert r["openDitch"] is None # 처음 값(anchor · 표시만 507-1)과 같음 — 반영 안 남음
|
||||
assert r["exposed"] == [{"횡단도": "none"}, True]
|
||||
assert r["openDitch"] is None # 처음 값(none)과 같음 — 반영 안 남음
|
||||
assert r["exposed"] == [{"횡단도": "anchor"}, True]
|
||||
assert r["weepOn"] == {"형상칸": {"weep": True}} and r["weepOff"] is None
|
||||
assert r["shown"] == {"pipe_kind": False, "inlet_type": False} # 정의 옵션만
|
||||
assert r["readPipe"] == ["inlet_basin_height_m", "revet_foundation"] # 기본값 없는 읽는 칸
|
||||
@@ -233,7 +233,7 @@ def test_server_save_reflect_parts_color_enabled(copy_def: Path) -> None:
|
||||
@pytest.mark.parametrize(
|
||||
"change",
|
||||
[
|
||||
lambda d: d.update(반영={"mirror": {"횡단도": "anchor"}}), # 218
|
||||
lambda d: d.update(반영={"open_ditch": {"횡단도": "anchor"}}), # 218
|
||||
lambda d: d["표시"].setdefault("pipe", {}).update(revet_foundation=False), # 못 숨김 칸
|
||||
lambda d: next(o for o in _type(d, "pipe")["options"] if o["key"] == "pipe_kind")[
|
||||
"choices"
|
||||
|
||||
@@ -147,7 +147,6 @@ def test_plan_rules(ts: dict) -> None:
|
||||
mixed = ts["mixed"]
|
||||
assert [round(s["chainage_m"], 3) for s in mixed] == [
|
||||
95.0,
|
||||
120.0, # 노출형 횡단수로 = 표시만 측점(507-1)
|
||||
160.0,
|
||||
230.0,
|
||||
395.0,
|
||||
@@ -165,8 +164,7 @@ def test_plan_rules(ts: dict) -> None:
|
||||
assert first["blank"] == ["pipe_diameter_mm", "culvert_height_m"]
|
||||
joint = next(s for s in mixed if s["chainage_m"] == 530.0) # 옹벽 끝 = 소단 시작
|
||||
assert joint["owners"] == ["s2", "s3"] and joint["title"] == "옹벽" and joint["role"] == "end"
|
||||
exposed = next(s for s in mixed if s["chainage_m"] == 120.0) # 표시만 = 이름 · 빈칸 없음(507-1)
|
||||
assert exposed["title"] == "노출형 횡단수로" and exposed["blank"] == []
|
||||
assert all(s["title"] != "노출형 횡단수로" for s in mixed) # ★1 횡단도 none
|
||||
kinds = ts["pipe_kinds"]
|
||||
assert [s["title"] for s in kinds] == ["흄관 D800", "파형강관 D1000", "세월교"]
|
||||
assert kinds[1]["blank"] == ["pipe_diameter_mm"] and kinds[0]["blank"] == []
|
||||
|
||||
@@ -175,7 +175,7 @@ def test_0_곡선_판_도구줄_횡단판_비킴(page):
|
||||
def test_1_빈칸_칩_카드(page):
|
||||
modal = _open_modal(page)
|
||||
assert modal["station"] == "19+8" and modal["card"]
|
||||
assert modal["chips"] == ["⚠ 배관 관경 빈칸", "배수관"] # 이름 칩(507-1)
|
||||
assert modal["chips"] == ["⚠ 배관 관경 빈칸"]
|
||||
assert modal["pipes"] == 0 and modal["width"] == 380
|
||||
assert all("ui-btn ui-btn--ghost ui-btn--sm" in name for name in modal["buttons"])
|
||||
page.locator(".b05-crossmodal").get_by_text("닫기").click()
|
||||
@@ -198,7 +198,7 @@ def test_2_횡단_판_칩_관경_넣으면_형상_확대_밝음_어두움(page):
|
||||
).first.select_option("800") # 세션 초안만 — [저장] 안 누름
|
||||
page.wait_for_timeout(5000)
|
||||
modal = _open_modal(page)
|
||||
assert modal["chips"] == ["배수관"] and modal["pipes"] > 0
|
||||
assert modal["chips"] == [] and modal["pipes"] > 0
|
||||
shot = page.locator(".b05-crossmodal")
|
||||
shot.screenshot(path=str(SHOTS / "modal_light.png"))
|
||||
page.evaluate("document.documentElement.setAttribute('data-theme', 'dark')")
|
||||
|
||||
@@ -47,7 +47,7 @@ def test_판_재료_한_벌() -> None:
|
||||
|
||||
def test_빈칸_칩은_머리_걷기_전에_꺼냄() -> None:
|
||||
card = _read("B05_Profile", "B05_Profile_UI_RouteEdit_Cross_Card.ts")
|
||||
chips = card.index('":scope > header .b06-cross-card__warning') # 이름 칩도 같이(507-1)
|
||||
chips = card.index('":scope > header .b06-cross-card__warning"')
|
||||
remove = card.index(':scope > header, :scope > footer, .b06-cross-card__zoom"')
|
||||
assert chips < remove
|
||||
assert 'box.className = "b05-cross-chips";' in card
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
"""PLAN 507-1 노출형 횡단수로 · 개거 = 횡단면 표시만(요구 311-2).
|
||||
|
||||
- 부품 상자 형상 `mark`(표시만) — 읽는 칸 · 필수 칸 없음 → 빈칸 경고 없음 · 그리는 함수 없음.
|
||||
- 처음값 = 횡단도 anchor(측점 세움) · 카드이름 name · 형상 mark · 3D none.
|
||||
- 측점 계획 = 그 자리에 측점 하나 · 이름 = 종류 이름.
|
||||
- 실제 정의(사용자 마스터 · 반영 없음) = M02 검사 오류 없음(218 규칙 = 형상 none 만 막음).
|
||||
- B05 「횡단」 판 · 임시 횡단 창 = 카드 머리를 걷기 전에 구조물 이름 칩을 꺼내 남김.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from B05_Profile.B05_Profile_Structures_Schema import StructureInstance, load_definition
|
||||
from common_util.common_util_structure_catalog import (
|
||||
catalog,
|
||||
load_parts,
|
||||
resolve_catalog,
|
||||
shape_needs,
|
||||
)
|
||||
from common_util.common_util_structure_station import plan_stations
|
||||
from M02_MasterTemplete.StructOptions.M02_SO_Check import catalog_errors
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
KINDS = {"cross_drain_exposed": "노출형 횡단수로", "open_ditch": "개거(겉도랑)"}
|
||||
|
||||
|
||||
def test_mark_part_has_no_fields() -> None:
|
||||
mark = load_parts()["parts"]["형상"]["mark"]
|
||||
assert mark["읽는 칸"] == [] and "필수 칸" not in mark
|
||||
assert "point" in mark["자리꼴"] and "structures" in mark["정본"]
|
||||
|
||||
|
||||
def test_start_values_are_mark_only() -> None:
|
||||
rows = resolve_catalog(load_definition())
|
||||
for type_id in KINDS:
|
||||
row = rows[type_id]
|
||||
got = (row["station"], row["title"], row["shape"], row["model3d"])
|
||||
assert got == ("anchor", "name", "mark", "none"), type_id
|
||||
assert shape_needs(type_id) == []
|
||||
|
||||
|
||||
def test_station_planted_with_name() -> None:
|
||||
structures = [
|
||||
StructureInstance.model_validate(
|
||||
{
|
||||
"structure_id": f"s{i}",
|
||||
"type_id": type_id,
|
||||
"placement": "point",
|
||||
"chainage_m": at,
|
||||
"options": {},
|
||||
}
|
||||
)
|
||||
for i, (type_id, at) in enumerate((("cross_drain_exposed", 120.0), ("open_ditch", 240.0)))
|
||||
]
|
||||
plan = plan_stations([], structures)
|
||||
assert [(round(s["chainage_m"], 3), s["title"], s["blank"]) for s in plan] == [
|
||||
(120.0, KINDS["cross_drain_exposed"], []),
|
||||
(240.0, KINDS["open_ditch"], []),
|
||||
]
|
||||
|
||||
|
||||
def test_real_definition_passes_m02_check() -> None:
|
||||
assert load_definition().get("반영") == {} # 사용자 마스터 값은 안 고침
|
||||
assert catalog_errors(load_definition(), None) == []
|
||||
assert all(catalog()[t]["shape"] == "mark" for t in KINDS)
|
||||
|
||||
|
||||
def test_b05_card_keeps_structure_name_chip() -> None:
|
||||
card = (ROOT / "B05_Profile" / "B05_Profile_UI_RouteEdit_Cross_Card.ts").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
keep = card.index(":scope > header .b06-cross-card__structure")
|
||||
assert keep < card.index(':scope > header, :scope > footer, .b06-cross-card__zoom"')
|
||||
@@ -1,189 +0,0 @@
|
||||
"""PLAN 507-1 화면 — 자기 포트(5179) Playwright 머리 없는 브라우저 · 서버가 떠 있을 때만 · 검증_sub4.
|
||||
|
||||
- B05 「구조물 배치」 노출형 횡단수로 7+7(147 m) 추가(세션만 · [저장] 안 함) → 측점 목록에 섬
|
||||
- 「횡단」 판 · 임시 횡단 창 = B06 카드 + 이름 칩 「노출형 횡단수로」 · 구조물 형상 0
|
||||
- B06 횡단 카드 머리 = 이름 · 형상 0 → 지움(세션) · 측점 목록에서 빠짐
|
||||
- 계정 화면 취향만 시험 앞 값으로 되돌림 · DB · storage 안 씀
|
||||
|
||||
./venv/Scripts/python.exe -m pytest resources/tester/test_507_1_exposed_mark_screen.py -q
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import urllib.request
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
BASE = "http://localhost:5179"
|
||||
PROJECT = "c725d747-50ae-46b0-87ce-4d4e56a53cf3" # 검증_sub4(OWNERS.md)
|
||||
SHOTS = ROOT / "tmp" / "shots_507_1"
|
||||
AT_M = 147 # 7+7 — 격자 · 관(19+8) 측점과 안 겹침
|
||||
NAME = "노출형 횡단수로"
|
||||
PREFS = "/api/dashboard/me/ui-prefs"
|
||||
TOUCHED = ("profile-collapsed", "profile-height", "b05-routeedit-cross-v2")
|
||||
#: 구조물 형상 그림(관 · 박스 · 세월교 · 벽 · 맹암거) — 표시만이면 0
|
||||
SHAPES = (
|
||||
".b06-chart__culvert-pipe, [class*='b06-chart__box'], [class*='b06-chart__ford'],"
|
||||
" [class*='b06-chart__wall'], [class*='underdrain']"
|
||||
)
|
||||
|
||||
|
||||
def _up() -> bool:
|
||||
try:
|
||||
urllib.request.urlopen(BASE, timeout=3)
|
||||
return True
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
pytestmark = pytest.mark.skipif(not _up(), reason="5179 서버 없음")
|
||||
|
||||
JS_ADD = r"""async ([no, dist]) => {
|
||||
const w = (ms) => new Promise((r) => setTimeout(r, ms));
|
||||
const sec = document.querySelector('.b05-structure-section');
|
||||
const fire = (el, v) => { el.value = v; el.dispatchEvent(new Event('change', { bubbles: true })); };
|
||||
const [group, type] = sec.querySelectorAll('.b05-structure__grid select');
|
||||
fire(group, 'A'); await w(300);
|
||||
fire(type, 'cross_drain_exposed'); await w(500);
|
||||
const [a, b] = sec.querySelectorAll('.b05-structure__position-row > label')[2].querySelectorAll('input');
|
||||
fire(a, String(no)); fire(b, String(dist)); await w(200);
|
||||
sec.querySelector('.is-primary').click(); await w(1500);
|
||||
}"""
|
||||
JS_ITEMS = (
|
||||
"() => [...document.querySelectorAll('.b05-route__irregular-list li')]"
|
||||
".map((l) => l.textContent.trim())"
|
||||
)
|
||||
JS_SCROLL = r"""(m) => {
|
||||
const marker = [...document.querySelectorAll('.b06-chart__station')]
|
||||
.find((e) => Math.abs(+e.getAttribute('data-chainage') - m) < 1e-6);
|
||||
const body = marker.closest('.b05-route-profile__body');
|
||||
body.scrollLeft = Math.max(0, +marker.querySelector('line').getAttribute('x1') - body.clientWidth / 2);
|
||||
}"""
|
||||
JS_POINT = r"""(m) => {
|
||||
const marker = [...document.querySelectorAll('.b06-chart__station')]
|
||||
.find((e) => Math.abs(+e.getAttribute('data-chainage') - m) < 1e-6);
|
||||
const r = marker.querySelector('.b06-chart__station-line').getBoundingClientRect();
|
||||
return { x: r.left + r.width / 2, y: r.top + r.height * 0.3 };
|
||||
}"""
|
||||
JS_CARD = r"""(scope) => {
|
||||
const root = document.querySelector(scope);
|
||||
const card = root?.querySelector('.b06-cross-card');
|
||||
return {
|
||||
card: !!card,
|
||||
chips: [...(root?.querySelectorAll('.b05-cross-chips > *') ?? [])].map((e) => e.textContent),
|
||||
shapes: card ? card.querySelectorAll(SHAPES).length : -1,
|
||||
};
|
||||
}""".replace("SHAPES", json.dumps(SHAPES))
|
||||
JS_B06 = r"""(c) => ({
|
||||
head: c.querySelector(':scope > header .b06-cross-card__structure')?.textContent ?? null,
|
||||
label: c.querySelector('.b06-cross-card__title strong')?.textContent ?? null,
|
||||
shapes: c.querySelectorAll(SHAPES).length,
|
||||
})""".replace("SHAPES", json.dumps(SHAPES))
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def page():
|
||||
sync = pytest.importorskip("playwright.sync_api")
|
||||
cred = json.loads((ROOT / "tmp" / "aislo_cred.json").read_text(encoding="utf-8"))
|
||||
with sync.sync_playwright() as play:
|
||||
chrome = play.chromium.launch(channel="msedge", headless=True)
|
||||
ctx = chrome.new_context(viewport={"width": 1600, "height": 1000})
|
||||
login = {k: cred[k] for k in ("email", "password")}
|
||||
assert ctx.request.post(f"{BASE}/api/auth/login/request", data=login, timeout=60000).ok
|
||||
prefs = ctx.request.get(f"{BASE}{PREFS}").json().get("prefs", {})
|
||||
tab = ctx.new_page()
|
||||
tab.add_init_script(f"localStorage.setItem('frd_current_project_id', '{PROJECT}')")
|
||||
tab.goto(f"{BASE}/#/b05-profile", wait_until="domcontentloaded")
|
||||
tab.wait_for_function("() => !!window.__aisloPipeline", timeout=90000)
|
||||
tab.wait_for_timeout(8000)
|
||||
SHOTS.mkdir(parents=True, exist_ok=True)
|
||||
try:
|
||||
yield tab
|
||||
finally:
|
||||
tab.wait_for_timeout(2000)
|
||||
now = ctx.request.get(f"{BASE}{PREFS}").json().get("prefs", {})
|
||||
for key in (f"aislo:pref:{name}" for name in TOUCHED):
|
||||
if key in prefs:
|
||||
now[key] = prefs[key]
|
||||
else:
|
||||
now.pop(key, None)
|
||||
assert ctx.request.put(f"{BASE}{PREFS}", data={"prefs": now}).ok
|
||||
chrome.close()
|
||||
|
||||
|
||||
def _profile(page, open_: bool) -> None:
|
||||
height = page.evaluate(
|
||||
"() => document.querySelector('.b05-route-profile')?.getBoundingClientRect().height ?? 0"
|
||||
)
|
||||
if (height > 100) != open_:
|
||||
page.get_by_text("종단", exact=True).last.click()
|
||||
page.wait_for_timeout(3000)
|
||||
|
||||
|
||||
def test_1_추가_측점_섬(page):
|
||||
before = page.evaluate(JS_ITEMS)
|
||||
assert not any(NAME in t for t in before)
|
||||
page.evaluate(JS_ADD, [AT_M // 20, AT_M % 20])
|
||||
page.wait_for_timeout(4000)
|
||||
items = page.evaluate(JS_ITEMS)
|
||||
assert f"7+7{NAME}" in items, items
|
||||
assert len(items) == len(before) + 1
|
||||
|
||||
|
||||
def test_2_횡단_판_이름_칩_형상_0(page):
|
||||
_profile(page, False)
|
||||
page.locator(".b05-route__irregular-item", has_text=NAME).first.click()
|
||||
page.wait_for_timeout(4000)
|
||||
got = page.evaluate(JS_CARD, ".b05-routeedit__cross")
|
||||
page.locator(".b05-routeedit__cross").first.screenshot(path=str(SHOTS / "panel.png"))
|
||||
assert got["card"] and NAME in got["chips"] and got["shapes"] == 0, got
|
||||
|
||||
|
||||
def test_3_임시_횡단_이름_칩_형상_0(page):
|
||||
_profile(page, True)
|
||||
page.evaluate(JS_SCROLL, AT_M)
|
||||
page.wait_for_timeout(800)
|
||||
at = page.evaluate(JS_POINT, AT_M)
|
||||
page.mouse.move(at["x"], at["y"])
|
||||
page.wait_for_timeout(300)
|
||||
page.mouse.click(at["x"], at["y"])
|
||||
page.wait_for_function(
|
||||
"() => document.querySelector('.b05-crossmodal .b06-cross-card')", timeout=30000
|
||||
)
|
||||
page.wait_for_timeout(1500)
|
||||
station = page.evaluate("() => document.querySelector('.b05-crossmodal__station').textContent")
|
||||
got = page.evaluate(JS_CARD, ".b05-crossmodal")
|
||||
page.locator(".b05-crossmodal").screenshot(path=str(SHOTS / "modal.png"))
|
||||
page.locator(".b05-crossmodal").get_by_text("닫기").click()
|
||||
assert station == "7+7" and NAME in got["chips"] and got["shapes"] == 0, (station, got)
|
||||
|
||||
|
||||
def test_4_B06_카드_머리_이름_형상_0_지움(page):
|
||||
page.evaluate("() => { location.hash = '#/b06-section'; }")
|
||||
page.wait_for_timeout(9000)
|
||||
page.locator(".b05-route__irregular-item:visible", has_text=NAME).first.click()
|
||||
page.wait_for_timeout(3000)
|
||||
card = page.locator(".b06-cross-card:visible", has_text=NAME).first
|
||||
card.scroll_into_view_if_needed()
|
||||
page.wait_for_timeout(1500)
|
||||
got = card.evaluate(JS_B06)
|
||||
card.screenshot(path=str(SHOTS / "b06_card.png"))
|
||||
assert got == {"head": NAME, "label": "7+7", "shapes": 0}, got
|
||||
# 되돌림 — 고른 채로 세션에서 지움([저장] 안 함)
|
||||
section = page.locator(".b05-structure-section:visible").first
|
||||
if not section.locator("button.is-danger", has_text="삭제").first.is_visible():
|
||||
page.get_by_text("구조물 배치", exact=True).first.click() # B06 = 칸이 접혀 있음
|
||||
page.wait_for_timeout(1500)
|
||||
# 「구조물 전체 삭제」 와 헷갈리지 않게 글이 꼭 「삭제」 인 것만
|
||||
remove = section.get_by_role("button", name="삭제", exact=True)
|
||||
if remove.is_disabled(): # 칸을 펴면 고름이 풀림 — 다시 고름
|
||||
page.locator(".b05-route__irregular-item:visible", has_text=NAME).first.click()
|
||||
page.wait_for_timeout(1500)
|
||||
remove.click()
|
||||
page.wait_for_timeout(3000)
|
||||
left = page.evaluate(JS_ITEMS)
|
||||
page.screenshot(path=str(SHOTS / "b06_after_delete.png"))
|
||||
assert not any(NAME in t for t in left), left
|
||||
Reference in New Issue
Block a user