예제 #1
0
        public void Rule_Add_Delete_Response_News()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\添加1个图片素材");

            PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.AddAutoReply);
            var regulationTextes = PortalChromeDriver.GetElementByClassName(AutoReplyElement.RegulationText);

            regulationTextes.Clear();
            regulationTextes.SendKeys("这是rule");
            AutoReplyPage.AddTrigger("abc" + "", 1 + "");

            AutoReplyPage.AddReply_News(1);
            Thread.Sleep(3 * 1000);
            PortalChromeDriver.TakeScreenShot(filePath, "添加1个图片素材");
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.PicValidator1, "关于“东方万里行” 相关问题"));

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.SendMessageWithMenu("abc");
            MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerName("关于“东方万里行” 相关问题"));

            filePath = PortalChromeDriver.CreateFolder(@"自动回复\删除图文");
            AutoReplyPage.DeletePicReply(1);
            PortalChromeDriver.TakeScreenShot(filePath, "删除图文");
            Assert.IsFalse(Utility.IsAt(AutoReplyElement.PicValidator, "关于“东方万里行” 相关问题"));
        }
        public void Rule_Add_Delete_Response_News_Weibo()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\添加1个图片素材");

            WeChatManagermentPage.GoTo_AutoReply_Page();
            PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply);
            AutoReplyPage.TurnOnAutoReply();
            AutoReplyPage.ClearReply();
            PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.AddAutoReply);
            var regulationTextes = PortalChromeDriver.GetElementByClassName(AutoReplyElement.RegulationText);

            regulationTextes.Clear();
            regulationTextes.SendKeys("这是rule");
            AutoReplyPage.AddTrigger(1 + "", 1 + "");

            AutoReplyPage.AddReply_News(1);
            Thread.Sleep(3 * 1000);
            PortalChromeDriver.TakeScreenShot(filePath, "添加1个图片素材");
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.PicValidator1, "g"));

            MobileAndroidDriver.AndroidInitialize_Weibo();
            Mobile_Weibo_Utility.Follow();
            Mobile_Weibo_Utility.ClearAllMessage();
            Mobile_Weibo_Utility.SendMessage("1");
            MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerName("g"));

            filePath = PortalChromeDriver.CreateFolder(@"自动回复\删除图文");
            AutoReplyPage.DeletePicReply(1);
            PortalChromeDriver.TakeScreenShot(filePath, "删除图文");
            Assert.IsFalse(Utility.IsAt(AutoReplyElement.PicValidator, "g"));
        }
예제 #3
0
        public void Rule_Add_Delete_Response_AllNews()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\添加5个图片素材");

            PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.AddAutoReply);
            var regulationTextes = PortalChromeDriver.GetElementByClassName(AutoReplyElement.RegulationText);

            regulationTextes.Clear();
            regulationTextes.SendKeys("这是rule");
            AutoReplyPage.AddTrigger(1 + "", 1 + "");

            AutoReplyPage.AddReply_News(5);
            Thread.Sleep(3 * 1000);
            PortalChromeDriver.TakeScreenShot(filePath, "添加5个图片素材");
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.PicValidator, "i"));
        }
예제 #4
0
        public void AddReply_AddReply_Total_5_HalfText()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\添加2个问题关键词3个图文关键词");

            PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.AddAutoReply);
            var regulationTextes = PortalChromeDriver.GetElementByClassName(AutoReplyElement.RegulationText);

            regulationTextes.Clear();
            regulationTextes.SendKeys("这是rule");
            AutoReplyPage.AddTrigger(1 + "", 1 + "");

            for (int i = 1; i <= 2; i++)
            {
                AutoReplyPage.AddReply_Text(i + "", i + "");
                Thread.Sleep(3 * 1000);
                PortalChromeDriver.ClickElementPerXpath("/html/body/div/div[2]/div[2]/div[2]/div/div[1]/div[1]/div[2]/span");
                Assert.IsTrue(Utility.IsAt(AutoReplyElement.ReplyContent.Replace("[{0}]", "[" + i + "]"), i + ""));
            }

            AutoReplyPage.AddReply_News(3);
            PortalChromeDriver.TakeScreenShot(filePath, "添加2个问题关键词3个图文关键词");
            Thread.Sleep(3 * 1000);
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.PicValidator, "h"));
        }