Пример #1
0
		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");
		}
Пример #2
0
		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"));

		}
Пример #3
0
		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");
		}