class TestTrade: def setup(self): self.xueqiu = XueqiuPage() # self.trade = self.xueqiu.goto_trade() # self.trade.goto_hs() def teardown(self): self.xueqiu.quit() def test_a_open(self): # self.trade.a_open("18911773181", "1234") self.xueqiu.goto_trade().goto_hs()
class TestSearch: def setup(self): self.xueqiu = XueqiuPage() def teardown(self): self.xueqiu.quit() def test_search_us(self): assert self.xueqiu.goto_search()\ .search("alibaba")\ .select(0)\ .get_price("BABA") > 170 def test_search_us_other(self): assert "阿里" in self.xueqiu.goto_search()\ .search("alibaba")\ .select(-1)\ .get_name()