public void FaceRanking_ChangeTheAverage() { MobileAndroidDriver.AndroidInitialize(); Mobile_WeChat_Utility.FollowWeChatOffcialAccount(); FaceRankingMobilePage_WeChat.ClickFaceRanking(); double before1 = 0; double after1 = 0; double before2 = 0; double after2 = 0; double before3 = 0; double after3 = 0; string filePath = PortalChromeDriver.CreateFolder(@"拼颜值\12.检查多次上传测试后,平均值是否被拉高或拉低了"); FaceRankingMobilePage_WeChat.FaceRankingFromFile(SecretRelationshipTest.美女美女); FaceRankingMobilePage_WeChat.Getfraction(ref before1, ref after1); MobileAndroidDriver.GetScreenshot(filePath, "第一次上传"); FaceRankingMobilePage_WeChat.BackWards(); FaceRankingMobilePage_WeChat.ClickFaceRanking(); FaceRankingMobilePage_WeChat.FaceRankingFromFile(SecretRelationshipTest.美女美女); FaceRankingMobilePage_WeChat.Getfraction(ref before2, ref after2); MobileAndroidDriver.GetScreenshot(filePath, "第二次上传"); FaceRankingMobilePage_WeChat.BackWards(); FaceRankingMobilePage_WeChat.ClickFaceRanking(); FaceRankingMobilePage_WeChat.FaceRankingFromFile(SecretRelationshipTest.美女美女); FaceRankingMobilePage_WeChat.Getfraction(ref before3, ref after3); MobileAndroidDriver.GetScreenshot(filePath, "第三次上传"); Assert.IsTrue(before1 <= after1 && before2 <= after2 && before3 <= after3); Assert.IsTrue(after1 == before2 && after2 == before3); }
public void FaceRanking_Link_Available() { MobileAndroidDriver.AndroidInitialize(); Mobile_WeChat_Utility.FollowWeChatOffcialAccount(); //拼颜值功能是否正常使用 string filePath = PortalChromeDriver.CreateFolder(@"拼颜值\5.检查在手机端”拼颜值“功能是否可以正常使用"); FaceRankingMobilePage_WeChat.ClickFaceRanking(); FaceRankingMobilePage_WeChat.FaceRankingFromFile(SecretRelationshipTest.美女美女); MobileAndroidDriver.GetScreenshot(filePath, "图片显示描述语"); Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment), "图片显示描述语"); //分享出去后是否能正常打开 filePath = PortalChromeDriver.CreateFolder(@"拼颜值\16.测试结果是否可以分享"); FaceRankingMobilePage_WeChat.ShareToSomeOne(); FaceRankingMobilePage_WeChat.BackWards(); FaceRankingMobilePage_WeChat.BackWards(); FaceRankingMobilePage_WeChat.BackWards(); FaceRankingMobilePage_WeChat.CheckLinkAvailable(); MobileAndroidDriver.GetScreenshot(filePath, "分享出去后是否能正常打开"); Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment), "分享出去后是否能正常打开"); //分享之后能否正常使用 FaceRankingMobilePage_WeChat.FaceRankingFromFile(SecretRelationshipTest.美女美女); MobileAndroidDriver.GetScreenshot(filePath, "分享出去后是否能正常使用"); Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment), "分享出去后是否能正常使用"); //再次分享后是否正常打开 FaceRankingMobilePage_WeChat.ShareToSomeOne(); FaceRankingMobilePage_WeChat.CheckLinkAvailable(); MobileAndroidDriver.GetScreenshot(filePath, "第二次分享出去后是否能正常打开"); Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment), "分享出去后是否能正常打开"); //二次分享之后能否正常使用 FaceRankingMobilePage_WeChat.FaceRankingFromFile(SecretRelationshipTest.美女美女); MobileAndroidDriver.GetScreenshot(filePath, "第二次分享出去后是否能正常使用"); Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment), "第二次分享出去后是否能正常使用"); }
public void FaceRanking_TurnOff() { MobileAndroidDriver.AndroidInitialize(); Mobile_WeChat_Utility.FollowWeChatOffcialAccount(); FaceRankingMobilePage_WeChat.ClickFaceRanking(); FaceRankingMobilePage_WeChat.FaceRankingFromFile(SecretRelationshipTest.美男美女); string filePath = PortalChromeDriver.CreateFolder(@"拼颜值\14.检查是否可以正常关闭”拼颜值“的功能"); MobileAndroidDriver.GetScreenshot(filePath, "关闭前拼颜值正常使用,图片显示描述语"); Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment), "关闭前拼颜值正常使用,图片显示描述语"); //停用拼颜值 Utility.TurnOff();; string turnOffPath = PortalChromeDriver.CreateFolder(@"拼颜值\19.是否可以停用'拼颜值'功能"); PortalChromeDriver.TakeScreenShot(turnOffPath, "Portal是否能正常关闭拼颜值"); Assert.IsTrue(!Utility.IsTurnOn(), "Portal是否能正常关闭拼颜值"); FaceRankingMobilePage_WeChat.BackWards(); FaceRankingMobilePage_WeChat.ClickFaceRanking(); MobileAndroidDriver.GetScreenshot(filePath, "关闭拼颜值技能后H5端是否能正常使用"); Assert.IsFalse(Mobile_WeChat_Utility.IsAt(Mobile.UIElement.FaceRankingMobileElement.AccountFaceRanking), "关闭拼颜值技能后H5端是否能正常使用"); }
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(); } }