chore: [workflow] 提交工作区改动
This commit is contained in:
@@ -32,6 +32,45 @@ def test_buyin_source_uses_doudian_market_and_cookie_scope():
|
||||
assert xingtu.BUSINESS_COOKIE_DOMAINS == ("jinritemai.com",)
|
||||
|
||||
|
||||
def test_buyin_search_stays_on_market_route_instead_of_clicking_global_nav():
|
||||
xingtu.configure_source("buyin")
|
||||
events = []
|
||||
|
||||
class Locator:
|
||||
def __init__(self, count):
|
||||
self._count = count
|
||||
self.first = self
|
||||
|
||||
def count(self):
|
||||
return self._count
|
||||
|
||||
def wait_for(self, **kwargs):
|
||||
events.append(("wait", kwargs))
|
||||
|
||||
class Page:
|
||||
url = "https://www.douyinec.com/"
|
||||
|
||||
def locator(self, selector):
|
||||
events.append(("locator", selector))
|
||||
return Locator(0)
|
||||
|
||||
def goto(self, url, **kwargs):
|
||||
events.append(("goto", url, kwargs))
|
||||
|
||||
def get_by_text(self, *_args, **_kwargs):
|
||||
raise AssertionError("Buyin must not click the global 找达人 navigation")
|
||||
|
||||
xingtu.select_nickname_search(Page())
|
||||
|
||||
assert events[0] == (
|
||||
"locator",
|
||||
f"{xingtu.BUYIN_SEARCH_INPUT_SELECTOR}:visible",
|
||||
)
|
||||
assert events[1][0] == "goto"
|
||||
assert events[1][1] == xingtu.MARKET_URL
|
||||
assert events[2][0] == "wait"
|
||||
|
||||
|
||||
def test_save_state_creates_cookie_parent_directory(tmp_path, monkeypatch):
|
||||
cookie_file = tmp_path / "nested" / "cookies.json"
|
||||
monkeypatch.setattr(xingtu, "DATA_DIR", tmp_path / "raw")
|
||||
|
||||
Reference in New Issue
Block a user