Exemple #1
0
		public void DeleteModule(Dictionary<string, Modules.ModuleIDs> modulesDescription, string pageName, string moduleName,
													   string location)
		{
			var module = new Modules(_driver);

			string moduleNameOnPage = modulesDescription[moduleName].IdWhenOnPage;
			string locationOnPage = Modules.LocationDescription[location].IdWhenOnPage;

			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Delete the Module'");

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

			string moduleNumber =
				module.WaitForElement(By.XPath(locationOnPage + moduleNameOnPage + "/a")).GetAttribute("name");

			module.DeleteModule(moduleNumber);

			blankPage.OpenUsingUrl(_baseUrl, pageName);
			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the module " + moduleNumber + " deleted");
			Assert.IsFalse(module.ElementPresent(By.XPath(locationOnPage + moduleNameOnPage + "/a[@name = '" + moduleNumber + "']")),
						   "The Module is not deleted correctly");
		}
Exemple #2
0
		public void Test004_DeleteModule()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Delete the Module'");

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

			var module = new Modules(_driver);
			Trace.WriteLine(BasePage.TraceLevelElement + "Find the Module number:");
			string moduleNumber =
				module.WaitForElement(By.XPath(Modules.LocationDescription["LeftPane"].IdWhenOnPage + Modules.CommonModulesDescription["HtmlModule"].IdWhenOnPage + "/a")).GetAttribute("name");
			module.DeleteModule(moduleNumber);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the module " + moduleNumber + " deleted");
			Assert.IsFalse(module.ElementPresent(By.XPath("//div[contains(@class, 'DNN_HTML DnnModule-" + moduleNumber + "')]")),
						   "The Module is not deleted correctly");
		}