feat(schedule): 增加库存源选项描述字段与站点ID支持
This commit is contained in:
1 parent
f4e74f7b07
commit
8b1efbedb9
37 files changed
+8488
-4126
No files matched your search
@@ -112,3 +112,58 @@ def test_fill_dsv_warehouse_select_uses_default_ddvalue():
|
||||
)
|
||||
|
||||
assert selected.get("value") == "BYAWSATL01" or selected.get("label") == "BYAWSATL01"
|
||||
|
||||
|
||||
def test_fill_dsv_multi_select_parameter_supports_select_all_checkbox_dropdown():
|
||||
"""AWSAMS Warehouse 这类 checkbox 下拉应支持 select_all 和显式 selector。"""
|
||||
module = _load_module()
|
||||
payloads: list[dict[str, object]] = []
|
||||
|
||||
class _FakeLocator:
|
||||
first = None
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.first = self
|
||||
|
||||
def wait_for(self, *args, **kwargs) -> None:
|
||||
return None
|
||||
|
||||
def input_value(self, timeout: int | None = None) -> str:
|
||||
return ""
|
||||
|
||||
def click(self, timeout: int | None = None, force: bool = False) -> None:
|
||||
return None
|
||||
|
||||
class _FakeReportRootLocator:
|
||||
def count(self) -> int:
|
||||
return 1
|
||||
|
||||
class _FakeFrame:
|
||||
def locator(self, selector: str):
|
||||
if selector == "#ReportViewerMain":
|
||||
return _FakeReportRootLocator()
|
||||
return _FakeLocator()
|
||||
|
||||
def evaluate(self, script: str, payload: dict[str, object]) -> bool:
|
||||
payloads.append(payload)
|
||||
return True
|
||||
|
||||
class _FakePage:
|
||||
frames = [_FakeFrame()]
|
||||
|
||||
ok = module.fill_dsv_multi_select_parameter(
|
||||
_FakePage(),
|
||||
"Warehouse",
|
||||
["RTM"],
|
||||
selectors={
|
||||
"text": "#ReportViewerMain_ctl08_ctl17_txtValue",
|
||||
"toggle": "#ReportViewerMain_ctl08_ctl17_ctl01",
|
||||
"dropdown": "#ReportViewerMain_ctl08_ctl17_divDropDown",
|
||||
},
|
||||
select_all=True,
|
||||
browser_timeout_ms=lambda: 3_000,
|
||||
)
|
||||
|
||||
assert ok is True
|
||||
assert payloads[-1]["dropdownSelector"] == "#ReportViewerMain_ctl08_ctl17_divDropDown"
|
||||
assert payloads[-1]["selectAll"] is True
|
||||
Reference in new issue
Block a user