Ejemplo n.º 1
0
 def emoji_style_download(self):
     top_y = self.BF.keyboard_get_ready(
         'com.emoji.ikeyboard/com.android.inputmethod.latin.LatinIME',
         'class', 'android.widget.ScrollView')
     keyboard = Keyboard_Operation(self.d, top_y)
     keyboard.send_input('emoji')
     old_emoji = keyboard.get_keyboard_picture(
         0, top_y + 40 * keyboard.density()['density'],
         keyboard.phone_width,
         keyboard.density()['app'] - top_y -
         80 * keyboard.density()['density'], 'old_emoji')
     self.Ik.random_download_emoji_style()
     self.d.start_activity('yuside.cn.numbersonly',
                           'yuside.cn.numbersonly.MainActivity')
     # 键盘输入检查
     top_y = self.BF.keyboard_get_ready(
         'com.emoji.ikeyboard/com.android.inputmethod.latin.LatinIME',
         'class', 'android.widget.ScrollView')
     keyboard = Keyboard_Operation(self.d, top_y)
     keyboard.send_input('emoji')
     now_emoji = keyboard.keyboard_same(
         0, top_y + 40 * keyboard.density()['density'],
         keyboard.phone_width,
         keyboard.density()['app'] - top_y -
         80 * keyboard.density()['density'], old_emoji)
     self.BF.check_assertFalse(now_emoji, 'emoji风格更换失败')
     self.Ik.clear_download_emoji_style()
Ejemplo n.º 2
0
 def chang_theme(self):
     top_y = self.BF.keyboard_get_ready(
         'com.emoji.ikeyboard/com.android.inputmethod.latin.LatinIME',
         'class', 'android.widget.ScrollView')
     keyboard = Keyboard_Operation(self.d, top_y)
     height = (keyboard.phone_height - top_y)
     width = keyboard.phone_width
     load = keyboard.get_keyboard_picture(
         0, top_y, width, height - 40 * int(keyboard.density()['density']),
         'keyboard')
     keyboard.send_input('system')
     keyboard.main_menu_click('theme')
     keyboard.select_theme(1, 2)
     # 判断是否回到了键盘主页
     text = keyboard.word_in_pic(
         0, top_y + int(keyboard.density()['density']) * 40,
         keyboard.phone_width,
         (int(keyboard.density()['app']) - top_y -
          int(keyboard.density()['density']) * 40) / 4, 'q')
     self.BF.check_assertTrue(text, '返回qwerty键盘失败,可能没有选择主题')
     time.sleep(5)
     same = keyboard.keyboard_same(
         0, top_y, width, height - 40 * int(keyboard.density()['density']),
         load)
     self.BF.check_assertFalse(same, '主题风格更换失败')
     self.BF.result_picture('emoji_style')
Ejemplo n.º 3
0
 def theme(self):
     top_y = self.BF.keyboard_get_ready('com.qisiemoji.inputmethod/com.android.inputmethod.latin.LatinIME', 'class',
                                        'android.widget.ScrollView')
     keyboard = Keyboard_Operation(self.d, top_y)
     k = keyboard.get_keyboard_picture(0, top_y, keyboard.phone_width, (keyboard.density()['app'] - top_y),
                                       'keyboard')
     keyboard.send_input('system')
     keyboard.main_menu_click('theme')
     keyboard.select_theme(2, 1)
     pic_text = keyboard.get_keyboard_picture(0, top_y, keyboard.phone_width, (keyboard.density()['app'] - top_y),
                                              'keyboard_back')
     pic_text = keyboard.pic_text(pic_text)
     if 'q' in pic_text:
         pass
     else:
         assert 1 + 1 > 2, '没有回到键盘'
     k_s = keyboard.keyboard_same(0, top_y, keyboard.phone_width, (keyboard.density()['app'] - top_y), k)
     self.BF.check_assertFalse(k_s, '主题更换失败')
     # 回选到默认主题
     keyboard.send_input('system')
     keyboard.main_menu_click('theme')
     keyboard.select_theme(1, 2)
     pic_text = keyboard.get_keyboard_picture(0, top_y, keyboard.phone_width, (keyboard.density()['app'] - top_y),
                                              'keyboard_back')
     pic_text = keyboard.pic_text(pic_text)
     if 'q' in pic_text:
         pass
     else:
         assert 1 + 1 > 2, '没有回到键盘'
     k_s = keyboard.keyboard_same(0, top_y, keyboard.phone_width, (keyboard.density()['app'] - top_y), k)
     self.BF.check_assertTrue(k_s, '主题更换失败')
Ejemplo n.º 4
0
 def por_input(self):
     top_y = self.M.select_user(
         'com.emoji.ikeyboard/com.android.inputmethod.latin.LatinIME')
     keyboard = Keyboard_Operation(self.d, top_y)
     # 切换输入法至葡萄牙语
     while True:
         location = keyboard.keyboard_reader(' ')
         orc = keyboard.orc_location(location['x'], location['y'],
                                     location['width'], location['height'])
         print(orc)
         if 'Po' in orc:
             break
         else:
             keyboard.swip_location(location['x'], location['y'],
                                    location['width'], location['height'])
     keyboard.send_input('portug')
     orc_select = keyboard.orc_location(0,
                                        top_y,
                                        keyboard.phone_width,
                                        40 * keyboard.density()['density'],
                                        set_lang='por')
     print(orc_select)
     if 'Português' in orc_select:
         orc_result = True
     else:
         orc_result = False
     self.BF.check_assertTrue(orc_result, '没有纠正')
Ejemplo n.º 5
0
 def es_input(self):
     top_y = self.M.select_user(
         'com.qisiemoji.inputmethod/com.android.inputmethod.latin.LatinIME')
     keyboard = Keyboard_Operation(self.d, top_y)
     # 切换输入法至西班牙语
     while True:
         location = keyboard.keyboard_reader(' ')
         orc = keyboard.orc_location_text(location['x'], location['y'],
                                          location['width'],
                                          location['height'])
         print(orc)
         if 'Es' in orc:
             break
         else:
             keyboard.swip_location(location['x'], location['y'],
                                    location['width'], location['height'])
     keyboard.send_input('espa')
     orc_select = keyboard.orc_location_text(0,
                                             top_y,
                                             keyboard.phone_width,
                                             40 *
                                             keyboard.density()['density'],
                                             set_lang='epo')
     # print(orc_select)
     if 'Espaĥol' in orc_select:
         orc_result = True
     else:
         orc_result = False
     self.BF.check_assertTrue(orc_result, '没有纠正')
Ejemplo n.º 6
0
 def test(self):
     top_y = self.BF.keyboard_get_ready('com.emoji.ikeyboard/com.android.inputmethod.latin.LatinIME', 'class',
                                        'android.widget.ScrollView')
     keyboard = Keyboard_Operation(self.d, top_y)
     keyboard.send_input('system')
     location = keyboard.main_menu_select('settings')
     # location = keyboard.main_menu_select('theme')
     keyboard.get_keyboard_picture(location['x'], location['y'], location['width'], location['height'], 'theme')
Ejemplo n.º 7
0
 def keyboard_layout(self):
     default_top_y = self.BF.keyboard_get_ready(
         'com.emoji.ikeyboard/com.android.inputmethod.latin.LatinIME',
         'class', 'android.widget.ScrollView')
     # 开启数字和select
     self.Ik.app_settings()
     self.BF.click('name', 'Keyboard Settings')
     self.BF.click_change(
         'xpath',
         '//*[@text="Number Row"]/../../android.widget.LinearLayout')
     self.BF.click_change(
         'xpath',
         '//*[@text="Selector Row"]/../../android.widget.LinearLayout')
     # 打开input
     self.d.start_activity('yuside.cn.numbersonly',
                           'yuside.cn.numbersonly.MainActivity')
     top_y = self.BF.keyboard_get_ready(
         'com.emoji.ikeyboard/com.android.inputmethod.latin.LatinIME',
         'class', 'android.widget.ScrollView')
     keyboard = Keyboard_Operation(self.d, top_y)
     keyboard.send_input('1234567890', number=True, select=True)
     number = self.BF.attribute_name(
         'xpath', '//android.widget.EditText[@index="0"]', '1234567890')
     self.BF.check_assertTrue(number, '输入错误,数字键有问题')
     self.BF.check_find_element(
         'xpath', '//android.widget.EditText[@index="0"]').clear()
     self.BF.click('xpath', '//android.widget.EditText[@index="0"]')
     keyboard.send_input('asdfghj',
                         inputtype='long_pass',
                         number=True,
                         select=True)
     symbol = self.BF.attribute_name(
         'xpath', '//android.widget.EditText[@index="0"]', '@#$%&-+')
     self.BF.check_assertTrue(symbol, '输入错误,pop_key有问题')
     # 关闭Number和Select
     self.Ik.app_settings()
     self.BF.click('name', 'Keyboard Settings')
     self.BF.click_change(
         'xpath',
         '//*[@text="Number Row"]/../../android.widget.LinearLayout')
     self.BF.click_change(
         'xpath',
         '//*[@text="Selector Row"]/../../android.widget.LinearLayout')
     # 检查键盘是否高度变化
     self.d.start_activity('yuside.cn.numbersonly',
                           'yuside.cn.numbersonly.MainActivity')
     new_top_y = self.BF.keyboard_get_ready(
         'com.emoji.ikeyboard/com.android.inputmethod.latin.LatinIME',
         'class', 'android.widget.ScrollView')
     if default_top_y == new_top_y:
         cancel_result = True
     else:
         cancel_result = False
     self.BF.check_assertTrue(cancel_result, '取消Number和Select后键盘高度变化了')
Ejemplo n.º 8
0
 def normal_number(self):
     top_y = self.BF.keyboard_get_ready(
         'com.emoji.ikeyboard/com.android.inputmethod.latin.LatinIME',
         'class', 'android.widget.ScrollView')
     keyboard = Keyboard_Operation(self.d, top_y)
     self.BF.click('name', '02-search')
     # self.BF.click('name', '01-textAutoComplete')
     time.sleep(2)
     keyboard.send_input('number')
     keyboard.send_input('1234567890', keyboard_type='normal_number')
     # keyboard.send_input('qwertyuiopasdfghjklzxcvbnm')
     self.BF.result_picture('normal_number')
Ejemplo n.º 9
0
 def eninput(self):
     top_y = self.BF.keyboard_get_ready(
         'com.emoji.ikeyboard/com.android.inputmethod.latin.LatinIME',
         'class', 'android.widget.ScrollView')
     keyboard = Keyboard_Operation(self.d, top_y)
     # 用例内容
     self.BF.click('xpath', '//*[@index="3"]')
     # self.BF.click('name', '01-textAutoComplete')
     time.sleep(2)
     keyboard.send_input('cppy')
     keyboard.send_input(' ')
     text = self.BF.attribute_name('xpath', '//*[@index="3"]', 'copy ')
     self.BF.check_assertTrue(text, 'fail')
Ejemplo n.º 10
0
 def number_password(self):
     top_y = self.BF.keyboard_get_ready(
         'com.emoji.ikeyboard/com.android.inputmethod.latin.LatinIME',
         'class', 'android.widget.ScrollView')
     keyboard = Keyboard_Operation(self.d, top_y)
     self.BF.reach_element_click(200, 'xpath', '//*[@index="24"]')
     keyboard.send_input('1234567890', keyboard_type='number_password')
     # location = keyboard.keyboard_reader('1', keyboard_type='number_password')
     # keyboard.get_keyboard_picture(location['x'], location['y'], location['width'], location['height'], '1')
     # location = keyboard.keyboard_reader('2', keyboard_type='number_password')
     # keyboard.get_keyboard_picture(location['x'], location['y'], location['width'], location['height'], '2')
     # location = keyboard.keyboard_reader('3', keyboard_type='number_password')
     # keyboard.get_keyboard_picture(location['x'], location['y'], location['width'], location['height'], '3')
     self.BF.result_picture('number_passworf')
Ejemplo n.º 11
0
 def input_io(self):
     top_y = self.BF.keyboard_get_ready(
         'com.qisiemoji.inputmethod/com.android.inputmethod.latin.LatinIME',
         'class', 'android.widget.ScrollView')
     keyboard = Keyboard_Operation(self.d, top_y)
     # default = keyboard.get_keyboard_picture(0, top_y, keyboard.phone_width, 40 * keyboard.density()['density'],
     #                                         'indian_default')
     self.BF.click('xpath', '//android.widget.EditText[@index="1"]')
     wrong = []
     with open('./hinglish_hindi_pair', 'r') as word_list:
         for line in word_list:
             i = line.split('\t')[0].lower()
             o = line.split('\t')[1].split('\n')[0]
             # i = 'kya'
             # o = 'क्या'
             print(i, o)
             keyboard.send_input(i, number=True)
             # keyboard.send_input(' ', number=True)
             self.d.tap([(keyboard.phone_width / 4,
                          top_y + 20 * keyboard.density()['density'])])
             # same = keyboard.orc_location_text(0, top_y, keyboard.phone_width, 40 * keyboard.density()['density'],
             #                                   set_lang='eng')
             same = self.BF.attribute_name(
                 'xpath', '//android.widget.EditText[@index="1"]')
             print(same)
             if o in same:
                 same = True
             else:
                 same = False
             # print(same)
             # key = self.BF.attribute_name('xpath', '//android.widget.EditText[@index="1"]')
             # if i in key:
             #     key = True
             # else:
             #     key = False
             # print(key)
             # self.BF.check_find_element('xpath', '//android.widget.EditText[@index="1"]').clear()
             count = 0
             while True:
                 keyboard.send_input('delete')
                 count += 1
                 if count > 8:
                     break
             if same is True:
                 pass
             else:
                 wrong.append(line.split('\n')[0])
             print(wrong)
     print(wrong)
Ejemplo n.º 12
0
 def emoji(self):
     top_y = self.BF.keyboard_get_ready(
         'com.emoji.ikeyboard/com.android.inputmethod.latin.LatinIME',
         'class', 'android.widget.ScrollView')
     keyboard = Keyboard_Operation(self.d, top_y)
     self.BF.click('name', '02-search')
     search = self.BF.element_picture(
         'id', 'yuside.cn.numbersonly:id/search_btn', 'search')
     keyboard.send_input('emoji')
     time.sleep(2)
     keyboard.send_input('emoji', keyboard_type='emoji')
     keyboard.select_emoji_class('emoji', 3)
     keyboard.select_emoji('emoji', 3, 5)
     emoji = self.BF.cintrast_element_picture(
         'id', 'yuside.cn.numbersonly:id/search_btn', search)
     self.BF.check_assertFalse(emoji, 'emoji未上屏')
     self.BF.result_picture('emoji')
Ejemplo n.º 13
0
 def pop_key(self):
     top_y = self.BF.keyboard_get_ready('com.qisiemoji.inputmethod/com.android.inputmethod.latin.LatinIME',
                                        'class',
                                        'android.widget.ScrollView')
     keyboard = Keyboard_Operation(self.d, top_y)
     keyboard.pop_select('a', 'á')
     a = self.BF.attribute_name('xpath', '//android.widget.EditText[@index="0"]', 'á')
     self.BF.check_assertTrue(a, 'popkey有问题')
     self.BF.check_find_element('xpath', '//android.widget.EditText[@index="0"]').clear()
     keyboard.send_input('number')
     keyboard.pop_select('.', '…', keyboard_type='normal_number')
     number = self.BF.attribute_name('xpath', '//android.widget.EditText[@index="0"]', '…')
     self.BF.check_assertTrue(number, 'popkey有问题')
     self.BF.check_find_element('xpath', '//android.widget.EditText[@index="0"]').clear()
     keyboard.send_input('symbol', keyboard_type='normal_number')
     keyboard.pop_select('=', '∞', keyboard_type='normal_symbol')
     symbol = self.BF.attribute_name('xpath', '//android.widget.EditText[@index="0"]', '∞')
     self.BF.check_assertTrue(symbol, 'popkey有问题')
Ejemplo n.º 14
0
 def nubmer_decimal(self):
     top_y = self.BF.keyboard_get_ready(
         'com.emoji.ikeyboard/com.android.inputmethod.latin.LatinIME',
         'class', 'android.widget.ScrollView')
     keyboard = Keyboard_Operation(self.d, top_y)
     self.BF.reach_element_click(200, 'name', '24-numberDecimal')
     keyboard.send_input('1234567890', keyboard_type='number_decimal')
     input = self.BF.attribute_name('xpath', '//*[@index="23"]',
                                    '1234567890')
     self.BF.check_assertTrue(input, '输入内容正确显示正确')
     # location = keyboard.keyboard_reader('1', keyboard_type='number_decimal')
     # keyboard.get_keyboard_picture(location['x'], location['y'], location['width'], location['height'], '1')
     # location = keyboard.keyboard_reader('2', keyboard_type='number_decimal')
     # keyboard.get_keyboard_picture(location['x'], location['y'], location['width'], location['height'], '2')
     # location = keyboard.keyboard_reader('3', keyboard_type='number_decimal')
     # keyboard.get_keyboard_picture(location['x'], location['y'], location['width'], location['height'], '3')
     # location = keyboard.keyboard_reader('-', keyboard_type='number_decimal')
     # keyboard.get_keyboard_picture(location['x'], location['y'], location['width'], location['height'], '-')
     # location = keyboard.keyboard_reader(' ', keyboard_type='number_decimal')
     # keyboard.get_keyboard_picture(location['x'], location['y'], location['width'], location['height'], 'space')
     self.BF.result_picture('nubmer_decimal')
Ejemplo n.º 15
0
 def emoji_style(self):
     top_y = self.BF.keyboard_get_ready(
         'com.emoji.ikeyboard/com.android.inputmethod.latin.LatinIME',
         'class', 'android.widget.ScrollView')
     keyboard = Keyboard_Operation(self.d, top_y)
     keyboard.send_input('emoji')
     keyboard.send_input('emoji', keyboard_type='emoji')
     height = (keyboard.phone_height - top_y)
     width = keyboard.phone_width
     load = keyboard.get_keyboard_picture(
         0, top_y, width, height - 40 * int(keyboard.density()['density']),
         'emojy')
     keyboard.send_input('normal_key', keyboard_type='emoji')
     keyboard.send_input('system')
     keyboard.main_menu_click('style')
     keyboard.select_theme(1, 2)
     time.sleep(5)
     keyboard.send_input('emoji')
     same = keyboard.keyboard_same(
         0, top_y, width, height - 40 * int(keyboard.density()['density']),
         load)
     self.BF.check_assertFalse(same, '表情风格更换失败')
     self.BF.result_picture('emoji_style')
Ejemplo n.º 16
0
 def theme_change(self):
     self.kika.change_theme(5)
     self.d.start_activity('yuside.cn.numbersonly', 'yuside.cn.numbersonly.MainActivity')
     # 键盘输入检查
     top_y = self.BF.keyboard_get_ready('com.qisiemoji.inputmethod/com.android.inputmethod.latin.LatinIME', 'class',
                                        'android.widget.ScrollView')
     keyboard = Keyboard_Operation(self.d, top_y)
     keyboard.send_input('qwertyuiopasdfghjklzxcvbnm')
     keyboard.send_input('shift')
     keyboard.send_input('g')
     s_input = self.BF.attribute_name('classes', 'android.widget.EditText[0]', 'qwertyuiopasdfghjklzxcvbnmG')
     self.BF.check_assertTrue(s_input, '键盘输入内容错误')
Ejemplo n.º 17
0
 def sticker2(self):
     top_y = self.W.select_user('com.emoji.ikeyboard/com.android.inputmethod.latin.LatinIME')
     keyboard = Keyboard_Operation(self.d, top_y)
     keyboard.send_input('test', 'normal')
     keyboard.send_input(' ', 'normal')
     keyboard.send_input(' ', 'normal')
     send = self.BF.attribute_name('id', 'com.whatsapp:id/entry', 'Test. ')
     self.BF.check_assertTrue(send, '输入内容错误')
     # keyboard.get_keyboard_picture(location['x'], location['y'], location['width'], location['height'], 'test')
     keyboard.send_input('stop', 'normal')
     keyboard.sticker2_click('sitcker2', 3, 2)
     # self.BF.checkpoint('sticker2', 'id', 'com.whatsapp:id/color_picker_container', 'sticker2')
     sticker2 = self.BF.existence('id', 'com.whatsapp:id/color_picker_container')
     self.BF.check_assertTrue(sticker2, 'sticker2选择失败')
     self.BF.click('id', 'com.whatsapp:id/send')
     time.sleep(5)
     self.BF.result_picture('sticker2')
Ejemplo n.º 18
0
 def input(self):
     top_y = self.BF.keyboard_get_ready(
         'com.qisiemoji.inputmethod/com.android.inputmethod.latin.LatinIME',
         'class', 'android.widget.ScrollView')
     keyboard = Keyboard_Operation(self.d, top_y)
     default = keyboard.get_keyboard_picture(
         0, top_y, keyboard.phone_width, 40 * keyboard.density()['density'],
         'indian_default')
     self.BF.click('xpath', '//android.widget.EditText[@index="1"]')
     wrong = []
     with open('./vocab_hinglish', 'r') as word_list:
         for line in word_list:
             print(line)
             print(line.split('\n')[0])
             keyboard.send_input(line.split('\n')[0].lower(), number=True)
             keyboard.send_input(' ', number=True)
             same = keyboard.keyboard_same(0,
                                           top_y,
                                           keyboard.phone_width,
                                           40 *
                                           keyboard.density()['density'],
                                           default,
                                           diff=2)
             print(same)
             key = self.BF.attribute_name(
                 'xpath', '//android.widget.EditText[@index="1"]')
             if line.split('\n')[0] in key:
                 key = True
             else:
                 key = False
             print(key)
             # self.BF.check_find_element('xpath', '//android.widget.EditText[@index="1"]').clear()
             count = 0
             while True:
                 keyboard.send_input('delete')
                 count += 1
                 if count > 8:
                     break
             if key is True and same is False:
                 pass
             else:
                 wrong.append(line.split('\n')[0])
             print(wrong)
     print(wrong)
Ejemplo n.º 19
0
 def en_input(self):
     top_y = self.M.select_user(
         'com.emoji.ikeyboard/com.android.inputmethod.latin.LatinIME')
     keyboard = Keyboard_Operation(self.d, top_y)
     keyboard.send_input('copy')
     keyboard.send_input(' ')
     copy = self.BF.attribute_name('id',
                                   'com.facebook.orca:id/text_input_bar',
                                   'Copy ')
     self.BF.check_assertTrue(copy, '上屏内容错误')
     self.BF.check_find_element(
         'id', 'com.facebook.orca:id/text_input_bar').clear()
     keyboard.sliding_input('about')
     # 这个滑动输入的检查点需要重新明确
     # about = self.BF.attribute_name('id', 'com.facebook.orca:id/text_input_bar', 'About')
     # self.BF.check_assertTrue(about, '上屏内容错误')
     self.BF.check_find_element(
         'id', 'com.facebook.orca:id/text_input_bar').clear()
     keyboard.send_input('emoji')
     Messenger_emoji = self.BF.element_picture(
         'id', 'com.facebook.orca:id/text_input_bar', 'Messenger_emoji')
     keyboard.send_input('emoji', 'emoji')
     keyboard.select_emoji('emoji', 1, 3)
     sendout = self.BF.attribute_name(
         'id', 'com.facebook.orca:id/text_input_bar', '😂')
     self.BF.check_assertTrue(sendout, '表情选择错误')
     emoji = self.BF.cintrast_element_picture(
         'id', 'com.facebook.orca:id/text_input_bar', Messenger_emoji)
     self.BF.check_assertFalse(emoji, '选择的emoji未上屏')
     # 检查点表格'Messenger_emoji'
     self.BF.checkpoint('Messenger_emoji', 'id',
                        'com.facebook.orca:id/text_input_bar',
                        'Messenger_emoji')
     self.BF.check_find_element(
         'id', 'com.facebook.orca:id/text_input_bar').clear()
     keyboard.send_input('emoji')
     keyboard.send_input('sticker', 'emoji')
     keyboard.select_emoji('sticker', 1, 2)
     time.sleep(5)
     # self.BF.click('name', '确定')
     self.BF.checkpoint('Messenger_sticker', 'id',
                        'com.facebook.orca:id/message_container',
                        'Messenger_sticker')
     keyboard.send_input('gif', 'emoji')
     time.sleep(10)
     keyboard.select_emoji('gif', 1, 2)
     time.sleep(5)
     # self.BF.click('name', '确定')
     self.BF.checkpoint('Messenger_gif', 'id',
                        'com.facebook.orca:id/message_container',
                        'Messenger_gif')
     keyboard.send_input('emoticon', 'emoji')
     keyboard.select_emoji('gif', 1, 2)
     emoticon = self.BF.attribute_name(
         'id', 'com.facebook.orca:id/text_input_bar', '(^~^)')
     self.BF.check_assertTrue(emoticon, 'emoticon选择错误')
     self.BF.checkpoint('Messenger_emoticon', 'id',
                        'com.facebook.orca:id/text_input_bar',
                        'Messenger_emoticon')
 def precast_condition(self, del_package, install_package_path, Typewriting):
     # 删除应用
     if self.device_config == 'none':
         try:
             unin_result = os.popen('adb uninstall %s' % del_package)
         except Exception as e:
             print(e)
             print('没有对应应用')
     else:
         try:
             unin_result = os.popen('adb -s %s uninstall %s' % (self.device_config, del_package))
         except Exception as e:
             print(e)
             print('没有对应应用')
     # 安装应用
     self.BF.adb_install(install_package_path, self.device_config)
     self.BF.keyboard_select(Typewriting, self.device_config)
     self.BF.open_app_atcivity('com.qisiemoji.inputmethod/com.qisi.ikeyboarduirestruct.NavigationActivity')
     theme = self.BF.existence('name', 'Settings')
     if theme == False:
         count = 0
         while True:
             try:
                 self.BF.click('name', 'Allow')
                 count += 1
             except:
                 time.sleep(3)
             if count == 3:
                 break
             if count == 6:
                 break
     self.BF.keyboard_select('com.qisiemoji.inputmethod/com.android.inputmethod.latin.LatinIME')
     # 点击设定
     self.BF.click('id', 'com.qisiemoji.inputmethod:id/item_settigns')
     # 点击语言
     self.BF.click('name', 'Language')
     # time.sleep(10)
     # 选择语言的时候最好根据自上而下的顺序这样就很快的都能加上
     # self.reach_language_add('Español (US)')
     # self.reach_language_add('Português (Brasil)')
     # self.driver.back()
     # self.BF.click('name', 'Language')
     # if self.BF.existence('name', 'Español (US)') and self.BF.existence('name',
     #                                                                    'English (US)') and self.BF.existence('name',
     #                                                                                                          'Português (Brasil)'):
     #     pass
     # else:
     #     assert 1 + 1 > 2, '语言添加失败'
     self.driver.start_activity('yuside.cn.numbersonly', 'yuside.cn.numbersonly.MainActivity')
     # 获取的高度不是默认的高度
     top_y = self.BF.keyboard_get_ready(Typewriting, 'class', 'android.widget.ScrollView')
     keyboard = Keyboard_Operation(self.driver, top_y)
     self.driver.back()
     self.BF.click('xpath', '//android.widget.EditText[@index="0"]')
     # 重新获取键盘高度
     top_y = self.BF.keyboard_get_ready(Typewriting, 'class', 'android.widget.ScrollView')
     keyboard = Keyboard_Operation(self.driver, top_y)
     keyboard.send_input('emoji')
     self.driver.back()
     self.BF.click('xpath', '//android.widget.EditText[@index="0"]')
     keyboard.send_input('emoji')
     keyboard.send_input('emoji', 'emoji')
     keyboard.select_emoji('emoji', 1, 3)
     emoji = self.BF.attribute_name('xpath', '//android.widget.EditText[@index="0"]', '😂')
     self.BF.check_assertTrue(emoji, 'emoji默认设置取消失败')