示例#1
0
		public void AddModuleToContentPaneOnNewPage(Dictionary<string, Modules.ModuleIDs> modulesDescription, string pageName, string moduleName, string location)
		{
			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 + "'Add a new Module'");

			var blankPage = new BlankPage(_driver);
			blankPage.OpenUsingUrl(_baseUrl, pageName);

			module.OpenModulePanelUsingControlPanel();
			module.AddNewModuleUsingMenu(moduleNameOnBanner, moduleNameOnPage, location);
			string moduleNumber =
				blankPage.WaitForElement(By.XPath(locationOnPage + "/div[last()]/a")).GetAttribute("name");

			blankPage.CloseEditMode();

			blankPage.OpenUsingUrl(_baseUrl, pageName);
			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Module location: " + location + moduleName);
			Assert.IsTrue(
				blankPage.ElementPresent(By.XPath(locationOnPage + moduleNameOnPage + "/a[@name='" + moduleNumber + "']")),
				"Module is not found");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Edit Mode is closed: ");
			Assert.IsFalse(
				blankPage.ElementPresent(By.XPath(ControlPanelIDs.PageInEditMode)),
				"The Edit Mode is not closed");
		}
示例#2
0
		public void AddModule(string pageName, Dictionary<string, Modules.ModuleIDs> modulesDescription, string moduleName, string pane)
		{
			Trace.WriteLine(BasePage.TraceLevelComposite + "Add a new Module to Page: '");

			var blankPage = new BlankPage(_driver);
			blankPage.OpenUsingUrl(_baseUrl, pageName);
			
			var module = new Modules(_driver);
			string moduleNameOnPage = modulesDescription[moduleName].IdWhenOnPage;
			string moduleNameOnBanner = modulesDescription[moduleName].IdWhenOnBanner;

			module.OpenModulePanelUsingControlPanel();
			module.AddNewModuleUsingMenu(moduleNameOnBanner, moduleNameOnPage, pane);

			blankPage.CloseEditMode();
		}