Exemple #1
0
        public void DeleteAutoReply_AutoReply()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\删除自动回复");

            AutoReplyPage.AddAutoReply("A", "Hi", "第一个自动回复");
            AutoReplyPage.DeleteReply();
            PortalChromeDriver.TakeScreenShot(filePath, "删除自动回复");
            Assert.IsFalse(Utility.IsAt(AutoReplyElement.RuleContent, "规则1:A"));

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.SendMessage("A");
            MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配");
            Assert.IsTrue(!Mobile_WeChat_Utility.GetLatestMessage("[平台测试账号2]说:"));
        }
        public void DeleteAutoReply_AutoReply_Weibo()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\删除自动回复");

            WeChatManagermentPage.GoTo_AutoReply_Page();
            PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply);
            AutoReplyPage.TurnOnAutoReply();
            AutoReplyPage.ClearReply();
            AutoReplyPage.AddAutoReply("A", "Hi", "第一个自动回复");
            AutoReplyPage.DeleteReply();
            PortalChromeDriver.TakeScreenShot(filePath, "删除自动回复");
            Assert.IsFalse(Utility.IsAt(AutoReplyElement.RuleContent, "规则1:A"));

            MobileAndroidDriver.AndroidInitialize_Weibo();
            Mobile_Weibo_Utility.Follow();
            Mobile_Weibo_Utility.ClearAllMessage();
            Mobile_Weibo_Utility.SendMessage("A");
            MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配");
            Assert.IsTrue(!Mobile_WeChat_Utility.IsAtPerName("[啊_荀] 说:Hi"));
        }
Exemple #3
0
        public void AddText_AutoReply()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\添加关键词回复");

            AutoReplyPage.AddAutoReply("", "Hi", "第一个自动回复");
            Assert.IsTrue(Utility.IsAt(CommonElement.notification), "规则名不能为空");

            AutoReplyPage.AddAutoReply("A", "", "第一个自动回复");
            Assert.IsTrue(Utility.IsAt(CommonElement.notification), "关键词不能为空");

            AutoReplyPage.AddAutoReply("A", "Hi", "");
            Assert.IsTrue(Utility.IsAt(CommonElement.notification), "回复文本不能为空");

            AutoReplyPage.AddAutoReply("012345678901234567890123456789012345678901234567890", "0123456789012345678901234567890", "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890");
            Thread.Sleep(2 * 1000);
            PortalChromeDriver.TakeScreenShot(filePath, "字数限制");
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.RuleContent, "01234567890123456789012345678901234567890123456789"));
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.TrigerContent.Replace("{0}", 1 + ""), "012345678901234567890123456789"));
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.ReplyContent.Replace("[{0}]", "[" + 1 + "]"), "012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"));
            AutoReplyPage.DeleteReply();
        }