def test_chargeId_testmode(self): ch_id = GetCharge.GetCharge_Refunded(1) self.home_page.search_charge(ch_id) self.home_page.search_charge_button() order_page = OrderPage(self.driver) detail_actual_amount, detail_refunded, detail_refund_history = order_page.detail_paid_refunded() order_page.close_detail() detail_actual_amount = detail_actual_amount[1:] detail_refund_amount = detail_refunded[1:] assert float(detail_actual_amount) >= 0 assert float(detail_refund_amount) > 0 while detail_refund_history.find(u'加载中') >= 0: helper.wait_seconds(1) assert detail_refund_history[1:] <= detail_refund_amount
class Search(BaseTest): @classmethod def setUpClass(cls): BaseTest.initEnvironment(cls) # log in BaseTest.login(cls) # wait for home page loaded cls.home_page = HomePage(cls.driver) cls.home_page.check_if_loaded() @classmethod def tearDownClass(cls): BaseTest.clearUp(cls) # got charge which is paid and refunded, and search by chargeid in global search # in live mode def test_chargeId_livemode(self): ch_id = GetCharge.GetCharge_Refunded(0) self.home_page.search_charge(ch_id) self.home_page.search_charge_button() self.order_page = OrderPage(self.driver) detail_actual_amount, detail_refunded, detail_refund_history = self.order_page.detail_paid_refunded() self.order_page.close_detail() detail_actual_amount = detail_actual_amount[1:] detail_refund_amount = detail_refunded[1:] assert float(detail_actual_amount) >= 0 assert float(detail_refund_amount) >= 0 while detail_refund_history.find(u'加载中') >= 0: helper.wait_seconds(1) assert detail_refund_history[1:] > 0 # got charge which is paid and refunded, and search by order number in global search # in live mode def test_charge_order_livemode(self): order_id = GetCharge.GetOrder_Refunded(0) self.home_page.search_charge(order_id) self.home_page.search_charge_button() order_page = OrderPage(self.driver) detail_actual_amount, detail_refunded, detail_refund_history = order_page.detail_paid_refunded() order_page.close_detail() detail_actual_amount = detail_actual_amount[1:] detail_refund_amount = detail_refunded[1:] assert float(detail_actual_amount) >= 0 assert float(detail_refund_amount) >= 0 while detail_refund_history.find(u'加载中') >= 0: helper.wait_seconds(1) assert detail_refund_history[1:] > 0 # got charge which is paid and refunded from DB, and search by chargeid in # test mode def test_chargeId_testmode(self): ch_id = GetCharge.GetCharge_Refunded(1) self.home_page.search_charge(ch_id) self.home_page.search_charge_button() order_page = OrderPage(self.driver) detail_actual_amount, detail_refunded, detail_refund_history = order_page.detail_paid_refunded() order_page.close_detail() detail_actual_amount = detail_actual_amount[1:] detail_refund_amount = detail_refunded[1:] assert float(detail_actual_amount) >= 0 assert float(detail_refund_amount) > 0 while detail_refund_history.find(u'加载中') >= 0: helper.wait_seconds(1) assert detail_refund_history[1:] <= detail_refund_amount # got charge which is paid and refunded, and search by order number in # test mode def test_charge_order_testmode(self): ch_id = GetCharge.GetOrder_Refunded(1) print "test_charge_order_testmode"+ch_id self.home_page.search_charge(ch_id) self.home_page.search_charge_button() order_page = OrderPage(self.driver) detail_actual_amount, detail_refunded, detail_refund_history = order_page.detail_paid_refunded() order_page.close_detail() detail_actual_amount = detail_actual_amount[1:] detail_refund_amount = detail_refunded[1:] assert float(detail_actual_amount) >= 0 assert float(detail_refund_amount) > 0 while detail_refund_history.find(u'加载中') >= 0: helper.wait_seconds(1) assert detail_refund_history[1:] <= detail_refund_amount # got transfer which is sent from DB, and search it in global in live mode def test_transfer_livemode(self): tr_id = GetCharge.GetTransfer_received(0) self.home_page.search_charge(tr_id) self.home_page.search_charge_button() order_page = OrderPage(self.driver) tr_id_detail = order_page.detail_transfer() order_page.close_detail() print tr_id_detail print tr_id assert tr_id == tr_id_detail # got transfer which is sent from DB, and search it in global in test mode def test_transfer_testmode(self): tr_id = GetCharge.GetTransfer_received(1) self.home_page.search_charge(tr_id) self.home_page.search_charge_button() order_page = OrderPage(self.driver) tr_id_detail = order_page.detail_transfer() order_page.close_detail() print tr_id_detail print tr_id assert tr_id == tr_id_detail # got red envelope which is received from DB, and search it in global in # live mode def test_envelope_livemode(self): red_id = GetCharge.GetRedEnvelope_sent(0) self.home_page.search_charge(red_id) self.home_page.search_charge_button() order_page = OrderPage(self.driver) red_id_detail = order_page.detail_red_envelope() order_page.close_detail() assert red_id == red_id_detail # got red envelope which is received from DB, and search it in global in # test mode def test_envelope_testmode(self): red_id = GetCharge.GetRedEnvelope_sent(1) self.home_page.search_charge(red_id) self.home_page.search_charge_button() order_page = OrderPage(self.driver) red_id_detail = order_page.detail_red_envelope() order_page.close_detail() print red_id print red_id_detail assert red_id == red_id_detail