Ejemplo n.º 1
0
 def send_location(self):
     # 发送位置
     base = Base(self.driver)
     ele = base.isElementExist(
         [By.ID, "com.cnmts.smart_message:id/rc_ext_plugin_icon"])
     if ele:
         pass
     else:
         base.click([By.ID, "com.cnmts.smart_message:id/rc_plugin_toggle"])
     base.findElements(
         [By.ID,
          "com.cnmts.smart_message:id/rc_ext_plugin_icon"])[2].click()
     base.click([By.ID, "com.cnmts.smart_message:id/btn_location_send"])
Ejemplo n.º 2
0
 def send_document(self):
     # 发送文件
     base = Base(self.driver)
     ele = base.isElementExist(
         [By.ID, "com.cnmts.smart_message:id/rc_ext_plugin_icon"])
     if ele:
         pass
     else:
         base.click([By.ID, "com.cnmts.smart_message:id/rc_plugin_toggle"])
     base.findElements(
         [By.ID,
          "com.cnmts.smart_message:id/rc_ext_plugin_icon"])[3].click()
     base.click([By.ID, "com.cnmts.smart_message:id/radio_select"])
     base.click([By.ID, "com.cnmts.smart_message:id/layout_send"])
Ejemplo n.º 3
0
 def create_group1(self):
     base = Base(self.driver)
     base.click([By.ID, "com.cnmts.smart_message:id/img_show_more"])
     self.driver.find_element_by_android_uiautomator(
         'new UiSelector().text("发起群聊")').click()
     base.click([By.ID, "com.cnmts.smart_message:id/tv_title"])
     base.findElements([By.ID, "com.cnmts.smart_message:id/tv_full_name"
                        ])[1].click()
     sleep(1)
     self.driver.find_element_by_android_uiautomator(
         'new UiSelector().text("智能平台研发部")').click()
     base.findElements([By.ID, "com.cnmts.smart_message:id/radio_select"
                        ])[3].click()
     base.click([By.ID, "com.cnmts.smart_message:id/btn_ok"])
Ejemplo n.º 4
0
 def send_picture(self):
     # 发送图片
     base = Base(self.driver)
     # 需要加+的判断
     ele = base.isElementExist(
         [By.ID, "com.cnmts.smart_message:id/rc_ext_plugin_icon"])
     if ele:
         pass
     else:
         base.click([By.ID, "com.cnmts.smart_message:id/rc_plugin_toggle"])
     base.findElements(
         [By.ID,
          "com.cnmts.smart_message:id/rc_ext_plugin_icon"])[0].click()
     base.click([By.ID, "com.cnmts.smart_message:id/tv_select"])
     base.click([By.ID, "com.cnmts.smart_message:id/tv_confirm"])
Ejemplo n.º 5
0
 def group_setting_group1(self):
     base = Base(self.driver)
     # 点击群设置
     base.click([By.ID, "com.cnmts.smart_message:id/btn_right"])
     # 群减人
     number = base.findElement(
         [By.ID, "com.cnmts.smart_message:id/tv_group_member_size"]).text
     a = re.findall(r"\d+\.?\d*", number)
     b = int(a[0])
     if b < 4:
         c = b + 2
         base.findElements([By.ID, "com.cnmts.smart_message:id/iv_avatar"
                            ])[c].click()
     else:
         base.findElements([By.ID, "com.cnmts.smart_message:id/iv_avatar"
                            ])[6].click()
     self.driver.find_element_by_android_uiautomator(
         'new UiSelector().text("任少龙")').click()
     base.click([By.ID, "com.cnmts.smart_message:id/btn_sure"])
     sleep(2)
Ejemplo n.º 6
0
 def group_setting_group2(self):
     base = Base(self.driver)
     # 点击群设置
     base.click([By.ID, "com.cnmts.smart_message:id/btn_right"])
     number = base.findElement(
         [By.ID, "com.cnmts.smart_message:id/tv_group_member_size"]).text
     a = re.findall(r"\d+\.?\d*", number)
     b = int(a[0])
     # 群加人
     if b < 3:
         d = b + 1
         base.findElements([By.ID, "com.cnmts.smart_message:id/iv_avatar"
                            ])[d].click()
     else:
         sleep(2)
         base.findElements([By.ID, "com.cnmts.smart_message:id/iv_avatar"
                            ])[5].click()
     base.click([By.ID, "com.cnmts.smart_message:id/query"])
     base.sendKeys([By.ID, "com.cnmts.smart_message:id/query"], "王德晨")
     base.click([By.ID, "com.cnmts.smart_message:id/radio_select"])
     base.click([By.ID, "com.cnmts.smart_message:id/btn_ok"])
Ejemplo n.º 7
0
 def take_photo(self):
     # 拍摄图片
     base = Base(self.driver)
     ele = base.isElementExist(
         [By.ID, "com.cnmts.smart_message:id/rc_ext_plugin_icon"])
     if ele:
         pass
     else:
         base.click([By.ID, "com.cnmts.smart_message:id/rc_plugin_toggle"])
     base.findElements(
         [By.ID,
          "com.cnmts.smart_message:id/rc_ext_plugin_icon"])[1].click()
     sleep(2)
     base.findElements([By.CLASS_NAME, "android.view.View"])[1].click()
     sleep(2)
     base.findElements([By.CLASS_NAME, "android.view.View"])[1].click()
Ejemplo n.º 8
0
 def longpress(self):
     base = Base(self.driver)
     el = base.findElements(
         [By.ID, "com.cnmts.smart_message:id/text_message"])[0]
     TouchAction(self.driver).long_press(el, 1000).perform()