def __init__(self, driver):
        self.inner_locator = None
        self.outside_locator = None
        self.back_locator = None
        self.complete_btn_locator = None

        BasePage.__init__(self, driver, __file__)
        self.driver = driver
        if self.is_run_ios():
            self.xml_file = __file__[:__file__.rfind(".")] + "IOS.xml"
        else:
            self.xml_file = __file__[:__file__.rfind(".")] + "Android.xml"

        try:
            self.initial_element()
        except Exception:
            screenshot_file = GlobalVar.get_case_name() + "_" + str(
                time.time()) + "_screenshot.png"
            self.driver.save_screenshot(GlobalVar.get_screenshot_path() +
                                        screenshot_file)
            print("错误截图:")
            print('<img src="' + GlobalVar.get_screenshot_path() +
                  screenshot_file + '" width="800px" />')
            run_info_log(u'XML解析失败.', GlobalVar.get_log_file())
            raise
예제 #2
0
    def __init__(self, driver):
        BasePage.__init__(self, driver, __file__)
        self.driver = driver
        self.supplier_locator = None
        self.needs_locator = None
        self.needs_unit_locator = None
        self.invoice_number_locator = None
        self.destination_locator = None
        self.ship_date_locator = None
        self.upload_file_locator = None
        self.confirm_locator = None
        self.upDelivery_order_locator = None
        self.completeBtn_locator = None
        self.confirm_time_locator = None

        if self.is_run_ios():
            self.xml_file = __file__[:__file__.rfind(".")] + "IOS.xml"
        else:
            self.xml_file = __file__[:__file__.rfind(".")] + "Android.xml"

        try:
            self.initial_element()
        except Exception:
            screenshot_file = GlobalVarClass.get_case_name() + "_" + str(
                time.time()) + "_screenshot.png"
            self.driver.save_screenshot(GlobalVarClass.get_screenshot_path() +
                                        screenshot_file)
            print("错误截图:")
            print('<img src="' + GlobalVarClass.get_screenshot_path() +
                  screenshot_file + '" width="800px" />')
            run_info_log(u'XML解析失败.', GlobalVarClass.get_log_file())
            raise
 def initial_element(self):
     try:
         self.is_loaded()
         self.page_factory()
     except Exception:
         print(u'控件不在当前页面上.')
         screenshot_file = GlobalVar.get_case_name() + "_" + str(
             time.time()) + "_screenshot.png"
         self.driver.save_screenshot(GlobalVar.get_screenshot_path() +
                                     screenshot_file)
         print("错误截图:")
         print('<img src="' + GlobalVar.get_screenshot_path() +
               screenshot_file + '" width="800px" />')
         run_info_log(u'控件不在当前页面上.', GlobalVar.get_log_file())
         raise
     pass
예제 #4
0
    def __init__(self, driver):
        BasePage.__init__(self, driver, __file__)
        self.driver = driver
        self.choose_friends_locator = None
        self.name_locator = None
        self.card_id_locator = None
        self.photo_locator = None
        self.nest_step_locator = None
        self.photo_okay_locator = None
        self.photo_done_locator = None
        self.photo_id_front_locator = None
        self.photo_id_back_locator = None
        self.id_photo_next_locator = None
        self.verify_num_locator = None
        self.verify_identify_code_locator = None
        self.verify_get_identify_code_locator = None
        self.verify_set_pwd_locator = None
        self.verify_confirm_pwd_locator = None
        self.verify_next_step_locator = None
        self.wechat_login_locator = None
        self.refresh_locator = None
        self.task_central_locator = None

        if self.is_run_ios():
            self.xml_file = __file__[:__file__.rfind(".")] + "IOS.xml"
        else:
            self.xml_file = __file__[:__file__.rfind(".")] + "Android.xml"

        try:
            self.initial_element()
        except Exception:
            screenshot_file = GlobalVarClass.get_case_name() + "_" + str(
                time.time()) + "_screenshot.png"
            self.driver.save_screenshot(GlobalVarClass.get_screenshot_path() +
                                        screenshot_file)
            print("错误截图:")
            print('<img src="' + GlobalVarClass.get_screenshot_path() +
                  screenshot_file + '" width="800px" />')
            run_info_log(u'XML解析失败.', GlobalVarClass.get_log_file())
            raise