Esempio n. 1
0
		public void Test003_EditModuleSettings()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Edit Module settings'");

			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.ChangeModuleTitle(moduleNumber, _moduleTitle);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT a new Module Title is present on the page");
			StringAssert.Contains(_moduleTitle.ToUpper(),
								  blankPage.WaitForElement(
									  By.XPath("//div[contains(@class, 'DNN_HTML DnnModule-" + moduleNumber +
											   "')]" + ControlPanelIDs.PageTitleID)).Text.ToUpper(),
								  "The  new Module Title is not saved correctly");
		}
Esempio n. 2
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");
		}
Esempio n. 3
0
		public void AddExistingModuleWithCopy(Dictionary<string, Modules.ModuleIDs> modulesDescription, string pageName)
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add Existing Module, Make a Copy'");

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

			var module = new Modules(_driver);
			module.OpenExistingModulePanelUsingControlPanel();

			string moduleNameOnPage = modulesDescription["ContactUsModule"].IdWhenOnPage;
			string moduleNameOnBanner = modulesDescription["ContactUsModule"].IdWhenOnBanner;
			string locationOnPage = Modules.LocationDescription["ContentPane"].IdWhenOnPage;

			blankPage.FolderSelectByValue(By.XPath(Modules.PageDropDownId), "Home");
			blankPage.WaitForElement(By.XPath(Modules.List + "[1]"));
			blankPage.CheckBoxCheck(By.XPath(Modules.MakeACopyCheckbox));

			module.AddNewModuleUsingMenu(moduleNameOnBanner, moduleNameOnPage, "ContentPane");
			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");
		}
Esempio n. 4
0
		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");
		}
Esempio n. 5
0
		public void DragAndDropModuleToLeftPane(Dictionary<string, Modules.ModuleIDs> modulesDescription, string pageName, string moduleName, string newLocation)
		{
			var module = new Modules(_driver);

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

			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Drag and drop a Module'");

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

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

			blankPage.OpenUsingUrl(_baseUrl, pageName);
			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Module new location: " + locationOnPage + moduleNameOnPage);
			Assert.IsTrue(blankPage.ElementPresent(By.XPath(locationOnPage + moduleNameOnPage)), "Module is not found");
		}
Esempio n. 6
0
		public void MoveHTMLModuleWithinContentPaneDown(string moduleIdOnPage, string pageName)
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Move a HTML Module DOWN'");

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

			string contentPaneOnPage = Modules.LocationDescription["ContentPane"].IdWhenOnPage;

			var module = new Modules(_driver);
			module.SetPageToEditMode();
			string moduleNumber1 = blankPage.WaitForElement(By.XPath(contentPaneOnPage + "/div[contains(@class, 'DnnModule')][1]/a")).GetAttribute("name");
			string moduleNumber2 = blankPage.WaitForElement(By.XPath(contentPaneOnPage + "/div[contains(@class, 'DnnModule')][2]/a")).GetAttribute("name");
			string moduleNumber3 = blankPage.WaitForElement(By.XPath(contentPaneOnPage + "/div[contains(@class, 'DnnModule')][3]/a")).GetAttribute("name");
			string moduleNumber4 = blankPage.WaitForElement(By.XPath(contentPaneOnPage + "/div[contains(@class, 'DnnModule')][4]/a")).GetAttribute("name");

			module.MoveModuleUsingMenu(moduleNumber2, moduleIdOnPage, "Down");

			Assert.That(blankPage.WaitForElement(By.XPath(contentPaneOnPage + "/div[contains(@class, 'DnnModule')][1]/a")).GetAttribute("name"),
						Is.EqualTo(moduleNumber1), "Module is not found");
			Assert.That(blankPage.WaitForElement(By.XPath(contentPaneOnPage + "/div[contains(@class, 'DnnModule')][2]/a")).GetAttribute("name"),
						Is.EqualTo(moduleNumber3), "Module is not found");
			Assert.That(blankPage.WaitForElement(By.XPath(contentPaneOnPage + "/div[contains(@class, 'DnnModule')][3]/a")).GetAttribute("name"),
						Is.EqualTo(moduleNumber2), "Module is not found");
			Assert.That(blankPage.WaitForElement(By.XPath(contentPaneOnPage + "/div[contains(@class, 'DnnModule')][4]/a")).GetAttribute("name"),
						Is.EqualTo(moduleNumber4), "Module is not found");
		}
Esempio n. 7
0
		public void Test008_EditHostPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Edit a Host Page'");

			var adminPageManagementPage = new AdminPageManagementPage(_driver);
			adminPageManagementPage.OpenUsingButtons(_baseUrl);

			adminPageManagementPage.AddDescriptionToPage(_pageName, _pageDescription, AdminPageManagementPage.PageType.Host);

			var blankPage = new BlankPage(_driver);
			blankPage.OpenUsingUrl(_baseUrl, "Host/" + _addHostAfter + "/" + _pageName);
			blankPage.SelectMenuOption(ControlPanelIDs.ControlPanelEditPageOption, ControlPanelIDs.PageSettingsOption);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page description: " + _pageName1 + "is saved correctly");
			Assert.That(_pageDescription, Is.EqualTo(blankPage.WaitForElement(By.XPath(BlankPage.PageDescriptionTextBox)).Text),
			            "The page description is not added correctly");
		}