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 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"); }