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_NoneHuman()
        {
            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.FollowWeChatOffcialAccount();
            FaceRankingMobilePage_WeChat.ClickFaceRanking();
            FaceRankingMobilePage_WeChat.FaceRankingFromFile("mmexport1489570865737.jpg");
            string filePath = PortalChromeDriver.CreateFolder(@"拼颜值\11.检查上传非人物图片的效果");

            MobileAndroidDriver.GetScreenshot(filePath, "11.检查上传非人物图片的效果");
            Assert.IsFalse(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment, "公众号颜值"), "Comment不出现评分");
        }
        public void FaceRanking_Celebrity()
        {
            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.FollowWeChatOffcialAccount();
            FaceRankingMobilePage_WeChat.ClickFaceRanking();
            FaceRankingMobilePage_WeChat.FaceRankingFromFile("mmexport1489570800142.jpg");
            string filePath = PortalChromeDriver.CreateFolder(@"拼颜值\9.检查上传明星图片的效果");

            MobileAndroidDriver.GetScreenshot(filePath, "9.检查上传明星图片的效果");

            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment, "杨洋"), "未显示明星名字,当前case为林丹");
        }
        public void FaceRanking_QRCode_Available()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"拼颜值\检查手机端拼颜值页面下面的二位码是否可以正常使用");

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.FollowWeChatOffcialAccount();
            FaceRankingMobilePage_WeChat.ClickFaceRanking();

            FaceRankingMobilePage_WeChat.ClickQRCode();
            MobileAndroidDriver.GetScreenshot(filePath, "点击二维码是否进入公众号");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerName(Mobile.UIElement.FaceRankingMobileElement.Menuitem));
            FaceRankingMobilePage_WeChat.ClickFaceRanking();
            FaceRankingMobilePage_WeChat.FaceRankingFromFile(SecretRelationshipTest.美男美女);
            MobileAndroidDriver.GetScreenshot(filePath, "二维码进去公众号后是否能正常使用拼颜值");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(Mobile.UIElement.FaceRankingMobileElement.Comment), "二维码进去公众号后是否能正常使用拼颜值");
        }
        public void Can_secretRelationship_TurnOff_Weibo()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"关系识别\停用'关系识别'功能后,输入含有'关系识别'的文本消息或点击相应link,是否能够触发该功能");

            Utility.TurnOff();
            Thread.Sleep(2 * 1000);
            Assert.IsTrue(!Utility.IsTurnOn());

            MobileAndroidDriver.AndroidInitialize_Weibo();
            Mobile_Weibo_Utility.Follow();

            Mobile_WeChat_Utility.SendMessageWithMenu("关系识别");
            Thread.Sleep(2 * 1000);
            //Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("管理员"), "'拼颜值trigger'");
            Assert.IsTrue(Mobile_Weibo_Utility.GetLatestMessage().Text.Contains("关闭"));
            FaceRankingMobilePage_WeChat.ClickFaceRanking();
            Assert.IsTrue(!Mobile_WeChat_Utility.IsAtPerClassName("android.widget.Button"), "点击拼颜值menu");
        }
        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端是否能正常使用");
        }