Beispiel #1
0
		public void LoginToSite()
		{
			XDocument doc = XDocument.Load(DataFileLocation);

			XElement settings = doc.Document.Element("Tests").Element("settings");
			XElement testSettings = doc.Document.Element("Tests").Element("modules");

			string testName = testSettings.Attribute("name").Value;

			_pageName = testSettings.Attribute("pageName").Value;
			_moduleContent = testSettings.Attribute("moduleContent").Value;

			_moduleTitle = testSettings.Attribute("moduleTitle").Value;

			_driver = StartBrowser(settings.Attribute("browser").Value);
			_baseUrl = settings.Attribute("baseURL").Value;

			Trace.WriteLine(BasePage.RunningTestKeyWord + "'" + testName + "'");
			Trace.WriteLine(BasePage.PreconditionsKeyWord);

			OpenMainPageAndLoginAsHost();

			_logContent = LogContent();

			var blankPage = new BlankPage(_driver);
			blankPage.OpenAddNewPageFrameUsingControlPanel(_baseUrl);
			blankPage.AddNewPage(_pageName);
		}
Beispiel #2
0
		public void LoginToSite()
		{
			XDocument doc = XDocument.Load(DataFileLocation);

			XElement settings = doc.Document.Element("Tests").Element("settings");
			XElement testSettings = doc.Document.Element("Tests").Element("modules");

			string testName = testSettings.Attribute("name").Value;

			_driver = StartBrowser(settings.Attribute("browser").Value);
			_baseUrl = settings.Attribute("baseURL").Value;

			Trace.WriteLine(BasePage.RunningTestKeyWord + "'" + testName + "'");
			Trace.WriteLine(BasePage.PreconditionsKeyWord);

			OpenMainPageAndLoginAsHost();

			//Create a Page
			var blankPage = new BlankPage(_driver);
			blankPage.OpenAddNewPageFrameUsingControlPanel(_baseUrl);
			blankPage.AddNewPage("page");

			//Delete Default HTML Module on page
			blankPage.OpenUsingUrl(_baseUrl,"page");
			var module = new Modules(_driver);
			Trace.WriteLine(BasePage.TraceLevelElement + "Find the Module number:");
			string moduleNumber =
				module.WaitForElement(By.XPath(Modules.LocationDescription["ContentPane"].IdWhenOnPage + Modules.CommonModulesDescription["HtmlModule"].IdWhenOnPage + "/a")).GetAttribute("name");
			module.DeleteModule(moduleNumber);

			//Export new page as Default
			var pageExportPage = new PageExportPage(_driver);
			pageExportPage.OpenUsingControlPanel(_baseUrl + "/page");
			pageExportPage.ExportPage("Default", "NewDefault");

			//Create set of pages with New Default
			var adminPageManagementPage = new AdminPageManagementPage(_driver);
			adminPageManagementPage.OpenUsingButtons(_baseUrl);
			adminPageManagementPage.AddPagesInBulk(">" + "Page", "P1Modules", 65, AdminPageManagementPage.PageType.Web, "Home");

			//Create set of pages for Drag&Drop tests with New Default
			adminPageManagementPage.OpenUsingButtons(_baseUrl);
			adminPageManagementPage.AddPagesInBulk(">" + "Page", "P1ModulesDragDrop", 65, AdminPageManagementPage.PageType.Web, "Home");
			
			//Create a page with 4 HtmlModuleDictionary Modules on page
			blankPage.OpenUsingUrl(_baseUrl, "Home/P1Modules/Page61");
			module.OpenModulePanelUsingControlPanel();
			int i = 1;
			while (i < 5)
			{
				module.AddNewModuleUsingMenu(HtmlModuleDictionary.IdWhenOnBanner, HtmlModuleDictionary.IdWhenOnPage, "ContentPane");
				i++;
			}
			
			_logContent = LogContent(); 
		}
Beispiel #3
0
		public void Test003_EditPageSettings()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Edit the Page Settings'");

			var blankPage = new BlankPage(_driver);
			blankPage.OpenUsingUrl(_baseUrl, _pageName);
			blankPage.SelectMenuOption(ControlPanelIDs.ControlPanelEditPageOption, ControlPanelIDs.PageSettingsOption);

			blankPage.EditPageTitle(_pageTitle);

			Trace.WriteLine("Verify Page title: '" + _pageTitle + "'");
			StringAssert.Contains(_pageTitle, blankPage.CurrentWindowTitle(), "The Page title is not correct");
		}
Beispiel #4
0
		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");
		}
Beispiel #5
0
		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.AddNewModuleUsingMenu(Modules.CommonModulesDescription["HtmlModule"].IdWhenOnBanner,
			                             Modules.CommonModulesDescription["HtmlModule"].IdWhenOnPage, "LeftPane");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Module location: " + Modules.LocationDescription["LeftPane"].IdWhenOnPage +
							Modules.CommonModulesDescription["HtmlModule"].IdWhenOnPage);
			Assert.IsTrue(blankPage.ElementPresent(By.XPath(Modules.LocationDescription["LeftPane"].IdWhenOnPage + Modules.CommonModulesDescription["HtmlModule"].IdWhenOnPage)),
			              "Module is not found");
		}
Beispiel #6
0
		public void Test002_EditDefaultHTMLModuleOnPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Edit Default HTML Module on the Page'");

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

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

			module.AddContentToHTMLModule(moduleNumber, _pageContent);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Module content is present on the screen");
			Assert.That(
				blankPage.FindElement(By.XPath("//div[contains(@class, 'DNN_HTML DnnModule-')]//div[contains(@id, 'lblContent')]")).
					Text, Is.EqualTo(_pageContent));
		}
Beispiel #7
0
		public void Test002_EditModule()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add content to HTML 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.LeftPaneID + Modules.HtmlModuleOnPage + "/a")).GetAttribute("name");

			module.AddContentToHTMLModule(moduleNumber, _moduleContent);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the module Content is present on the page");
			Assert.That(_moduleContent,
			            Is.EqualTo(
				            module.FindElement(
					            By.XPath("//div[contains(@class, 'DNN_HTML DnnModule-" + moduleNumber +
					                     "')]//div[contains(@id, 'lblContent')]")).Text));
		}
Beispiel #8
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");
		}
Beispiel #9
0
		public void Test001_AddPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Page'");

			var blankPage = new BlankPage(_driver);

			blankPage.OpenAddNewPageFrameUsingControlPanel(_baseUrl);

			blankPage.AddNewPage(_pageName);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the user redirected to newly created page: " + "http://" +
							_baseUrl.ToLower() + "/" + _pageName);
			Assert.That(blankPage.CurrentWindowUrl(), Is.StringStarting("http://" + _baseUrl.ToLower() + "/" + _pageName),
						"The page URL is not correct");

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

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + " is present in the list");
			Assert.IsTrue(
				adminPageManagementPage.ElementPresent(
					By.XPath("//div[contains(@id, 'Tabs_ctlPages')]//li[@class= 'rtLI']//span[contains(text(), '" + _pageName + "')]")),
				"The page is not present in the list");
		}
Beispiel #10
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");
		}
Beispiel #11
0
		public void Test004_DeletePage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Delete a Page'");

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

			blankPage.DeletePage(_pageName);

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

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is NOT present in the list");
			Assert.IsFalse(adminPageManagementPage.ElementPresent(By.XPath("//div[contains(@id, 'Tabs_ctlPages')]//li[@class= 'rtLI']//span[contains(text(), '" + _pageName + "')]")),
				"The page is present in the list");

			AdminRecycleBinPage adminRecycleBinPage = new AdminRecycleBinPage(_driver);
			adminRecycleBinPage.OpenUsingButtons(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _pageName + "is present in Recycle Bin");
			Assert.IsTrue(adminRecycleBinPage.ElementPresent(By.XPath(AdminRecycleBinPage.RecycleBinPageContainerOption + "[contains(text(), '" + _pageName + "')]")));
		}
Beispiel #12
0
		public void Test003_PrivatePostOwnerAccessToJournal()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Authorized User Access To Journal'");

			var loginPage = new LoginPage(_driver);
			loginPage.LoginUsingDirectUrl(_baseUrl, _userNameNumberTwo, _password);

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

			var module = new JournalModule(_driver);
			module.FindElement(By.XPath("//div[@id = 'journalItems']/div[last()]")).Info();

			Trace.WriteLine("ASSERT the number of Messages are correct :");
			Assert.That(module.FindElements(By.XPath("//div[@id = 'journalItems']/div")).Count, Is.EqualTo(3), "The number of Messages are incorrect");

			Trace.WriteLine("ASSERT the visibility is correct :");
			Assert.That(module.WaitForElement(By.XPath("//div[@id = 'journalItems']/div[1]//p[1]")).Text, Is.StringContaining("Everyone"),
					 "The wrong message is shown");
			Assert.That(module.WaitForElement(By.XPath("//div[@id = 'journalItems']/div[2]//p[1]")).Text, Is.StringContaining("Private"),
								 "The wrong message is shown");
			Assert.That(module.WaitForElement(By.XPath("//div[@id = 'journalItems']/div[3]//p[1]")).Text, Is.StringContaining("Community"),
						   "The wrong message is shown");
		}
		public void Test006_AnonymousAccessToMemberDirectory()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Anonymous User Access To Member Directory'");

			var loginPage = new LoginPage(_driver);
			loginPage.LetMeOut();

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

			var module = new MemberDirectoryModule(_driver);
			module.FindElement(By.XPath("//ul[@id = 'mdMemberList']/li[last()]")).Info();

			Trace.WriteLine("ASSERT the number of Users are correct :");
			Assert.That(module.FindElements(By.XPath("//ul[@id = 'mdMemberList']/li")).Count, Is.EqualTo(4), "The number of Users is incorrect");

			Trace.WriteLine("ASSERT the link visibility is correct :");
			Assert.IsFalse(module.ElementPresent(By.XPath("//ul[@id = 'mdMemberList']/li[1]//div[not(@style)]/div[ul[@class = 'mdHoverActions' and not(@style)]]")),
					 "The links are displayed in User #1 Info");
			Assert.IsFalse(module.ElementPresent(By.XPath("//ul[@id = 'mdMemberList']/li[2]//div[not(@style)]/div[ul[@class = 'mdHoverActions' and not(@style)]]")),
								 "The links are displayed in User #2 Info");
			Assert.IsFalse(module.ElementPresent(By.XPath("//ul[@id = 'mdMemberList']/li[3]//div[not(@style)]/div[ul[@class = 'mdHoverActions' and not(@style)]]")),
								 "The links are displayed in User #3 Info");
			Assert.IsFalse(module.ElementPresent(By.XPath("//ul[@id = 'mdMemberList']/li[4]//div[not(@style)]/div[ul[@class = 'mdHoverActions' and not(@style)]]")),
								 "The links are displayed in User #4 Info");
		}
Beispiel #14
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");
		}
Beispiel #15
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");
		}
Beispiel #16
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");
		}
Beispiel #17
0
		public void SearchResultsOnPageSettingsFrame()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Search Results on Page Settings frame'");

			BlankPage blankPage = new BlankPage(_driver);

			blankPage.SelectMenuOption(ControlPanelIDs.ControlPanelEditPageOption, ControlPanelIDs.PageSettingsOption);

			VerifySearchResults(blankPage);
		}
Beispiel #18
0
		public void Test011_CopyPage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Copy a Page'");
			var blankPage = new BlankPage(_driver);

			blankPage.OpenCopyPageFrameUsingControlPanel(_baseUrl);
			blankPage.CopyPage(_copiedPageName, _parentPageName, _copyFromPage);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the user redirected to newly created page: " + "http://" +
			                _baseUrl.ToLower() + "/" + _parentPageName + "/" + _copiedPageName);
			Assert.That(blankPage.CurrentWindowUrl(),
			            Is.EqualTo("http://" + _baseUrl.ToLower() + "/" + _parentPageName + "/" + _copiedPageName),
			            "The page URL is not correct");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT 3 new modules added.");
			Assert.That(blankPage.FindElements(By.XPath("//li[@class = 'actionMenuMove']")).Count, Is.EqualTo(3),
			            "The Modules are not added correctly");

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

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the page: " + _copiedPageName + "is present in the list");
			Assert.IsTrue(
				adminPageManagementPage.ElementPresent(
					By.XPath(AdminPageManagementPage.PageList + "//li[div/span[text() = '" + _parentPageName +
					         " ']]//div/span[text() = '" + _copiedPageName + " ']")),
				"The page is not present in the list");
		}
Beispiel #19
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");
		}
Beispiel #20
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");
		}
Beispiel #21
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");
		}
		public void CreatePageAndSetViewPermission(string pageName, string option, string permissionOption)
		{
			Trace.WriteLine(BasePage.TraceLevelComposite + "'Create A Page And Set View Permissions: '");

			var blankPage = new BlankPage(_driver);
			blankPage.OpenAddNewPageFrameUsingControlPanel(_baseUrl);

			blankPage.AddNewPage(pageName);

			//blankPage.OpenUsingUrl(_baseUrl, pageName);
			blankPage.SetPageViewPermissions(option, permissionOption);

			//blankPage.CloseEditMode();
		}
Beispiel #23
0
		public void EditContentOfExistingModuleWithCopy(string assyName, string moduleClassName, Dictionary<string, Modules.ModuleIDs> modulesDescription, string pageName, string moduleContent)
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Edit content to HTML Module'");

			var module = new Modules(_driver);

			var mainPage = new MainPage(_driver);
			mainPage.OpenUsingUrl(_baseUrl);

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

			Trace.WriteLine(BasePage.TraceLevelPage + "Find the original module number on 'Home' page");
			string originalModuleNumber =
				mainPage.WaitForElement(By.XPath(Modules.LocationDescription["FooterRightPane"].IdWhenOnPage + "/div[last()]/a")).GetAttribute("name");

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

			Trace.WriteLine(BasePage.TraceLevelElement + "Find the Module number:");
			string moduleNumberOnNewPage =
				module.WaitForElement(By.XPath(locationOnPage + moduleNameOnPage + "/a")).GetAttribute("name");

			GetHTMLModule(assyName, moduleClassName, moduleNumberOnNewPage, moduleContent);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the module Content is present on the page");
			Assert.That(moduleContent,
			            Is.EqualTo(
				            module.FindElement(
					            By.XPath("//div[contains(@class, 'DNN_HTML DnnModule-" + moduleNumberOnNewPage +
					                     "')]//div[contains(@id, 'lblContent')]")).Text));

			mainPage.OpenUsingUrl(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the module Content changed on 'Home' page");
			Assert.That(moduleContent,
			            Is.Not.EqualTo(
				            module.WaitForElement(
					            By.XPath("//div[contains(@class, 'DNN_HTML DnnModule-" + originalModuleNumber +
					                     "')]//div[contains(@id, 'lblContent')]")).Text));
		
		}
		public void CreateNewPage(string pageName)
		{
			var blankPage = new BlankPage(_driver);
			blankPage.OpenAddNewPageFrameUsingControlPanel(_baseUrl);
			blankPage.AddNewPage(pageName);
		}
Beispiel #25
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");
		}
		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();
		}
		public void Test002_AcceptFriendRequest()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Accept Friend Request'");

			var loginPage = new LoginPage(_driver);
			loginPage.LoginUsingDirectUrl(_baseUrl, _userNameNumberTwo, _password);

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

			var module = new MemberDirectoryModule(_driver);
			module.AcceptFriendRequest(_userDisplayNameNumberThree);

			Trace.WriteLine("ASSERT 'Pending Request' link changed to 'Remove Friend' link'");
			Assert.IsTrue(module.ElementPresent(By.XPath("//div[not(@style)]/div[ul[@class = 'MdMemberInfo']//span[contains(text(), '" + _userDisplayNameNumberThree + "')]]/ul/li[@class = 'mdFriendRemove']")));

			var userAccountPage = new UserAccountPage(_driver);
			userAccountPage.OpenFriendsLink(_baseUrl);

			Trace.WriteLine("ASSERT New friend is listed:");
			Assert.IsTrue(userAccountPage.ElementPresent(By.XPath("//div[not(@style)]/div/ul[@class = 'MdMemberInfo']//span[contains(text(), '" + _userDisplayNameNumberThree + "')]")), "New Friend is not found");

			loginPage.LoginUsingDirectUrl(_baseUrl, _userNameNumberThree, _password);

			userAccountPage.OpenFriendsLink(_baseUrl);

			Trace.WriteLine("ASSERT New friend is listed:");
			Assert.IsTrue(userAccountPage.ElementPresent(By.XPath("//div[not(@style)]/div/ul[@class = 'MdMemberInfo']//span[contains(text(), '" + _userDisplayNameNumberTwo + "')]")), "New Friend is not found");
		}
		public void RemoveUsedPage(string pageName)
		{
			var page = new BlankPage(_driver);
			page.OpenUsingUrl(_baseUrl, pageName);
			page.DeletePage(pageName);

			var adminRecycleBinPage = new AdminRecycleBinPage(_driver);
			adminRecycleBinPage.OpenUsingButtons(_baseUrl);
			adminRecycleBinPage.EmptyRecycleBin();
		}
		public void Test001_AddAsFriend()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Send Friend Request'");

			var loginPage = new LoginPage(_driver);
			loginPage.LoginUsingDirectUrl(_baseUrl, _userNameNumberThree, _password);

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

			var module = new MemberDirectoryModule(_driver);
			module.AddAsFriend(_userDisplayNameNumberTwo);

			Trace.WriteLine("ASSERT 'Add Friend link changed to 'Pending Request' link'");
			Assert.IsTrue(module.ElementPresent(By.XPath("//div[not(@style)]/div[ul[@class = 'MdMemberInfo']//span[contains(text(), '" + _userDisplayNameNumberTwo + "')]]/ul/li[@class = 'mdFriendPending']")));

			var userAccountPage = new UserAccountPage(_driver);
			userAccountPage.OpenFriendsLink(_baseUrl);

			userAccountPage.WaitForElement(By.XPath(MemberDirectoryModule.FriendsNotFoundMessage)).Info();

			Trace.WriteLine("ASSERT 'Friends are not found' message is present :");
			Assert.That(userAccountPage.FindElement(By.XPath(MemberDirectoryModule.FriendsNotFoundMessage)).Text,
						Is.EqualTo(MemberDirectoryModule.FriendsNotFoundMessageText),
						"Info message is not found");

			loginPage.LoginUsingDirectUrl(_baseUrl,_userNameNumberTwo, _password);

			Trace.WriteLine("ASSERT Notification icon contains number '1' for incoming request :");
			Assert.That(loginPage.WaitForElement(By.XPath(ControlPanelIDs.NotificationLink + "/span")).Text, Is.EqualTo("1"));

		}
Beispiel #30
0
		public void Test001_AnonymousAccessToJournal()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Anonymous User Access To Jounal'");

			var loginPage = new LoginPage(_driver);
			loginPage.LetMeOut();

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

			var module = new JournalModule(_driver);
			module.FindElement(By.XPath("//div[@id = 'journalItems']/div[last()]")).Info();

			Trace.WriteLine("ASSERT the number of Messages are correct :");
			Assert.That(module.FindElements(By.XPath("//div[@id = 'journalItems']/div")).Count, Is.EqualTo(1), "The number of Messages are incorrect");

			Trace.WriteLine("ASSERT the visibility is correct :");
			Assert.That(module.WaitForElement(By.XPath("//div[@id = 'journalItems']/div[1]//p[1]")).Text, Is.StringContaining("Everyone"),
					 "The wrong message is shown");
			Assert.IsFalse(module.ElementPresent(By.XPath("//div[@id = 'journalItems']/div[2]//p[1]")),
								 "Visibility permission is not respected for this message");
			Assert.IsFalse(module.ElementPresent(By.XPath("//div[@id = 'journalItems']/div[3]//p[1]")),
								 "Visibility permission is not respected for this message");
		}