public void Test001_UserSendsMessage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'The authorized User can send the message :'");

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

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

			var module = new MessageCenterModule(_driver);
			module.ComposeNewMessage(_userDisplayNameNumberOne, _subject, "Test Message");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT New message is present in the inbox:");
			Assert.That(module.WaitForElement(By.XPath("//ul[@id = 'inbox']//li[@class = 'ListCol-3']//a")).Text,
						Is.EqualTo(_subject),
						"Message subject is not found");

			loginPage.LoginUsingDirectUrl(_baseUrl, _userNameNumberOne, _password);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT Message icon contains number '1' for incoming message :");
			Assert.That(loginPage.WaitForElement(By.XPath(ControlPanelIDs.MessageLink + "/span")).Text, Is.EqualTo("1"));

			module.OpenMessagesUsingIcon();
			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT New message is present in the list:");
			Assert.That(module.WaitForElement(By.XPath("//ul[@id = 'inbox']//li[@class = 'ListCol-3']//a")).Text,
						Is.EqualTo(_subject),
						"Message subject is not found");
		}
Example #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("journal");

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

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

			_userNameNumberOne = testSettings.Attribute("userNameNumberOne").Value;
			_userNameNumberTwo = testSettings.Attribute("userNameNumberTwo").Value;
			_userNameNumberThree = testSettings.Attribute("userNameNumberThree").Value;
			_userDisplayNameNumberOne = testSettings.Attribute("userDisplayNameNumberOne").Value;
			_userDisplayNameNumberTwo = testSettings.Attribute("userDisplayNameNumberTwo").Value;
			_userDisplayNameNumberThree = testSettings.Attribute("userDisplayNameNumberThree").Value;
			_password = testSettings.Attribute("password").Value;
			_subject = testSettings.Attribute("subject").Value;
			_comment = testSettings.Attribute("comment").Value;
			_fileNameToAttach = testSettings.Attribute("fileNameToAttach").Value;
			_pictureNameToAttach = testSettings.Attribute("pictureNameToAttach").Value;
			_pageName = testSettings.Attribute("pageName").Value;

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

			OpenMainPageAndLoginAsHost();

			var manageUsersPage = new ManageUsersPage(_driver);
			manageUsersPage.OpenUsingControlPanel(_baseUrl);
			manageUsersPage.AddNewUser(_userNameNumberOne, _userDisplayNameNumberOne, "*****@*****.**", _password);
			manageUsersPage.AddNewUser(_userNameNumberTwo, _userDisplayNameNumberTwo, "*****@*****.**", _password);
			manageUsersPage.AddNewUser(_userNameNumberThree, _userDisplayNameNumberThree, "*****@*****.**", _password);

			CreatePageAndSetViewPermission(_pageName, "All Users", "allow");

			AddModule(_pageName, Modules.CommonModulesDescription, "JournalModule", "ContentPane");

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

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

			var module = new JournalModule(_driver);
			module.AddNewPostWithVisibilityPermission(_subject + " Community Members", "Community Members");
			module.AddNewPostWithVisibilityPermission(_subject + " Private", "Private");
			module.AddNewPostWithVisibilityPermission(_subject + " Everyone", "Everyone");

			OpenMainPageAndLoginAsHost();

			_logContent = LogContent(); 
		}
Example #3
0
		public void Test001_RegisteredUserUploadsAvatar()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Registered User uploads Avatar'");

			var loginPage = new LoginPage(_driver);
			loginPage.LoginUsingDirectUrl(_baseUrl, _registeredUserName, _registeredUserPassword);

			var manageUserProfilePage = new ManageUserProfilePage(_driver);
			manageUserProfilePage.OpenUsingLink(_baseUrl);

			manageUserProfilePage.AddProfileAvatar(_avatarFileToUpload);

			var userAccountPage = new UserAccountPage(_driver);
			userAccountPage.OpenUsingLink(_baseUrl);
			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT avatar file is loaded correctly");

			userAccountPage.WaitForElement(By.XPath(ManageUserProfilePage.ProfilePhoto)).Info();
			Assert.That(manageUserProfilePage.WaitForElement(By.XPath(ManageUserProfilePage.ProfilePhoto)).GetAttribute("src"), Is.StringContaining(_avatarFileToUpload),
						"The User Avatar is not added correctly");
		}
		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"));

		}
		public void Test005_RegularUserAccessToMemberDirectory()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Authorized User Access To Member Directory'");

			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.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.IsTrue(module.ElementPresent(By.XPath("//ul[@id = 'mdMemberList']/li[1]//div[not(@style)]/div[ul[@class = 'mdHoverActions' and not(@style)]]")),
					 "The links are not displayed in User #1 Info");
			Assert.IsTrue(module.ElementPresent(By.XPath("//ul[@id = 'mdMemberList']/li[2]//div[not(@style)]/div[ul[@class = 'mdHoverActions' and not(@style)]]")),
								 "The links are not displayed in User #2 Info");
			Assert.IsTrue(module.ElementPresent(By.XPath("//ul[@id = 'mdMemberList']/li[3]//div[not(@style)]/div[ul[@class = 'mdHoverActions' and not(@style)]]")),
								 "The links are not 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");
		}
		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");
		}
Example #7
0
		public void Test009_UserAttachesFileFromWebsiteToPost()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'The authorized User can attach the picture to the message :'");

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

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

			var module = new JournalModule(_driver);
			module.AddNewPostWithAttachedWebsitePicture(_subject, _pictureNameToAttach);

			Trace.WriteLine("ASSERT the picture displayed correctly:");
			Assert.IsTrue(module.ElementPresent(By.XPath("//div[@id = 'journalItems']/div[1]/div[@class = 'journalitem']/div/img[contains(@src, '" + _pictureNameToAttach + "')]")),
						"Message text is not displayed correctly");
		}
Example #8
0
		public void Test006_UserDeletesMessage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'The authorized User can delete the message :'");

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

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

			var module = new JournalModule(_driver);
			module.DeletePost(_subject);

			Trace.WriteLine("ASSERT the posts are NOT displayed:");
			Assert.That(module.FindElements(By.XPath("//div[@id = 'journalItems']/child::*")).Count,
						Is.EqualTo(0),
						"The posts are still displayed");
		}
Example #9
0
		public void Test005_UserCommentsPost()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'The authorized User can comment the message :'");

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

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

			var module = new JournalModule(_driver);
			module.CommentPost(_subject, _comment);

			Trace.WriteLine("ASSERT the original message is displayed:");
			Assert.That(module.WaitForElement(By.XPath("//div[@class = 'journalitem']/p[1]")).Text,
						Is.EqualTo(_userDisplayNameNumberThree + _subject),
						"Message text is stiil displayed");

			Trace.WriteLine("ASSERT the comment message is displayed:");
			Assert.That(module.WaitForElement(By.XPath("//div[p[@class = 'journalfooter']]//li/p")).Text,
						Is.StringContaining(_userDisplayNameNumberThree + _comment),
						"Message text is stiil displayed");
		}
Example #10
0
		public void Test004_UserPostsMessage()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'The authorized User can post the message :'");

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

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

			var module = new JournalModule(_driver);
			module.AddNewPost(_subject);

			Trace.WriteLine("ASSERT the author displayed correctly:");
			Assert.That(module.WaitForElement(By.XPath("//span[@class = 'authorname']/a")).Text,
						Is.EqualTo(_userDisplayNameNumberThree),
						"Message author is not found");

			Trace.WriteLine("ASSERT the message displayed correctly:");
			Assert.That(module.WaitForElement(By.XPath("//div[@class = 'journalitem']/p[1]")).Text,
						Is.StringContaining(_userDisplayNameNumberThree + _subject),
						"Message text is not displayed correctly");
		}
Example #11
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");
		}
Example #12
0
		public void Test003_RegisteredUserChangesProfile()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Registered User changes Password'");

			var loginPage = new LoginPage(_driver);
			loginPage.LoginUsingDirectUrl(_baseUrl, _registeredUserName, _registeredUserPassword);

			var manageUserProfilePage = new ManageUserProfilePage(_driver);
			manageUserProfilePage.OpenUsingLink(_baseUrl);

			manageUserProfilePage.ChangePassword(_registeredUserPassword, _newPassword);

			loginPage.LoginUsingLoginLink(_registeredUserName, _newPassword);

			var mainPage = new MainPage(_driver);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the name of logged User is correct");
			Assert.That(mainPage.WaitForElement(By.XPath(ControlPanelIDs.RegisterLink)).Text,
						Is.EqualTo(_registeredUserDisplayName),
						"The User is not added correctly");
		}
Example #13
0
		private void RunInstallTest(XElement settings)
		{
			string testName = settings.Attribute("name").Value;
			string baseUrl = settings.Attribute("baseURL").Value;
			string browser = settings.Attribute("browser").Value;
			string template = settings.Attribute("Template").Value;
			string installerLanguage = settings.Attribute("InstallerLanguage").Value;
			string language = settings.Attribute("Language").Value;
			string username = settings.Attribute("UserName").Value;
			string password = settings.Attribute("Password").Value;
			string websiteName = settings.Attribute("WebsiteName").Value;

			IWebDriver driver = StartBrowser(browser);

			Trace.WriteLine("Running TEST: '" + testName + "'");

			InstallerPage installerPage = new InstallerPage(driver);

			installerPage.OpenUsingUrl(baseUrl);

			installerPage.SetInstallerLanguage(installerLanguage);
			installerPage.SetDictionary(installerLanguage);

			installerPage.OpenUsingUrl(baseUrl);
			installerPage.FillAccountInfo(settings);

			installerPage.SetWebSiteLanguage(language);

			installerPage.ClickOnContinueButton();

			installerPage.WaitForInstallationProcessToFinish();

			installerPage.ClickOnVisitWebsiteButton();

			Trace.WriteLine(BasePage.TraceLevelComposite + "Login to the site first time, using 'Visit Website' button:");

			Trace.WriteLine(BasePage.TraceLevelComposite + "Set site language: '" + language + "'");
			installerPage.SetDictionary(language);

			//Trace.WriteLine(BasePage.TraceLevelPage + "Verify frame title: '" + installerPage.CurrentFrameTitle() + "'");
			//Utilities.SoftAssert(() => StringAssert.AreEqualIgnoringCase(installerPage.Translate("WelcomeScreenTitle"), installerPage.CurrentFrameTitle(),
			//					 "The Welcome Screen title is missing or incorrect"));

			installerPage.WelcomeScreen();

			LoginPage loginPage = new LoginPage(driver);

			Trace.WriteLine("Verify Website Name: '" + websiteName + "'");
			Utilities.SoftAssert(() => StringAssert.Contains(websiteName, installerPage.CurrentWindowTitle(),
										"The website name is incorrect"));

			switch (template)
			{
				case "Default Template":
					{
						loginPage.LoginUsingLoginLinkAndFrame(username, password);

						//default template; look for menu options, 4 options should be present
						Trace.WriteLine("Assert current Template: Default: ");
						Assert.AreEqual(4, installerPage.FindElements(By.XPath("//ul[@class ='nav nav-pills']/li")).Count(),
										"This is not a Default page or The number of options are incorrect");

						loginPage.LoginUsingDirectUrl(baseUrl, username, password);
						//default template; look for menu options, 4 options should be present
						Trace.WriteLine("Assert current Template: Default: ");
						Assert.AreEqual(4, installerPage.FindElements(By.XPath("//ul[@class = 'nav nav-pills']/li")).Count(),
										"This is not a Default page or The number of options are incorrect");

						break;
					}
				case "Mobile Template":
					{
						Trace.WriteLine("Assert current Template: Mobile: ");
						Assert.AreEqual(3, installerPage.FindElements(By.XPath("//ol[@class='mobileInstruction']/li")).Count(),
								"This is not a Mobile page or The mobile instructions are not present on the page or The number of mobile instructions steps are incorrect");

						break;
					}
				case "Blank Template":
					{
						loginPage.LoginUsingLoginLinkAndFrame(username, password);

						//blank template; look for the "Home" option (only one option is present)
						Trace.WriteLine("Assert current Template: Blank: ");
						Assert.AreEqual(1, installerPage.FindElements(By.XPath("//ul[@class='nav nav-pills']/li")).Count(),
										"This is not a Blank page or The number of options are incorrect");

						loginPage.LoginUsingDirectUrl(baseUrl, username, password);

						//blank template; look for the "Home" option (only one option is present)
						Trace.WriteLine("Assert current Template: Blank: ");
						Assert.AreEqual(1, installerPage.FindElements(By.XPath("//ul[@class='nav nav-pills']/li")).Count(),
										"This is not a Blank page or The number of options are incorrect");
						break;
					}
			}

		}