def test_A30(self):
     u"""测试豪华礼盒的提示弹窗显示的文案是否与配置一致"""
     CostList = GetMeta("shop.xml", "costs")
     luxuryBox_metacash = int(CostList[2].replace("3000#", ""))
     if not TsumDrop_dic and not FixedRewards_dic:
         chestlevel(TsumDrop_dic, FixedRewards_dic)
     luxuryBox_meta_coin = int(
         FixedRewards_dic["2003"][userlevel].split("#")[1])
     itemsOld = poco("UI Root").child("HeaderPart").offspring("label_count")
     cashold = int(itemsOld[0].get_text())
     if cashold >= luxuryBox_metacash:
         luxbox_adequate_info = poco("label_info").get_text()
         infotext = TextDic['shop_confirm_special']
         cashtext = TextDic['shop_type_title_3']
         cointext = TextDic['shop_type_title_2']
         boxtext = TextDic['shop_box_3']
         mergtext = 'Lv.%s' % userlevel
         alltext = infotext % (luxuryBox_metacash, cashtext,
                               luxuryBox_meta_coin, cointext,
                               mergtext + boxtext)
         self.assertEqual(luxbox_adequate_info, alltext, caseList[37])
     else:
         luxbox_less_info = poco("label_info").get_text()
         cashtext = TextDic['shop_type_title_3']
         infotext = TextDic['shop_supplement']
         self.assertEqual(luxbox_less_info, infotext % cashtext,
                          caseList[38])
 def test_A27(self):
     u"""测试购买豪华礼盒的钻石数是否与meta一致"""
     global luxuryBox_Tsumdrop, luxuryBox_maxtsum
     if not TsumDrop_dic and not FixedRewards_dic:
         chestlevel(TsumDrop_dic, FixedRewards_dic)
     luxuryBox_meta_coin = int(
         FixedRewards_dic["2003"][userlevel].split("#")[1])
     luxury_dataList = poco("UI Root").child("ShopPanel").offspring(
         "label_count")
     luxury_coin = int(luxury_dataList[0].get_text())
     self.assertEqual(luxury_coin, luxuryBox_meta_coin, caseList[34])
 def test_A16(self):
     u"""测试购买高级礼盒的钻石数是否与meta一致"""
     global seniorBox_Tsumdrop, seniorBox_maxtsum
     if not TsumDrop_dic and not FixedRewards_dic:
         chestlevel(TsumDrop_dic, FixedRewards_dic)
     seniorBox_meta_coin = int(
         FixedRewards_dic["2002"][userlevel].split("#")[1])
     senior_dataList = poco("UI Root").child("ShopPanel").offspring(
         "label_count")
     senior_coin = int(senior_dataList[0].get_text())
     self.assertEqual(senior_coin, seniorBox_meta_coin, caseList[18])
 def test_A4(self):
     u"""测试普通礼盒显示开出的松松数是否与meta一致"""
     global TsumDrop_dic, FixedRewards_dic, commonBox_maxtsum
     if not TsumDrop_dic and not FixedRewards_dic:
         chestlevel(TsumDrop_dic, FixedRewards_dic)
     for common_tsum in TsumDrop_dic["2001"][userlevel].split(","):
         common_num = len(common_tsum.split("#"))
         commonBox_Tsumdrop.append(common_tsum.split("#")[common_num - 1])
         commonBox_maxtsum += int(common_tsum.split("#")[common_num - 1])
     common_items = poco("UI Root").child("ShopPanel").offspring(
         "label_count")
     common_tsumNum = int(common_items[0].get_text().replace("x", ""))
     self.assertEqual(common_tsumNum, commonBox_maxtsum, caseList[3])
 def test_A24(self):
     u"""测试购买豪华礼盒的钻石数是否与meta一致"""
     global luxuryBox_Tsumdrop, luxuryBox_maxtsum
     if not TsumDrop_dic and not FixedRewards_dic:
         chestlevel(TsumDrop_dic, FixedRewards_dic)
     for luxury_tsum in TsumDrop_dic["2003"][userlevel].split(","):
         luxury_num = len(luxury_tsum.split("#"))
         luxuryBox_Tsumdrop.append(luxury_tsum.split("#")[luxury_num - 1])
         luxuryBox_maxtsum += int(luxury_tsum.split("#")[luxury_num - 1])
     luxury_dataList = poco("UI Root").child("ShopPanel").offspring(
         "label_count")
     luxury_tsum = int(luxury_dataList[1].get_text().replace("x", ""))
     self.assertEqual(luxury_tsum, luxuryBox_maxtsum, caseList[31])
 def test_A13(self):
     u"""测试购买高级礼盒的钻石数是否与meta一致"""
     global seniorBox_Tsumdrop, seniorBox_maxtsum, seniorBox_meta_coin
     if not TsumDrop_dic and not FixedRewards_dic:
         chestlevel(TsumDrop_dic, FixedRewards_dic)
     for senior_tsum in TsumDrop_dic["2002"][userlevel].split(","):
         senior_num = len(senior_tsum.split("#"))
         seniorBox_Tsumdrop.append(senior_tsum.split("#")[senior_num - 1])
         seniorBox_maxtsum += int(senior_tsum.split("#")[senior_num - 1])
     senior_dataList = poco("UI Root").child("ShopPanel").offspring(
         "label_count")
     senior_tsum = int(senior_dataList[1].get_text().replace("x", ""))
     self.assertEqual(senior_tsum, seniorBox_maxtsum, caseList[15])
 def test_A32(self):
     u"""测试点击豪华礼盒的提示弹窗的按钮"""
     page = 'purchase_popup'
     CostList = GetMeta("shop.xml", "costs")
     luxuryBox_metacash = int(CostList[2].replace("3000#", ""))
     if not TsumDrop_dic and not FixedRewards_dic:
         chestlevel(TsumDrop_dic, FixedRewards_dic)
     luxuryBox_meta_coin = int(
         FixedRewards_dic["2003"][userlevel].split("#")[1])
     itemsOld = poco("UI Root").child("HeaderPart").offspring("label_count")
     cashold = int(itemsOld[0].get_text())
     coinold = int(itemsOld[1].get_text())
     if cashold >= luxuryBox_metacash:
         Click('label_btn_popup_orange', page)
         page = 'openbox1_interface'
         Click('label_cishu', page)
         page = 'openbox2_interface'
         poco('label_share').wait_for_appearance()
         sleep(2.0)
         Click('label_cishu', page)
         page = 'openbox3_interface'
         poco('label_share').wait_for_appearance()
         sleep(2.0)
         Click('label_cishu', page)
         page = 'openbox4_interface'
         poco('label_share').wait_for_appearance()
         sleep(2.0)
         Click('label_cishu', page)
         page = 'openbox5_interface'
         poco('label_share').wait_for_appearance()
         sleep(2.0)
         Click('label_cishu', page)
         page = 'settleInterface'
         # 获取高级礼盒开出的金币数量
         luxury_tsumList = poco("UI Root").child(
             "ChestRewardPanel").offspring("label_count")
         luxury_getcoin = int(luxury_tsumList[0].get_text().replace(
             "+", ""))
         # 检查数量是否正确
         self.assertEqual(luxury_getcoin, luxuryBox_meta_coin, caseList[41])
         time.sleep(3.0)
         Click('label_ok', page)
         sleep(1.0)
         if poco('sprite_bg_header').exists():
             page = 'album_share'
             Click('btn_close', page)
             if poco('sprite_bg_header').exists():
                 page = 'album_share'
                 Click('btn_close', page)
         luxury_itemsNew = poco("UI Root").child("HeaderPart").offspring(
             "label_count")
         luxury_cashnew = int(luxury_itemsNew[0].get_text())
         luxury_coinnew = int(luxury_itemsNew[1].get_text())
         # 检查前端金币数量变化是否正确
         self.assertEqual(luxury_cashnew, cashold - luxuryBox_metacash,
                          caseList[42])
         self.assertEqual(luxury_coinnew, coinold + luxuryBox_meta_coin,
                          caseList[43])
     else:
         Click('label_btn_popup_orange', page)
         page = 'shopInterface'
         self.assertTrue(poco('tex_light').exists(), caseList[44])
         Click('label_chest', page)