public void IntiMomentsSnapshot() { WeChatManagermentPage.GoTo_AutoReply_Page(); PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply); AutoReplyPage.TurnOnAutoReply(); AutoReplyPage.ClearReply(); }
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(); }
public void EditReply_AutoReply_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\编辑关键词回复"); WeChatManagermentPage.GoTo_AutoReply_Page(); PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply); AutoReplyPage.TurnOnAutoReply(); AutoReplyPage.ClearReply(); 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_Weibo(); Mobile_Weibo_Utility.Follow(); Mobile_Weibo_Utility.ClearAllMessage(); Mobile_Weibo_Utility.SendMessage("修改的Trigger"); MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配"); Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerName("[啊_荀] 说:修改的Reply")); }
public void IntiFaceRanking() { WeChatManagermentPage.GoToCS_Skill_Page(); FaceRankingPage.ClickFaceRanking(); Utility.TurnOn(); WeChatManagermentPage.GoTo_Menu_Page_FaceRanking(); if (!Utility.IsAt(MenuElement.FaceRankingMenu, "拼颜值")) { MenuPage.DeleteMenuItem(); WeChatManagermentPage.GoToCS_Skill_Page(); FaceRankingPage.ClickFaceRanking(); string link = FaceRankingPage.CopyLink(); FaceRankingPage.CopyAlertConfirm(); WeChatManagermentPage.GoTo_Menu_Page_FaceRanking(); MenuPage.AddMenu("拼颜值"); MenuPage.AddMenu_Link_Wait(link); WeChatManagermentPage.GoToCS_Skill_Page(); FaceRankingPage.ClickFaceRanking(); } else { WeChatManagermentPage.GoToCS_Skill_Page(); FaceRankingPage.ClickFaceRanking(); } }
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("客服接入成功")); }
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 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 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 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触发关键词应优先"); }
public void TurnOff_AutoReply_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\关键词自动回复Mobile可用"); WeChatManagermentPage.GoTo_AutoReply_Page(); PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply); AutoReplyPage.TurnOnAutoReply(); AutoReplyPage.ClearReply(); AutoReplyPage.AddAutoReply("A", "怎么办", "我是美女"); MobileAndroidDriver.AndroidInitialize_Weibo(); Mobile_Weibo_Utility.Follow(); Mobile_Weibo_Utility.ClearAllMessage(); Mobile_Weibo_Utility.SendMessage("怎么办"); MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配"); Assert.IsTrue(Mobile_WeChat_Utility.IsAtPerName("[啊_荀] 说:我是美女")); filePath = PortalChromeDriver.CreateFolder(@"自动回复\停用关键词回复Mobile无关键词回复"); AutoReplyPage.TurnOffAutoReply(); Mobile_WeChat_Utility.BackButtonClick(); Mobile_Weibo_Utility.ClearAllMessage(); Mobile_WeChat_Utility.SendMessage("怎么办"); Thread.Sleep(2 * 1000); MobileAndroidDriver.GetScreenshot(filePath, "停用关键词回复Mobile无关键词回复"); Assert.IsFalse(Mobile_WeChat_Utility.IsAtPerName("[啊_荀] 说:[我是美女]")); }
public void Rule_Add_Response_Emoj_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\添加表情回复"); 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("我是trigger", 1 + ""); AutoReplyPage.AddEmoj(); PortalChromeDriver.TakeScreenShot(filePath, "添加表情回复"); Assert.IsTrue(PortalChromeDriver.GetElementByXpath(AutoReplyElement.Emoj).GetAttribute("title") == "发红包啦"); MobileAndroidDriver.AndroidInitialize_Weibo(); Mobile_Weibo_Utility.Follow(); Mobile_Weibo_Utility.ClearAllMessage(); Mobile_Weibo_Utility.SendMessage("我是trigger"); MobileAndroidDriver.GetScreenshot(filePath, "添加表情回复"); Assert.IsTrue(Mobile_Weibo_Utility.GetLatestMessage().Text.Contains("[啊_荀] 说:")); }
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")); }
public void Menu_NoMaterial_Tips() { string filePath = PortalChromeDriver.CreateFolder(@"自定义菜单\素材库没有素材,是否提示去微信后台添加"); PortalChromeDriver.ClickElementPerXpath(MenuElement.Account_Arrow_Down); Thread.Sleep(5 * 1000); PortalChromeDriver.ClickElementPerXpath(MenuElement.Logout); LoginPage.LoginWithPhoneNumber("13269120258"); Thread.Sleep(10 * 1000); MobileAndroidDriver.AndroidMmsInitialize(); Mobile_WeChat_Utility.GetLoginCode(); HomePage.ClickWeChatApp("不是衣橱的海南"); WeChatManagermentPage.GoTo_Menu_Page(); MenuPage.DeleteMenuItem(); MenuPage.AddMenu("1"); PortalChromeDriver.ClickElementPerXpath(MenuElement.Send_Message); PortalChromeDriver.ClickElementPerXpath(MenuElement.tabNews); PortalChromeDriver.ClickElementPerXpath(MenuElement.ImageChoose); //PortalChromeDriver.TakeScreenShot(filePath, "素材库没有素材,是否提示去微信后台添加"); Thread.Sleep(2 * 1000); Assert.IsTrue(Utility.IsAt(MenuElement.NoMaterial_Tip, "没有同步到素材,请去往微信后台添加。新添加素材最多需15分钟同步到本地。")); //Assert.IsTrue(PortalChromeDriver.GetElementByClassName("menu_button menu_highlight").Text=="1"); }
public void IntiFaceRanking() { try { PortalChromeDriver.ClickElementPerXpath(DocChatElement.CS_SKills_Weibo); FaceRankingPage.ClickFaceRanking(); Utility.TurnOn(); WeChatManagermentPage.GoTo_Menu_Page_FaceRanking(); if (!Utility.IsAt(MenuElement.FaceRankingMenu, "拼颜值")) { MenuPage.DeleteMenuItem(); PortalChromeDriver.ClickElementPerXpath(DocChatElement.CS_SKills_Weibo); FaceRankingPage.ClickFaceRanking(); string link = FaceRankingPage.CopyLink(); FaceRankingPage.CopyAlertConfirm(); WeChatManagermentPage.GoTo_Menu_Page_FaceRanking(); MenuPage.AddMenu("拼颜值"); MenuPage.AddMenu_Link_Wait(link); PortalChromeDriver.ClickElementPerXpath(DocChatElement.CS_SKills_Weibo); FaceRankingPage.ClickFaceRanking(); } else { PortalChromeDriver.ClickElementPerXpath(DocChatElement.CS_SKills_Weibo); FaceRankingPage.ClickFaceRanking(); } } catch (Exception e) { //PortalChromeDriver.Instance.Navigate().GoToUrl(PortalChromeDriver.BaseProductAddress); LoginPage_Weibo.AddWeiboAccount(); HomePage.ClickWeChatApp("啊_荀"); PortalChromeDriver.ClickElementPerXpath(DocChatElement.CS_SKills_Weibo); FaceRankingPage.ClickFaceRanking(); Utility.TurnOn(); WeChatManagermentPage.GoTo_Menu_Page_FaceRanking(); if (!Utility.IsAt(MenuElement.FaceRankingMenu, "拼颜值")) { MenuPage.DeleteMenuItem(); PortalChromeDriver.ClickElementPerXpath(DocChatElement.CS_SKills_Weibo); FaceRankingPage.ClickFaceRanking(); string link = FaceRankingPage.CopyLink(); FaceRankingPage.CopyAlertConfirm(); WeChatManagermentPage.GoTo_Menu_Page_FaceRanking(); MenuPage.AddMenu("拼颜值"); MenuPage.AddMenu_Link_Wait(link); PortalChromeDriver.ClickElementPerXpath(DocChatElement.CS_SKills_Weibo); FaceRankingPage.ClickFaceRanking(); } else { PortalChromeDriver.ClickElementPerXpath(DocChatElement.CS_SKills_Weibo); FaceRankingPage.ClickFaceRanking(); } } }
public void Can_secretRelationship_1_100_DiffPhoto_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"关系识别\32.只选中任一一个奖项后,上传一张跟该奖项无关的人物图片,是否会中奖(所有奖项都试一遍)"); for (int i = 1; i < 8; i++) { WeChatManagermentPage.GoToCS_Skill_Page(); SecretRelationshipPage.ClickSecretRelationship(); SecretRelationshipPage.TurnOn(); //设置奖励中奖概率 PortalChromeDriver.ClickElementPerXpath(secretRelationshipElement.RewartSetting); SecretRelationshipPage.ClearAllAward(); SecretRelationshipPage.CheckAward(secretRelationshipElement.Award.Replace("{0}", i + ""), "1", "100"); MobileAndroidDriver.AndroidInitialize_Weibo(); Mobile_Weibo_Utility.Follow(); 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; } //上传不同图片 FaceRankingMobilePage_WeChat.FaceRankingFromFile(file); 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), "奖励是否显示"); MobileAndroidDriver.androidDriver.Dispose(); } }
public void IntiSecretRelationship() { try { PortalChromeDriver.ClickElementPerXpath(DocChatElement.CS_SKills_Weibo); FaceRankingPage.ClickFaceRanking(); Utility.TurnOn(); WeChatManagermentPage.GoTo_Menu_Page_FaceRanking(); if (!Utility.IsAt(MenuElement.FaceRankingMenu, "关系识别")) { MenuPage.DeleteMenuItem(); PortalChromeDriver.ClickElementPerXpath(DocChatElement.CS_SKills_Weibo); SecretRelationshipPage.ClickSecretRelationship_Weibo(); SecretRelationshipPage.TurnOn(); string link = FaceRankingPage.CopyLink(); FaceRankingPage.CopyAlertConfirm(); WeChatManagermentPage.GoTo_Menu_Page_FaceRanking(); MenuPage.AddMenu("关系识别"); MenuPage.AddMenu_Link_Wait(link); PortalChromeDriver.ClickElementPerXpath(DocChatElement.CS_SKills_Weibo); SecretRelationshipPage.ClickSecretRelationship_Weibo(); } else { PortalChromeDriver.ClickElementPerXpath(DocChatElement.CS_SKills_Weibo); SecretRelationshipPage.ClickSecretRelationship_Weibo(); } } catch (Exception e) { LoginPage_Weibo.AddWeiboAccount(); HomePage.ClickWeChatApp("啊_荀"); PortalChromeDriver.ClickElementPerXpath(DocChatElement.CS_SKills_Weibo); FaceRankingPage.ClickFaceRanking(); Utility.TurnOn(); WeChatManagermentPage.GoTo_Menu_Page_FaceRanking(); if (!Utility.IsAt(MenuElement.FaceRankingMenu, "关系识别")) { MenuPage.DeleteMenuItem(); PortalChromeDriver.ClickElementPerXpath(DocChatElement.CS_SKills_Weibo); FaceRankingPage.ClickFaceRanking(); string link = FaceRankingPage.CopyLink(); FaceRankingPage.CopyAlertConfirm(); WeChatManagermentPage.GoTo_Menu_Page_FaceRanking(); MenuPage.AddMenu("拼颜值"); MenuPage.AddMenu_Link_Wait(link); PortalChromeDriver.ClickElementPerXpath(DocChatElement.CS_SKills_Weibo); FaceRankingPage.ClickFaceRanking(); } else { PortalChromeDriver.ClickElementPerXpath(DocChatElement.CS_SKills_Weibo); FaceRankingPage.ClickFaceRanking(); } } }
public void DeleteTrigger_AutoReply_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\删除Trigger"); WeChatManagermentPage.GoTo_AutoReply_Page(); PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply); AutoReplyPage.TurnOnAutoReply(); AutoReplyPage.ClearReply(); AutoReplyPage.AddAutoReply("A", "Hi", "第一个自动回复"); AutoReplyPage.DeleteTrigger(); PortalChromeDriver.TakeScreenShot(filePath, "删除Trigger"); Assert.IsFalse(Utility.IsAt(AutoReplyElement.TrigerContent.Replace("[{0}]", "[" + 1 + "]"), 1 + "")); }
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(); }
public void Rule_Fuzzy_Matching_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\模糊匹配"); WeChatManagermentPage.GoTo_AutoReply_Page(); PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply); AutoReplyPage.TurnOnAutoReply(); AutoReplyPage.ClearReply(); AutoReplyPage.AddAutoReply_Fuzzy_Matching("A", "abcdef", "我不是素材"); MobileAndroidDriver.AndroidInitialize_Weibo(); Mobile_Weibo_Utility.Follow(); Mobile_Weibo_Utility.ClearAllMessage(); Mobile_Weibo_Utility.SendMessage("abcdef123"); MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配"); Assert.IsTrue(Mobile_Weibo_Utility.GetLatestMessage().Text.Contains("我不是素材"));; }
public void AddText_AutoReply_BVT_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\添加关键词回复"); WeChatManagermentPage.GoTo_AutoReply_Page(); PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply); AutoReplyPage.TurnOnAutoReply(); AutoReplyPage.ClearReply(); AutoReplyPage.AddAutoReply("A", "A", "第一个自动回复"); PortalChromeDriver.TakeScreenShot(filePath, "添加关键词回复"); Assert.IsTrue(Utility.IsAt(AutoReplyElement.RuleContent, "规则1:A")); AutoReplyPage.ClearReply(); AutoReplyPage.AddAutoReply("", "A", "第一个自动回复"); PortalChromeDriver.TakeScreenShot(filePath, "规则名为空"); Assert.IsTrue(Utility.IsAt(CommonElement.notification), "规则名为空"); }
public void AutoReply_ClearAll_TurnOff_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\老用户删除所有创建的规则后,停用并且启用关键词回复功能"); WeChatManagermentPage.GoTo_AutoReply_Page(); PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply); AutoReplyPage.TurnOnAutoReply(); AutoReplyPage.ClearReply(); AutoReplyPage.TurnOffAutoReply(); 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("[啊_荀] 说:a")); }
public void Rule_Trigger_SameWith_Material_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"自动回复\如果设置关键词的内容跟素材的名称一致,优先回复关键词"); WeChatManagermentPage.GoTo_AutoReply_Page(); PortalChromeDriver.ClickElementPerXpath(AutoReplyElement.KeyWordsReply); AutoReplyPage.TurnOnAutoReply(); AutoReplyPage.ClearReply(); AutoReplyPage.AddAutoReply("A", "g", "我不是素材"); PortalChromeDriver.TakeScreenShot(filePath, "Portal如果设置关键词的内容跟素材的名称一致,优先回复关键词"); MobileAndroidDriver.AndroidInitialize_Weibo(); Mobile_Weibo_Utility.Follow(); Mobile_Weibo_Utility.ClearAllMessage(); Mobile_Weibo_Utility.SendMessage("g"); MobileAndroidDriver.GetScreenshot(filePath, "H5关键词精确匹配"); Assert.IsTrue(Mobile_Weibo_Utility.GetLatestMessage().Text.Contains("我不是素材"));; }
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 Can_ClickSetting_NonCertificate() { folder = PortalChromeDriver.CreateFolder(@"HI\1.是否能够成功切换到人工客服功能的“设置” 界面"); //Click settings PortalChromeDriver.ClickElementPerXpath(MenuElement.Account_Arrow_Down); PortalChromeDriver.ClickElementPerXpath(MenuElement.Logout); LoginPage.LoginWithPhoneNumber("13269120258"); Thread.Sleep(10 * 1000); MobileAndroidDriver.AndroidMmsInitialize(); Mobile_WeChat_Utility.GetLoginCode(); HomePage.ClickWeChatApp("不是衣橱的海南"); WeChatManagermentPage.GoToHIPage(); HIPage.ClickSettings(); PortalChromeDriver.TakeScreenShot(folder, "1.是否能够成功切换到人工客服功能的“设置” 界面"); Assert.IsTrue(Utility.IsAt(HIPortalPageUIElement.alert_disable, "抱歉!该技能只对认证号开放!"), "设置页面未成功显示"); PortalChromeDriver.ClickElementPerXpath(CommonElement.TurnOnAndOFF); Assert.IsFalse(HIPage.IsOn(), "未认证用户不能开启人工客服"); }
public void FollowedAuto_Reply_NoMaterial_Tips_Weibo() { string filePath = PortalChromeDriver.CreateFolder(@"被关注自动回复\当没有有图文素材的时候,检查图片消息界面是否显示正确"); PortalChromeDriver.ClickElementPerXpath(MenuElement.Account_Arrow_Down); PortalChromeDriver.ClickElementPerXpath(MenuElement.Logout); LoginPage.LoginWithPhoneNumber("13269120258"); Thread.Sleep(10 * 1000); MobileAndroidDriver.AndroidMmsInitialize(); Mobile_WeChat_Utility.GetLoginCode(); HomePage.ClickWeChatApp("XiaoIceTest"); WeChatManagermentPage.GoTo_AutoReply_Page(); FollowedAutoReplyPage.Delete(); PortalChromeDriver.ClickElementPerXpath(FollowedAutoReplyElement.tabnews); PortalChromeDriver.ClickElementPerXpath(FollowedAutoReplyElement.autoreply_content); Thread.Sleep(2 * 1000); Assert.IsTrue(Utility.IsAt(MenuElement.NoMaterial_Tip, "没有同步到素材,请去往微信后台添加。新添加素材最多需15分钟同步到本地。")); }
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 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")); }
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(); }