public void Can_secretRelationship_1_100_DiffPhoto_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"关系识别\32.只选中任一一个奖项后,上传一张跟该奖项无关的人物图片,是否会中奖(所有奖项都试一遍)"); for (int i = 1; i < 8; i++) { WeChatManagermentPage.GoToCS_Skill_Page(); SecretRelationshipPage.ClickSecretRelationship(); SecretRelationshipPage.TurnOn(); //设置奖励中奖概率 PortalChromeDriver.ClickElementPerXpath(secretRelationshipElement.RewartSetting); SecretRelationshipPage.ClearAllAward(); SecretRelationshipPage.CheckAward(secretRelationshipElement.Award.Replace("{0}", i + ""), "1", "100"); MobileAndroidDriver.AndroidInitialize_Weibo(); Mobile_Weibo_Utility.Follow(); string file = string.Empty; switch (i) { case 1: file = 美女美女; break; case 2: file = 美男美女; break; case 3: file = 美男美女; break; case 4: file = 美男美女; break; case 5: file = 美男美女; break; case 6: file = 美男美女; break; case 7: file = 小孩小孩; break; } //上传不同图片 FaceRankingMobilePage_WeChat.FaceRankingFromFile(file); MobileAndroidDriver.GetScreenshot(filePath, file + i); Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment), "图片显示描述语是否正确"); Assert.IsTrue(FaceRankingMobilePage_WeChat.CheckOficailAccountShow("啊_荀"), "公众号名称是否正确显示"); Assert.IsFalse(MobileAndroidDriver.IsAt(secretRelationshipElement.H5Reward_Resource_id, "reward_25_" + i), "奖励是否显示"); MobileAndroidDriver.androidDriver.Dispose(); } }
public void Can_secretRelationship_5_100_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"关系识别\29.设置最高发奖数量为5, 中奖机率为100%, 检查发送的前5张有效图片都能中奖(所有奖项都试一遍)"); string filePath30 = PortalChromeDriver.CreateFolder(@"关系识别\30.设置最高发奖数量为5, 中奖机率为100%, 检查发送的第6张有效图片能否中奖(所有奖项都试一遍)"); MobileAndroidDriver.AndroidInitialize_Weibo(); Mobile_Weibo_Utility.Follow(); for (int i = 1; i < 11; i++) { count = 0; WeChatManagermentPage.GoToCS_Skill_Page(); SecretRelationshipPage.ClickSecretRelationship(); SecretRelationshipPage.TurnOn(); //设置奖励中奖概率 PortalChromeDriver.ClickElementPerXpath(secretRelationshipElement.RewartSetting); SecretRelationshipPage.ClearAllAward(); SecretRelationshipPage.CheckAward(secretRelationshipElement.Award.Replace("{0}", i + ""), "6", "100"); string file = string.Empty; switch (i) { case 1: file = 美男美女; break; case 2: file = 美女丑男; break; case 3: file = 年轻男小孩; break; case 4: file = 美女美女; break; case 5: file = 小孩小孩; break; case 6: file = 小孩小孩; break; case 7: file = 美女美女; break; case 8: file = 小孩小孩; break; case 9: file = 小孩小孩; break; case 10: file = 小孩小孩; break; } for (int j = 1; j <= 5; j++) { ChoosePhotoAndCheck(file, i); MobileAndroidDriver.GetScreenshot(filePath, file + i); Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment), "图片显示描述语是否正确"); Assert.IsTrue(FaceRankingMobilePage_WeChat.CheckOficailAccountShow("啊_荀"), "公众号名称是否正确显示"); //Assert.IsTrue(MobileAndroidDriver.IsAt(secretRelationshipElement.H5Reward_Resource_id, "reward_25_" + i), "奖励是否显示"); FaceRankingMobilePage_WeChat.BackWards(); } //for(int m=1;m<=10-count;m++) //{ // FaceRankingH5Page.ClickFaceRanking(); // FaceRankingH5Page.FaceRankingFromFile(file); // Thread.Sleep(10 * 1000); //} FaceRankingMobilePage_WeChat.FaceRankingFromFile(file); Thread.Sleep(5 * 1000); MobileAndroidDriver.GetScreenshot(filePath, file + i); Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment), "图片显示描述语是否正确"); Assert.IsTrue(FaceRankingMobilePage_WeChat.CheckOficailAccountShow("啊_荀"), "公众号名称是否正确显示"); Assert.IsFalse(MobileAndroidDriver.IsAt(secretRelationshipElement.H5Reward_Resource_id, "reward_25_" + i), "奖励是否显示"); FaceRankingMobilePage_WeChat.BackWards(); } }