Beispiel #1
0
 def test_A55(self):
     u"""测试点击第三个金币堆确认提示弹窗显示的按钮"""
     page = 'purchase_popup'
     CostList = GetMeta("shop.xml", "costs")
     coin3_metacash = int(CostList[5].replace("3000#", ""))
     CoinList = GetMeta('shop.xml', 'items')
     coin3_meta = int(CoinList[5].replace("2000#", ""))
     items = poco("UI Root").child("HeaderPart").offspring("label_count")
     cash = int(items[0].get_text())
     coin = int(items[1].get_text())
     if cash >= coin3_metacash:
         Click('btn_confirm', page)
         time.sleep(2.0)
         coin_itemsNew = poco("UI Root").child("HeaderPart").offspring(
             "label_count")
         coin_cashnew = int(coin_itemsNew[0].get_text())
         coin_coinnew = int(coin_itemsNew[1].get_text())
         self.assertEqual(coin_coinnew, coin + coin3_meta, caseList[75])
         self.assertEqual(coin_cashnew, cash - coin3_metacash, caseList[76])
     else:
         Click('btn_confirm', page)
         coin1_cash_less_info = poco("label_info").get_text()
         cashtext = TextDic['shop_type_title_3']
         infotext = TextDic['shop_supplement']
         self.assertEqual(coin1_cash_less_info, infotext % cashtext,
                          caseList[77])
         coin1_less_botton = poco("label_btn_popup_orange").get_text()
         goaltext = TextDic['shop_guide']
         self.assertEqual(coin1_less_botton, goaltext, caseList[78])
         Click('label_btn_popup_orange', page)
         page = 'shopInterface'
         self.assertTrue(poco('tex_light').exists(),
                         caseList[79])  # 需要修改!!!
         Click('label_coin', page)
Beispiel #2
0
 def test_A53(self):
     u"""测试第三个金币堆确认提示弹窗显示的文案是否与配置一致"""
     coin1_adequate_info = poco("label_info").get_text()
     CoinList = GetMeta('shop.xml', 'items')
     coin3_meta = int(CoinList[5].replace("2000#", ""))
     CostList = GetMeta("shop.xml", "costs")
     coin3_metacash = int(CostList[5].replace("3000#", ""))
     infotext = TextDic['shop_confirm']
     cashtext = TextDic['shop_type_title_3']
     cointext = TextDic['shop_type_title_2']
     alltext = infotext % (coin3_metacash, cashtext, coin3_meta, cointext)
     self.assertEqual(coin1_adequate_info, alltext, caseList[73])
Beispiel #3
0
 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])
Beispiel #4
0
 def test_A40(self):
     u"""测试购买第三个金币堆所需的钻石数是否与meta一致"""
     CostList = GetMeta("shop.xml", "costs")
     coin3_metacash = int(CostList[5].replace("3000#", ""))
     cash3 = int(
         poco("0003").offspring("propIcon_cost").child(
             "label_count").get_text())
     self.assertEqual(cash3, coin3_metacash, caseList[52])
Beispiel #5
0
 def test_A3(self):
     u"""测试购买普通礼盒的金币数是否与meta一致"""
     CostList = GetMeta("shop.xml", "costs")
     commonBox_metacoin = int(CostList[0].replace("1011#", ""))
     common_items = poco("UI Root").child("ShopPanel").offspring(
         "label_count")
     common_coin = int(common_items[2].get_text())
     self.assertEqual(common_coin, commonBox_metacoin, caseList[2])
Beispiel #6
0
 def test_A23(self):
     u"""测试购买豪华礼盒的钻石数是否与meta一致"""
     CostList = GetMeta("shop.xml", "costs")
     luxuryBox_metacash = int(CostList[2].replace("3000#", ""))
     luxury_dataList = poco("UI Root").child("ShopPanel").offspring(
         "label_count")
     luxury_cash = int(luxury_dataList[4].get_text())
     self.assertEqual(luxury_cash, luxuryBox_metacash, caseList[30])
Beispiel #7
0
 def test_A12(self):
     u"""测试购买高级礼盒的钻石数是否与meta一致"""
     CostList = GetMeta("shop.xml", "costs")
     seniorBox_metacash = int(CostList[1].replace("3000#", ""))
     senior_dataList = poco("UI Root").child("ShopPanel").offspring(
         "label_count")
     senior_cash = int(senior_dataList[4].get_text())
     self.assertEqual(senior_cash, seniorBox_metacash, caseList[14])
Beispiel #8
0
 def test_A31(self):
     u"""测试豪华礼盒的提示弹窗显示的按钮文案是否预配置一致"""
     CostList = GetMeta("shop.xml", "costs")
     luxuryBox_metacash = int(CostList[2].replace("3000#", ""))
     itemsOld = poco("UI Root").child("HeaderPart").offspring("label_count")
     cashold = int(itemsOld[0].get_text())
     if cashold >= luxuryBox_metacash:
         luxbox_adequate_botton = poco("label_btn_popup_orange").get_text()
         goaltext = TextDic['shop_buy']
         self.assertEqual(luxbox_adequate_botton, goaltext, caseList[39])
     else:
         luxbox_less_botton = poco("label_btn_popup_orange").get_text()
         goaltext = TextDic['shop_guide']
         self.assertEqual(luxbox_less_botton, goaltext, caseList[40])
Beispiel #9
0
 def test_A9(self):
     u"""测试普通礼盒的提示弹窗显示的按钮文案是否预配置一致"""
     CostList = GetMeta("shop.xml", "costs")
     commonBox_metacoin = int(CostList[0].replace("2000#", ""))
     currency = poco("UI Root").child("HeaderPart").offspring("label_count")
     coin = int(currency[1].get_text())
     if coin >= commonBox_metacoin:
         combox_adequate_botton = poco("label_btn_popup_orange").get_text()
         goaltext = TextDic['shop_buy']
         self.assertEqual(combox_adequate_botton, goaltext, caseList[9])
     else:
         combox_less_botton = poco("label_btn_popup_orange").get_text()
         goaltext = TextDic['shop_guide']
         self.assertEqual(combox_less_botton, goaltext, caseList[10])
Beispiel #10
0
 def test_A8(self):
     u"""测试普通礼盒的提示弹窗显示的文案是否与配置一致"""
     CostList = GetMeta("shop.xml", "costs")
     commonBox_metacoin = int(CostList[0].replace("2000#", ""))
     currency = poco("UI Root").child("HeaderPart").offspring("label_count")
     coin = int(currency[1].get_text())  #获取当前的金币数量
     if coin >= commonBox_metacoin:  #金币充足时的显示
         combox_adequate_info = poco("label_info").get_text()
         infotext = TextDic['shop_confirm']
         cointext = TextDic['shop_type_title_2']
         boxtext = TextDic['shop_box_1']
         mergtext = '个Lv.%s' % userlevel
         alltext = infotext % (commonBox_metacoin, cointext, 1,
                               mergtext + boxtext)
         self.assertEqual(combox_adequate_info, alltext, caseList[7])
     else:  #金币不足时的显示
         combox_less_info = poco("label_info").get_text()
         cointext = TextDic['shop_type_title_2']
         infotext = TextDic['shop_supplement']
         self.assertEqual(combox_less_info, infotext % cointext,
                          caseList[8])
Beispiel #11
0
 def test_A10(self):
     u"""测试点击普通礼盒的提示弹窗的按钮"""
     page = 'purchase_popup'
     CostList = GetMeta("shop.xml", "costs")
     commonBox_metacoin = int(CostList[0].replace("2000#", ""))
     currency = poco("UI Root").child("HeaderPart").offspring("label_count")
     coin = int(currency[1].get_text())
     if coin >= commonBox_metacoin:
         Click('label_btn_popup_orange', page)
         page = 'openbox3_interface'
         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'
         # 获取开完宝箱后的金币数量
         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)
         currencyNew = poco("UI Root").child("HeaderPart").offspring(
             "label_count")
         coinnew = int(currencyNew[1].get_text())
         # 检查前端金币数量变化是否正确
         self.assertEqual(coinnew, coin - commonBox_metacoin, caseList[11])
     else:
         Click('label_btn_popup_orange', page)
         page = 'shopInterface'
         self.assertTrue(poco('sprite_gold_1').exists(), caseList[12])
         Click('label_chest', page)
Beispiel #12
0
 def test_A37(self):
     u"""测试第三个金币堆的金币数显示是否与meta一致"""
     CoinList = GetMeta('shop.xml', 'items')
     coin3_meta = int(CoinList[5].replace("2000#", ""))
     coin3 = int(poco("0003").child("label_get").get_text())
     self.assertEqual(coin3, coin3_meta, caseList[49])
Beispiel #13
0
 def test_A36(self):
     u"""测试第二个金币堆的金币数显示是否与meta一致"""
     CoinList = GetMeta('shop.xml', 'items')
     coin2_meta = int(CoinList[4].replace("2000#", ""))
     coin2 = int(poco("0002").child("label_get").get_text())
     self.assertEqual(coin2, coin2_meta, caseList[48])
Beispiel #14
0
 def test_A35(self):
     u"""测试第一个金币堆的金币数显示是否与meta一致"""
     CoinList = GetMeta('shop.xml', 'items')
     coin1_meta = int(CoinList[3].replace("2000#", ""))
     coin1 = int(poco("0001").child("label_get").get_text())
     self.assertEqual(coin1, coin1_meta, caseList[47])
Beispiel #15
0
 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)