public void Material_Article_Button() { string filePath = PortalChromeDriver.CreateFolder(@"素材管理\”设置推荐” 功能是否可用"); MaterialPage.Set_All(); PortalChromeDriver.ClickElementPerXpath(MaterialElement.Article_Button); //Assert.IsTrue(MaterialPage.IsFlaged() == 10, "”设置推荐” 功能是否可用"); Assert.IsTrue(PortalChromeDriver.GetElementsByCssSelector("div.custom_checkbox.checked").Count == 11); Thread.Sleep(5 * 1000); PortalChromeDriver.ClickElementPerXpath(MaterialElement.First_checked); Assert.IsFalse(MaterialPage.IsClickable(MaterialElement.FirstAward)); }
public void Material_Select_NoSave() { string filePath = PortalChromeDriver.CreateFolder(@"素材管理\选择多个图文推荐后没有保存,切换到其他页面,被选中的图文不会被保存"); //重置 MaterialPage.Set_All(); MaterialPage.Set_All(); PortalChromeDriver.ClickElementPerXpath(MaterialElement.Article_Button); PortalChromeDriver.ClickElementPerXpath(MaterialElement.First_checked); MaterialPage.TurnToNextPage_Input("2"); MaterialPage.TurnToNextPage_Input("1"); Assert.IsFalse(MaterialPage.IsClickablePerCssSelector("custom_checkbox")); }
public void Material_Set_All() { string filePath = PortalChromeDriver.CreateFolder(@"素材管理\“设置推荐”中的全选框只能设置当前素材页的内容"); //重置 MaterialPage.Set_All(); PortalChromeDriver.ClickElementPerXpath(MaterialElement.Article_Button); Thread.Sleep(2 * 1000); //取消全部选中 PortalChromeDriver.ClickElementPerXpath(MaterialElement.Set_All); Assert.IsFalse(MaterialPage.IsClickablePerCssSelector("custom_checkbox")); PortalChromeDriver.ClickElementPerXpath(MaterialElement.First_checked); Assert.IsTrue(Utility.IsAtPerCssSelector("div.custom_checkbox.checked")); PortalChromeDriver.ClickElementPerXpath(MaterialElement.Save_Button); MaterialPage.TurnToNextPage_Input("2"); PortalChromeDriver.ClickElementPerXpath(MaterialElement.Article_Button); Assert.IsTrue(PortalChromeDriver.GetElementsByCssSelector("div.custom_checkbox.checked").Count == 2); PortalChromeDriver.ClickElementPerXpath(MaterialElement.Save_Button); }