public void Check_Bind_CodeAvailable()
        {
            PortalChromeDriver.CreateFolder(@"HI\31.[客服人员设定]是否可以正常使用,当登陆密码有效期内(首次绑定)");
            //确保HI是Turn on的状态
            WeChatManagermentPage.GoToHIPage();
            HIPage.TurnOnSetup();
            //切换到Hi的设置Tab页
            HIPage.SwichHISettingTab(HIPortalPageUIElement.SubTabHIStaff);
            //判断是否已经绑定客服,如果绑定,则删除客服
            HIPage.DeleteStaff();
            //获取绑定客服验证码
            var value = HIPage.GetLoginCode();

            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            //删除聊天记录
            Mobile_WeChat_Utility.ClearAllRecord();
            //发送验证码
            Mobile_WeChat_Utility.SendMessage(value);
            //验证网页版是否成功绑定
            Assert.IsTrue(!HIPage.IsStaffBindOnPortal());

            //验证Mobile是否有绑定成功提示
            PortalChromeDriver.TakeScreenShot(foler, "验证过期验证码是否能正常使用");
            Assert.IsTrue(Mobile_WeChat_Utility.IsStaffBind());

            Mobile_WeChat_Utility.SendMessage(value);
            Assert.IsFalse(Mobile_WeChat_Utility.GetLatestMessage("客服接入成功"));
        }
Beispiel #2
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 Can_Staff_CheckReply_FromCustomer()
        {
            string foler = PortalChromeDriver.CreateFolder(@"HI\43.客服是否可以正常回复收到的用户消息");

            //Portal确保HI是Turn on的状态
            WeChatManagermentPage.GoToHIPage();
            HIPage.TurnOnSetup();

            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            //H5呼叫客服
            Mobile_WeChat_Utility.GetHiCard("客服");
            //H5用户发送消息
            Mobile_WeChat_Utility.XB_SendMessage("这里是测试账号");

            //Portal客服打开Hi对话窗口
            HIPage.OpenHiChatWindow();
            //点击测试账号
            HIPage.GetTestUserFromUserList();
            //客服发送消息
            HIPage.SendMessage("这里是客服");
            //验证Portal最后一条消息是不是客服回复的消息

            PortalChromeDriver.TakeScreenShot(foler, "Portal");
            MobileAndroidDriver.GetScreenshot(foler, "H5");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(string.Format(HIMobileH5Element.ReplyFromHi, "这里是客服")));
            Mobile_WeChat_Utility.ClickReplyCard();
        }
        public void Is_Big_MsgTip_ShowUp()
        {
            PortalChromeDriver.CreateFolder(@"HI\59.[对话窗口]是否有新消息提示标识显示,当开启人工客服后有消息接入_客户H5发送消息");
            //Portal确保HI是Turn on的状态
            WeChatManagermentPage.GoToHIPage();
            HIPage.TurnOnSetup();

            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            //H5呼叫客服
            Mobile_WeChat_Utility.GetHiCard("客服");
            //H5用户发送消息
            Mobile_WeChat_Utility.XB_SendMessage("这里是测试账号");
            Mobile_WeChat_Utility.XB_SendMessage("这里是测试账号");

            MobileAndroidDriver.GetScreenshot(foler, "客户H5发送消息");
            Mobile_WeChat_Utility.BackButtonClick();
            Thread.Sleep(5 * 1000);
            PortalChromeDriver.TakeScreenShot(foler, "59.[对话窗口]是否有新消息提示标识显示,当开启人工客服后有消息接入");
            PortalChromeDriver.CreateFolder(@"HI\61.是否可以显示大红点,当不在人工对话栏并有新消息接入时");
            PortalChromeDriver.TakeScreenShot(foler, "61.是否可以显示大红点,当不在人工对话栏并有新消息接入时");
            Assert.IsTrue(HIPage.Is_Big_New_Msg_Tip());
            //点击人工客服之后 大红点消失
            HIPage.HiChatPoartal();
            Assert.IsFalse(HIPage.Is_Big_New_Msg_Tip());
        }
        public void TriggerHiCardAfterEditTriger()
        {
            //Portal确保HI是Turn on的状态
            WeChatManagermentPage.GoToHIPage();
            HIPage.TurnOnSetup();
            HIPage.ClearTriggers();
            #region 修改设置好的关键词
            HIPage.InputTrigger("Hi");
            HIPage.EditTrigger("append");
            HIPage.ClickSomewhereToSave();
            #endregion

            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.ClearAllRecord();
            //H5呼叫客服
            Mobile_WeChat_Utility.SendMessage("append");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.HiCardXpath));

            Mobile_WeChat_Utility.ClearAllRecord();
            Thread.Sleep(5 * 1000);
            Mobile_WeChat_Utility.SendMessage("Hi");
            Thread.Sleep(5 * 1000);
            string foler = PortalChromeDriver.CreateFolder(@"HI\H5.4.修改设置好的关键词后,能否正常触发人工客服card");
            MobileAndroidDriver.GetScreenshot(foler, "H5");
            Assert.IsFalse(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.HiCardXpath));
        }
        public void CheckReplyBackFromHI_NotInH5()
        {
            //Portal确保HI是Turn on的状态
            WeChatManagermentPage.GoToHIPage();
            HIPage.TurnOnSetup();
            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            //Thread.Sleep(5*1000);
            //H5呼叫客服
            Mobile_WeChat_Utility.GetHiCard("客服");
            Mobile_WeChat_Utility.XB_SendMessage("这里是测试账号");

            //退出当前对话窗口
            Mobile_WeChat_Utility.BackButtonClick();

            //Portal端客服回复
            HIPage.OpenHiChatWindow();
            HIPage.GetTestUserFromUserList();
            Thread.Sleep(90 * 1000);
            Mobile_WeChat_Utility.SendMessage("a");
            Thread.Sleep(10 * 1000);;
            HIPage.SendMessage("这里是客服");
            Thread.Sleep(2 * 1000);
            //验证最后一条消息是不是客服回复的消息
            string foler = PortalChromeDriver.CreateFolder(@"HI\H5.11.当用户不在H5对话窗口时, 是否可以收到客服的回复");

            MobileAndroidDriver.GetScreenshot(foler, "H5");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.ReplyCardFromHI));
            Mobile_WeChat_Utility.ClickReplyCard();
            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerXpath(string.Format(HIMobileH5Element.ReplyFromHi, "这里是客服")));
            Mobile_WeChat_Utility.BackButtonClick();
        }
        public void Can_EditTriger_InHI_ComeFirst()
        {
            string foler = PortalChromeDriver.CreateFolder(@"HI\19.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词内容与自定义关键词回复相同的内容时");

            LoginPage.GoTo();
            HomePage.ClickWeChatApp("平台测试账号2");
            //Go to AI AutoReply Page
            WeChatManagermentPage.GoTo_AutoReply_Page();
            //AutoReplyPage.TurnOnAutoReply();\
            AutoReplyPage.AddAutoReply("A", "Hi", "这里是自动回复");

            PortalChromeDriver.TakeScreenShot(foler, "添加自动回复关键词");
            WeChatManagermentPage.GoToHIPage();
            HIPage.ClickSettings();
            HIPage.SwichHISettingTab(HIPortalPageUIElement.SubTabHITrigger);
            HIPage.ClearTriggers();
            HIPage.InputTrigger("Hello");
            HIPage.EditTrigger("Hi");
            PortalChromeDriver.TakeScreenShot(foler, "编辑HITrigger");
            //Trigger Card In H5
            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            //H5呼叫客服
            Mobile_WeChat_Utility.SendMessage("Hi");
            MobileAndroidDriver.GetScreenshot(foler, "19.[接入条件设置]是否可以正常保存,当编辑已有的触发关键词内容与自定义关键词回复相同的内容时");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.HiCardXpath), "编辑已有触发关键词后,HI触发关键词应优先");
        }
Beispiel #8
0
        public void EditReply_AutoReply()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\编辑关键词回复");

            AutoReplyPage.AddAutoReply("A", "Hi", "第一个自动回复");
            Thread.Sleep(2 * 1000);
            PortalChromeDriver.Refresh();
            AutoReplyPage.EditRule("修改的Rule");
            PortalChromeDriver.TakeScreenShot(filePath, "修改的Rule");
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.RuleContent, "修改的Rule"));

            AutoReplyPage.EditTriger("修改的Trigger");
            PortalChromeDriver.TakeScreenShot(filePath, "修改的Trigger");
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.TrigerContent.Replace("[{0}]", ""), "修改的Trigger"));

            AutoReplyPage.EditReply("修改的Reply");
            PortalChromeDriver.TakeScreenShot(filePath, "修改的Reply");
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.ReplyContent.Replace("[{0}]", ""), "修改的Reply"));

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.SendMessage("修改的Trigger");
            MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配");
            Assert.IsTrue(!Mobile_WeChat_Utility.GetLatestMessage("修改的Reply"));
        }
        public void Can_Continue_Chat_PressHome()
        {
            //Portal确保HI是Turn on的状态
            WeChatManagermentPage.GoToHIPage();
            HIPage.TurnOnSetup();
            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            ////H5呼叫客服
            Mobile_WeChat_Utility.GetHiCard("客服");
            Mobile_WeChat_Utility.XB_SendMessage("我是客户测试账号");
            Thread.Sleep(2 * 1000);
            Mobile_WeChat_Utility.BackButtonClick();
            Thread.Sleep(2 * 1000);
            Mobile_WeChat_Utility.BackToHome();
            HIPage.OpenHiChatWindow();
            HIPage.SendMessage("这里是客服");
            Thread.Sleep(10 * 1000);
            Mobile_WeChat_Utility.OpenWeChatFromHome();
            Mobile_WeChat_Utility.ClickReplyCard();
            string foler = PortalChromeDriver.CreateFolder(@"HI\H5.30.按home键后,是否还能进入继续聊天(不停用微信进程)");

            MobileAndroidDriver.GetScreenshot(foler, "H5)");
            Assert.IsTrue(Mobile_WeChat_Utility.GetMessage("这里是客服"));
            Mobile_WeChat_Utility.BackButtonClick();
        }
Beispiel #10
0
 public void ChitChatSkill_BedTime_Story()
 {
     MobileAndroidDriver.AndroidInitialize();
     Mobile_WeChat_Utility.GetToTestAccount();
     Mobile_WeChat_Utility.ClearAllRecord();
     Mobile_WeChat_Utility.SendMessage("讲个税前故事");
     Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage(null));
 }
        public void AddOneLevelMenu_Text()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\添加一级菜单_文本");

            MenuPage.AddMenu("一");
            MenuPage.AddMenu_Text("这里是一级菜单");
            Thread.Sleep(300 * 1000);
            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.ClickFirstLevelMenu("一");
            MobileAndroidDriver.GetScreenshot(filePath, "是否能成功添加一个一级菜单_文本");
            Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessageWithMenu().Text == "这里是一级菜单");
        }
Beispiel #12
0
        public void Rule_Trigger_SameWith_Material()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\如果设置关键词的内容跟素材的名称一致,优先回复关键词");

            AutoReplyPage.AddAutoReply("A", "jdw", "我不是素材");
            PortalChromeDriver.TakeScreenShot(filePath, "Portal如果设置关键词的内容跟素材的名称一致,优先回复关键词");

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.SendMessageWithMenu("jdw");
            Thread.Sleep(1 * 1000);
            MobileAndroidDriver.GetScreenshot(filePath, "H5如果设置关键词的内容跟素材的名称一致,优先回复关键词");
            Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("我不是素材"));
        }
Beispiel #13
0
        public void Rule_Fuzzy_Matching()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\模糊匹配");

            AutoReplyPage.AddAutoReply_Fuzzy_Matching("A", "abcdef", "我不是素材");

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.ClearAllRecord();
            Mobile_WeChat_Utility.SendMessageWithMenu("abcdef123");
            Thread.Sleep(2 * 1000);
            MobileAndroidDriver.GetScreenshot(filePath, "模糊匹配");
            Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("我不是素材"));
        }
Beispiel #14
0
        public void Rule_Exact_Match()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\关键词精确匹配");

            AutoReplyPage.AddAutoReply("A", "A", "我不是素材");
            PortalChromeDriver.TakeScreenShot(filePath, "关键词精确匹配");

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.ClearAllRecord();
            Mobile_WeChat_Utility.SendMessageWithMenu("A");
            MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配");
            Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("我不是素材"));
        }
Beispiel #15
0
        public void CheckOnMobile_OtherPhoto()
        {
            string folder = PortalChromeDriver.CreateFolder(@"朋友圈截图\是否支持其他格式图片");

            Utility.TurnOn();
            MomentsSnapPage.DeleteCampain();
            Thread.Sleep(2 * 1000);
            MomentsSnapPage.CreateCampaign("河北");

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.SendPhotoFromFileWithMenu("图片 1, 2017-03-15 17:49");
            Thread.Sleep(5 * 1000);
            Assert.IsFalse(Mobile_WeChat_Utility.GetLatestMessageWithMenu().Text.Contains("[平台测试账号2] 说:ok"));
        }
Beispiel #16
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 Can_ShareWin_ToFriend()
        {
            //Portal确保HI是Turn on的状态
            WeChatManagermentPage.GoToHIPage();
            HIPage.TurnOnSetup();

            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            //H5呼叫客服
            Mobile_WeChat_Utility.GetHiCard("客服");
            string foler = PortalChromeDriver.CreateFolder(@"HI\H5.12.对话窗口是否可以分享和发送给朋友");

            MobileAndroidDriver.GetScreenshot(foler, "H5");
            Assert.IsTrue(Mobile_WeChat_Utility.GetMoreItmes());
            Mobile_WeChat_Utility.BackButtonClick();
        }
Beispiel #18
0
        public void ChitChatSkill_Star_Arena()
        {
            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.ClearAllRecord();
            Mobile_WeChat_Utility.SendMessage("韩寒和小四谁更火");
            Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("郭敬明"));

            Utility.TurnOff();
            Thread.Sleep(60 * 1000);
            Mobile_WeChat_Utility.ClearAllRecord();
            Mobile_WeChat_Utility.SendMessage("韩寒和小四谁更火");
            Thread.Sleep(60 * 1000);
            Mobile_WeChat_Utility.ClearAllRecord();
            Mobile_WeChat_Utility.SendMessage("韩寒和小四谁更火");
            Assert.IsTrue(!Mobile_WeChat_Utility.GetLatestMessage("郭敬明"));
        }
        public void AddOneLevelMenu_Link()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\添加一级菜单_链接");

            MenuPage.AddMenu("一级菜单");
            MenuPage.AddMenu_Link_Wait("https://www.google.com");

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.ClickFirstLevelMenu("一级菜单");
            MobileAndroidDriver.GetScreenshot(filePath, "是否能成功添加一个一级菜单;在一级菜单里是否能成功设置一个跳转网页;是否能够成功删除所有菜单,点击界面下方的”删除”按钮");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerName("Google"));

            filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\是否能够成功删除所有菜单,点击界面下方的”删除”按钮");
            MenuPage.DeleteMenuItem();
            Assert.IsFalse(Utility.IsAt(MenuElement.addedMenu, "一级菜单"));
        }
Beispiel #20
0
        public void ChitChatSkill_Weather_Sun()
        {
            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.ClearAllRecord();
            Mobile_WeChat_Utility.SendMessage("北京天气");
            Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("℃"));

            Utility.TurnOff();
            Thread.Sleep(60 * 1000);
            Mobile_WeChat_Utility.ClearAllRecord();
            Mobile_WeChat_Utility.SendMessage("北京天气");
            Thread.Sleep(60 * 1000);
            Mobile_WeChat_Utility.ClearAllRecord();
            Mobile_WeChat_Utility.SendMessage("北京天气");
            Assert.IsTrue(!Mobile_WeChat_Utility.GetLatestMessage("℃"));
        }
        public void Is_Big_MsgTip_Show_InHiWin()
        {
            //Portal确保HI是Turn on的状态
            WeChatManagermentPage.GoToHIPage();
            HIPage.TurnOnSetup();
            HIPage.HiChatPoartal();

            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            //H5呼叫客服
            Mobile_WeChat_Utility.GetHiCard("客服");
            //H5用户发送消息
            Mobile_WeChat_Utility.XB_SendMessage("这里是测试账号");
            PortalChromeDriver.CreateFolder(@"HI\62.是否可以显示大红点,当停留在'对话窗口'页面");
            MobileAndroidDriver.GetScreenshot(foler, "客户H5发消息");
            Mobile_WeChat_Utility.BackButtonClick();
            PortalChromeDriver.TakeScreenShot(foler, "62.是否可以显示大红点,当停留在'对话窗口'页面");
            Assert.IsFalse(HIPage.Is_Big_New_Msg_Tip());
        }
        public void Portal_H5_Chat()
        {
            //Portal确保HI是Turn on的状态
            WeChatManagermentPage.GoToHIPage();
            HIPage.TurnOnSetup();
            HIPage.OpenHiChatWindow();
            HIPage.GetTestUserFromUserList();

            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.GetHiCard("客服");
            Mobile_WeChat_Utility.XB_SendMessage("我是客户");
            //验证能否收到H5客户端的消息
            HIPage.OpenHiChatWindow();
            string foler = PortalChromeDriver.CreateFolder(@"HI\H5.7.在H5对话窗口, 是否可以发送消息");

            MobileAndroidDriver.GetScreenshot(foler, "H5发送消息");
            Assert.IsTrue(HIPage.Can_ReceiveMesageFromMobile());

            Thread.Sleep(2 * 1000);
            HIPage.SendMessage("我是客服");
            Thread.Sleep(2 * 1000);
            //验证能否收到Portal客服端的消息
            foler = PortalChromeDriver.CreateFolder(@"HI\H5.9.用户在H5对话窗口时,是否可以收到客服回复的消息");
            MobileAndroidDriver.GetScreenshot(foler, "H5");
            Assert.IsTrue(Mobile_WeChat_Utility.GetMessage("我是客服"));

            //验证H5端在未退出当前窗口时,是否会收到客服回复的card
            foler = PortalChromeDriver.CreateFolder(@"HI\H5.10.是否可以收到一条新的客服回复的card,当用户没有退出当前H5对话窗口时");
            MobileAndroidDriver.GetScreenshot(foler, "H5");
            Assert.IsFalse(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.ReplyCardFromHI));
            //验证H5端发送图片
            Mobile_WeChat_Utility.XB_SendPhotoFromFile("mmexport1482395212867.jpg");
            PortalChromeDriver.Wait(TimeSpan.FromSeconds(5));
            Assert.IsTrue(HIPage.Can_ReceiveImageFromMobile());
            //Portal发送图片
            HIPage.SendImage();
            Mobile_WeChat_Utility.GetImageMessage(false);
            foler = PortalChromeDriver.CreateFolder(@"HI\H5.21.发送和接受的图片是否可以可以点击放大");
            MobileAndroidDriver.GetScreenshot(foler, "H5");
            Assert.IsTrue(Mobile_WeChat_Utility.GetMagnifyImage());
            Mobile_WeChat_Utility.BackButtonClick();
        }
        public void AddOneLevelMenu_Video()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\添加一级菜单_视频");

            MenuPage.AddMenu("一级视频");
            MenuPage.AddMenu_Video();
            Thread.Sleep(300 * 1000);
            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.ClickFirstLevelMenu("一级视频");
            Thread.Sleep(5 * 1000);
            MobileAndroidDriver.GetScreenshot(filePath, "添加一级菜单_视频");
            Assert.IsTrue((Mobile_WeChat_Utility.GetLatestMessageWithMenu().Text.Contains("测试视频11")));

            filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\删除已添加的视频");
            MenuPage.Delete();
            Thread.Sleep(1 * 1000);
            Assert.IsTrue(Utility.IsAt(MenuElement.Notification, "菜单项不能为空"));
            MobileAndroidDriver.GetScreenshot(filePath, "删除已添加的视频");
        }
Beispiel #24
0
        public void Rule_Add_Response_Emoj()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\添加表情回复");

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

            regulationTextes.Clear();
            regulationTextes.SendKeys("我是rule");
            AutoReplyPage.AddTrigger("trigger", 1 + "");
            AutoReplyPage.AddEmoj();
            PortalChromeDriver.TakeScreenShot(filePath, "添加表情回复");
            Assert.IsTrue(PortalChromeDriver.GetElementByXpath(AutoReplyElement.Emoj).GetAttribute("title") == "微笑");

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.SendMessageWithMenu("trigger");
            MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配");
            Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("[平台测试账号2] 说:"));
        }
Beispiel #25
0
        public void Rule_Add_Response_href_script()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自动回复\回复为超链接和脚本");

            AutoReplyPage.AddAutoReply("A", "A", "<a href='http://bing.com'>必应</a>");
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.ReplyContent.Replace("[{0}]", "[" + 1 + "]"), "http://bing.com"));
            AutoReplyPage.AddAutoReply("B", "B", "<script>alert(“123”);</script>");
            Assert.IsTrue(Utility.IsAt(AutoReplyElement.ReplyContent.Replace("[{0}]", "[" + 1 + "]"), "<script>alert(“123”);</script>"));

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.ClearAllRecord();
            Mobile_WeChat_Utility.SendMessageWithMenu("A");
            PortalChromeDriver.TakeScreenShot(filePath, "关键词为超链接");
            Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("必应"));
            Mobile_WeChat_Utility.ClearAllRecord();
            Mobile_WeChat_Utility.SendMessageWithMenu("B");
            PortalChromeDriver.TakeScreenShot(filePath, "关键词为脚本");
            Assert.IsTrue(Mobile_WeChat_Utility.GetLatestMessage("<script>alert(“123”);</script>"));
        }
        public void TriggerHICardPerCustomize()
        {
            //Portal确保HI是Turn on的状态
            WeChatManagermentPage.GoToHIPage();
            HIPage.TurnOnSetup();
            #region 添加一条触发关键词
            HIPage.ClearTriggers();
            HIPage.InputTrigger("hi");
            PortalChromeDriver.Wait(TimeSpan.FromSeconds(2));
            #endregion

            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.ClearAllRecord();
            //H5呼叫客服

            Mobile_WeChat_Utility.SendMessage("hi");
            Thread.Sleep(5 * 1000);
            string foler = PortalChromeDriver.CreateFolder(@"HI\H5.1.功能开启后,在公众号里是否能触发人工客服card");
            MobileAndroidDriver.GetScreenshot(foler, "H5");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.HiCardXpath));

            HIPage.ClearTriggers();
            Mobile_WeChat_Utility.ClearAllRecord();

            Thread.Sleep(5 * 1000);
            //H5呼叫客服
            Mobile_WeChat_Utility.SendMessage("hi");
            Thread.Sleep(5 * 1000);
            foler = PortalChromeDriver.CreateFolder(@"HI\H5.2.删除设置的关键词,是否还能触发人工客服card");
            MobileAndroidDriver.GetScreenshot(foler, "H5.2.删除设置的关键词,是否还能触发人工客服card");
            Assert.IsFalse(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.HiCardXpath));

            Mobile_WeChat_Utility.ClearAllRecord();
            //H5呼叫客服
            Mobile_WeChat_Utility.SendMessage("客服");
            Thread.Sleep(5 * 1000);
            foler = PortalChromeDriver.CreateFolder(@"HI\H5.3.是否可以触发人工客服card,当输入含有找客服意向的语句");
            MobileAndroidDriver.GetScreenshot(foler, "H5.3.是否可以触发人工客服card,当输入含有找客服意向的语句");
            Assert.IsTrue(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.HiCardXpath));
        }
        public void IsHICardAvailableAfterHITurnOff()
        {
            //Portal确保HI是Turn on的状态
            WeChatManagermentPage.GoToHIPage();
            HIPage.TurnOnSetup();
            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            //清空聊天记录
            Mobile_WeChat_Utility.ClearAllRecord();
            //H5呼叫客服
            Mobile_WeChat_Utility.SendMessage("客服");
            //关闭HI
            Utility.TurnOff();
            Mobile_WeChat_Utility.ClickHICard();
            string foler = PortalChromeDriver.CreateFolder(@"HI\H5.23.人工客服功能关闭,是否可以打开H5对话窗口");

            MobileAndroidDriver.GetScreenshot(foler, "H5");
            //Assert.IsTrue(HIMobileH5.IsAtPerXpath(HIMobileH5Element.HIOffError));
            Assert.IsFalse(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.HiCardXpath));
            Mobile_WeChat_Utility.BackButtonClick();
        }
        public void AddOneLevelMenu_Image()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\添加一级菜单——文本");

            MenuPage.AddMenu("一级图片");
            MenuPage.AddMenu_Image();

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.ClearAllRecord();
            Mobile_WeChat_Utility.ClickFirstLevelMenu("一级图片");
            Thread.Sleep(5 * 1000);
            MobileAndroidDriver.GetScreenshot(filePath, "添加一级菜单");
            Assert.IsTrue(MobileAndroidDriver.IsAt("//android.widget.FrameLayout[contains(@resource-id,'com.tencent.mm:id/a4w')]", ""));

            filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\删除已添加的图片");
            MenuPage.Delete();
            Thread.Sleep(1 * 1000);
            Assert.IsTrue(Utility.IsAt(MenuElement.Notification, "菜单项不能为空"));
            MobileAndroidDriver.GetScreenshot(filePath, "删除已添加的图片");
        }
        public void TriggerHiCardPerHITurnOFF()
        {
            //Portal确保HI是Turn on的状态
            WeChatManagermentPage.GoToHIPage();
            HIPage.TurnOnSetup();

            #region
            HIPage.InputTrigger("Hi");
            PortalChromeDriver.Wait(TimeSpan.FromSeconds(5));
            #endregion
            Utility.TurnOff();

            //H5页面进入平台测试账号对话窗口
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.ClearAllRecord();
            //H5呼叫客服
            Mobile_WeChat_Utility.SendMessage("Hi");
            string foler = PortalChromeDriver.CreateFolder(@"HI\H5.5.功能关闭后,在公众号里能否触发人工客服card");
            MobileAndroidDriver.GetScreenshot(foler, "H5");
            Assert.IsFalse(Mobile_WeChat_Utility.IsAt(HIMobileH5Element.xb_chatwith_texttest));
        }
        public void AddOneLevelMenu_Audio()
        {
            string filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\添加一级菜单_语音");

            MenuPage.AddMenu("一级语音");
            MenuPage.AddMenu_Audio();

            MobileAndroidDriver.AndroidInitialize();
            Mobile_WeChat_Utility.GetToTestAccount();
            Mobile_WeChat_Utility.ClearAllRecord();
            Mobile_WeChat_Utility.ClickFirstLevelMenu("一级语音");
            Thread.Sleep(5 * 1000);
            MobileAndroidDriver.GetScreenshot(filePath, "添加一级菜单_语音");
            Assert.IsTrue(Mobile_WeChat_Utility.GetAudioMessage());

            filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\删除已添加的语音");
            MenuPage.Delete();
            Thread.Sleep(1 * 1000);
            Assert.IsTrue(Utility.IsAt(MenuElement.Notification, "菜单项不能为空"));
            MobileAndroidDriver.GetScreenshot(filePath, "删除已添加的语音");
        }