public void Test001_AddModule() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Module'"); BlankPage blankPage = new BlankPage(_driver); blankPage.OpenUsingUrl(_baseUrl, _pageName); Modules module = new Modules(_driver); module.OpenModulePanelUsingControlPanel(); module.AddNewModuleUsingDragAndDrop(Modules.HtmlProModule, Modules.HtmlProModuleOnPage, Modules.LeftPaneID); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Module location: " + Modules.LeftPaneID + Modules.HtmlProModuleOnPage); Assert.IsTrue(blankPage.ElementPresent(By.XPath(Modules.LeftPaneID + Modules.HtmlProModuleOnPage)), "Module is not found"); }
public void Test0010_DragAngDropHTMLModulesToAllPanesOnPage(string pageName, string moduleName, string moduleNameOnPage, string locationID) { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Drag & Drop HTML Module'"); Modules module = new Modules(_driver); var fiModuleName = module.GetType().GetField(moduleName); moduleName = (string)fiModuleName.GetValue(null); var fiModuleNameOnPage = module.GetType().GetField(moduleNameOnPage); moduleNameOnPage = (string)fiModuleNameOnPage.GetValue(null); var fiLocationID = module.GetType().GetField(locationID); locationID = (string)fiLocationID.GetValue(null); Trace.WriteLine(BasePage.RunningTestKeyWord + "'Drag And Drop a new Module'"); BlankPage blankPage = new BlankPage(_driver); blankPage.OpenUsingUrl(_baseUrl, pageName); module.OpenModulePanelUsingControlPanel(); module.AddNewModuleUsingDragAndDrop(moduleName, moduleNameOnPage, locationID); string moduleNumber = blankPage.WaitForElement(By.XPath(locationID + "/div[last()]/a")).GetAttribute("name"); blankPage.OpenUsingUrl(_baseUrl, pageName); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Module location: " + locationID + moduleNameOnPage); Assert.IsTrue(blankPage.ElementPresent(By.XPath(locationID + moduleNameOnPage + "/a[@name='" + moduleNumber + "']")), "Module is not found"); }
public void Test0013_AddExistingModuleWithCopy(string pageName) { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add Existing Module, Make a Copy'"); BlankPage blankPage = new BlankPage(_driver); blankPage.OpenUsingUrl(_baseUrl, pageName); Modules module = new Modules(_driver); module.OpenExistingModulePanelUsingControlPanel(); blankPage.LoadableSelectByValue(By.XPath(Modules.PageDropDownId), "Home"); blankPage.WaitForElement(By.XPath(Modules.List + "[1]")); blankPage.CheckBoxCheck(By.XPath(Modules.MakeACopyCheckbox)); module.AddNewModuleUsingMenu(Modules.ContactUsModule, Modules.HtmlProModuleOnPage, Modules.ContentPaneOption, Modules.ContentPaneID); string moduleNumber = blankPage.WaitForElement(By.XPath(Modules.ContentPaneID + "/div[last()]/a")).GetAttribute("name"); blankPage.OpenUsingUrl(_baseUrl, pageName); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Module location: " + Modules.ContentPaneID + Modules.ContactUsModule); Assert.IsTrue(blankPage.ElementPresent(By.XPath(Modules.ContentPaneID + Modules.HtmlProModuleOnPage + "/a[@name='" + moduleNumber + "']")), "Module is not found"); }
public void Test008_DragAndDropModuleToLeftPane(string pageName, string moduleNameOnPage, string newLocationID) { Modules module = new Modules(_driver); var fiModuleNameOnPage = module.GetType().GetField(moduleNameOnPage); moduleNameOnPage = (string)fiModuleNameOnPage.GetValue(null); var fiNewLocationID = module.GetType().GetField(newLocationID); newLocationID = (string)fiNewLocationID.GetValue(null); Trace.WriteLine(BasePage.RunningTestKeyWord + "'Drag and drop a Module'"); BlankPage blankPage = new BlankPage(_driver); blankPage.OpenUsingUrl(_baseUrl, pageName); blankPage.SetPageToEditMode(pageName); string moduleNumber = blankPage.WaitForElement(By.XPath(moduleNameOnPage + "/a")).GetAttribute("name"); module.MoveModuleUsingDragAndDrop(moduleNumber, moduleNameOnPage, newLocationID); blankPage.OpenUsingUrl(_baseUrl, pageName); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Module new location: " + newLocationID + moduleNameOnPage); Assert.IsTrue(blankPage.ElementPresent(By.XPath(newLocationID + moduleNameOnPage)), "Module is not found"); }