1. from elementlocator import main_ele, welcome, theme
    2. from common.base import BasePage
    3. class MainPage(basePage):
    4. def welcom_agree(self):
    5. self.click_ele(*welcome.argee)
    6. def welcon_diagree(self):
    7. self.click_ele(*welcome.digree)
    8. def theme_skip(self):
    9. self.click_ele(*theme.skip)
    10. def theme_top(self):
    11. self.click_ele(*theme.rb_search_top)
    12. def theme_bottom(self):
    13. self.click_ele(*theme.rb_search_bottom)
    14. def tehme_enter_amap(self):
    15. self.click_ele(*theme.enter_amap)
    16. # 直接进入主图
    17. def in_main(self):
    18. self.welcom_agree()
    19. self.theme_top()
    20. self.tehme_enter_amap()
    21. # news=(MobileBy.ANDROID_UIAUTOMATOR,'text("消息")')
    22. def main_news(self):
    23. self.click_ele(*main_ele.news)
    24. # layer=(MobileBy.ANDROID_UIAUTOMATOR,'text("图层")')
    25. def main_layer(self):
    26. self.click_ele(*main_ele.layer)
    27. # feedback=(MobileBy.ANDROID_UIAUTOMATOR,'text("反馈")')
    28. def main_feedback(self):
    29. self.click_ele(*main_ele.feedback)
    30. # myposition=(MobileBy.ANDROID_UIAUTOMATOR,'text("我的位置")')
    31. def main_myposition(self):
    32. self.click_ele(*main_ele.myposition)
    33. # check_the_route=(MobileBy.ANDROID_UIAUTOMATOR,'text("查路线")')
    34. def main_check_the_route(self):
    35. self.click_ele(*main_ele.check_the_route)
    36. # #输入框一栏
    37. # search_find = (MobileBy.ID,'com.autonavi.minimap:id/txt_hotword')
    38. def search_find(self, text):
    39. self.click_ele(*main_ele.search_find_ele)
    40. self.clear_info(*main_ele.search_find_ele)
    41. self.sendkey_ele(*main_ele.search_find_ele, text)
    42. # scan_code = (MobileBy.ANDROID_UIAUTOMATOR,'text("扫一扫")')
    43. def scan_code(self):
    44. self.click_ele(*main_ele.check_the_route)
    45. # voice = (MobileBy.XPATH,'//android.widget.FrameLayout[@content-desc="语音输入按钮"]/android.widget.ImageView')
    46. def voice(self):
    47. self.click_ele(*main_ele.voice)
    48. # #快捷搜一栏
    49. # by_car = (MobileBy.ANDROID_UIAUTOMATOR,'text("驾车")')
    50. def by_car(self):
    51. self.click_ele(*main_ele.by_car)
    52. # bus_subway = (MobileBy.ANDROID_UIAUTOMATOR,'text("公交地铁")')
    53. def bus_subway(self):
    54. self.click_ele(*main_ele.bus_subway)
    55. # taxi = (MobileBy.ANDROID_UIAUTOMATOR,'text("打车")')
    56. def taxi(self):
    57. self.click_ele(*main_ele.taxi)
    58. # real_time_bus = (MobileBy.ANDROID_UIAUTOMATOR,'text("实时公交")')
    59. def real_time_bus(self):
    60. self.click_ele(*main_ele.real_time_bus)
    61. # book_the_hotel = (MobileBy.ANDROID_UIAUTOMATOR,'text("订酒店")')
    62. def book_the_hotel(self):
    63. self.click_ele(*main_ele.book_the_hotel)
    64. # arround_travel = (MobileBy.ANDROID_UIAUTOMATOR,'text("周边游")')
    65. def arround_travel(self):
    66. self.click_ele(*main_ele.arround_travel)
    67. # NAT = (MobileBy.ANDROID_UIAUTOMATOR,'text("核酸检测")')
    68. def NAT(self):
    69. self.click_ele(*main_ele.NAT)
    70. # the_outbreak_map = (MobileBy.ANDROID_UIAUTOMATOR,'text("疫情地图")')
    71. def the_outbreak_map(self):
    72. self.click_ele(*main_ele.by_car)
    73. # preferential_refueling = (MobileBy.ANDROID_UIAUTOMATOR,'text("优惠加油")')
    74. def preferential_refueling(self):
    75. self.click_ele(*main_ele.preferential_refueling)
    76. # footprint = (MobileBy.ANDROID_UIAUTOMATOR,'text("足迹")')
    77. def footprint(self):
    78. self.click_ele(*main_ele.footprint)
    79. # 功能菜单栏
    80. # home_page = (MobileBy.CLASS_NAME, 'android.widget.ImageView')
    81. # nearly = (MobileBy.CLASS_NAME, 'android.widget.ImageView')
    82. # infomation = (MobileBy.CLASS_NAME, 'android.widget.ImageView')
    83. # by_car_special = (MobileBy.CLASS_NAME, 'android.widget.ImageView')
    84. # login = (MobileBy.CLASS_NAME, 'android.widget.ImageView')