public void Test001_AddModule() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Module'"); var blankPage = new BlankPage(_driver); blankPage.OpenUsingUrl(_baseUrl, _pageName); var module = new Modules(_driver); module.OpenModulePanelUsingControlPanel(); module.AddNewModuleUsingDragAndDrop(Modules.HtmlModule, Modules.HtmlModuleOnPage, Modules.LeftPaneID); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Module location: " + Modules.LeftPaneID + Modules.HtmlModuleOnPage); Assert.IsTrue(blankPage.ElementPresent(By.XPath(Modules.LeftPaneID + Modules.HtmlModuleOnPage)), "Module is not found"); }
public void DragAngDropHTMLModulesToAllPanesOnPage(Dictionary<string, Modules.ModuleIDs> modulesDescription, string pageName, string moduleName, string location) { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Drag & Drop HTML Module'"); var module = new Modules(_driver); string moduleNameOnPage = modulesDescription[moduleName].IdWhenOnPage; string moduleNameOnBanner = modulesDescription[moduleName].IdWhenOnBanner; string locationOnPage = Modules.LocationDescription[location].IdWhenOnPage; Trace.WriteLine(BasePage.RunningTestKeyWord + "'Drag And Drop a new Module'"); var blankPage = new BlankPage(_driver); blankPage.OpenUsingUrl(_baseUrl, pageName); module.OpenModulePanelUsingControlPanel(); module.AddNewModuleUsingDragAndDrop(moduleNameOnBanner, location); string moduleNumber = blankPage.WaitForElement(By.XPath(locationOnPage + "/div[last()]/a")).GetAttribute("name"); blankPage.OpenUsingUrl(_baseUrl, pageName); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Module location: " + locationOnPage + moduleNameOnPage); Assert.IsTrue( blankPage.ElementPresent(By.XPath(locationOnPage + moduleNameOnPage + "/a[@name='" + moduleNumber + "']")), "Module is not found"); }