Example #1
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"));

		}