예제 #1
0
		public void Test005_EditModuleSettings()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Edit Module settings'");

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

			Modules module = new Modules(_driver);

			Trace.WriteLine(BasePage.TraceLevelElement + "Find the Module number:");
			string moduleNumber = module.WaitForElement(By.XPath(Modules.LeftPaneID + Modules.HtmlProModuleOnPage + "/a")).GetAttribute("name");
			module.EditModuleSettings(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 + "')]//span[contains(@id, '" + BasePage.PageTitle + "')]")).Text.ToUpper(),
						"The  new Module Title is not saved correctly");
		}
예제 #2
0
		public void Test0013_AddExistingModuleWithCopy(string pageName)
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add Existing Module, Make a Copy'");

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

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

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

			module.AddNewModuleUsingMenu(Modules.ContactUsModule, Modules.HtmlProModuleOnPage, Modules.ContentPaneOption, Modules.ContentPaneID);
			string moduleNumber = blankPage.WaitForElement(By.XPath(Modules.ContentPaneID + "/div[last()]/a")).GetAttribute("name");

			blankPage.OpenUsingUrl(_baseUrl, pageName);
			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Module location: " + Modules.ContentPaneID + Modules.ContactUsModule);
			Assert.IsTrue(blankPage.ElementPresent(By.XPath(Modules.ContentPaneID + Modules.HtmlProModuleOnPage + "/a[@name='" + moduleNumber + "']")), "Module is not found");
		}
예제 #3
0
		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");
		}
예제 #4
0
		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");
		}
예제 #5
0
		public void Test0064_MoveHTMLModuleWithinContentPaneDown(string pageName)
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Move a HTML Module DOWN'");

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

			Modules module = new Modules(_driver);
			module.SetPageToEditMode(pageName);
			string moduleNumber1 = blankPage.WaitForElement(By.XPath(Modules.ContentPaneID + "/div[2]/a")).GetAttribute("name");
			string moduleNumber2 = blankPage.WaitForElement(By.XPath(Modules.ContentPaneID + "/div[3]/a")).GetAttribute("name");
			string moduleNumber3 = blankPage.WaitForElement(By.XPath(Modules.ContentPaneID + "/div[4]/a")).GetAttribute("name");
			string moduleNumber4 = blankPage.WaitForElement(By.XPath(Modules.ContentPaneID + "/div[5]/a")).GetAttribute("name");

			module.MoveModuleUsingMenu(moduleNumber2, Modules.HtmlProModuleOnPage, Modules.DownOption);

			Assert.That(blankPage.WaitForElement(By.XPath(Modules.ContentPaneID + "/div[2]/a")).GetAttribute("name"), Is.EqualTo(moduleNumber1), "Module is not found");
			Assert.That(blankPage.WaitForElement(By.XPath(Modules.ContentPaneID + "/div[3]/a")).GetAttribute("name"), Is.EqualTo(moduleNumber3), "Module is not found");
			Assert.That(blankPage.WaitForElement(By.XPath(Modules.ContentPaneID + "/div[4]/a")).GetAttribute("name"), Is.EqualTo(moduleNumber2), "Module is not found");
			Assert.That(blankPage.WaitForElement(By.XPath(Modules.ContentPaneID + "/div[5]/a")).GetAttribute("name"), Is.EqualTo(moduleNumber4), "Module is not found");
		}
예제 #6
0
		public void Test008_EditHostPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Edit a Host Page'");

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

			adminPageManagementPage.AddDescriptionToPage(_pageName, _pageDescription, "Host");

			BlankPage blankPage = new BlankPage(_driver);
			blankPage.OpenUsingUrl(_baseUrl, "Host/" + _addHostAfter + "/" + _pageName);
			blankPage.SelectMenuOption(BasePage.ControlPanelEditPageOption, BasePage.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");
		}