Exemplo n.º 1
0
		public void Test004_RegisterUser()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Register the User'");

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

			var loginPage = new LoginPage(_driver);
			loginPage.RegisterUser(_registeredUserName, _registeredUserDisplayName, "*****@*****.**", _registeredUserPassword);

			_driver.Navigate().Refresh();

			loginPage.LoginAsHost(_baseUrl);

			var manageUsersPage = new ManageUsersPage(_driver);
			manageUsersPage.OpenUsingUrl(_baseUrl);

			manageUsersPage.AuthorizeUser(_registeredUserName);

			manageUsersPage.OpenUsingControlPanel(_baseUrl);

			loginPage.LoginUsingLoginLink(_registeredUserName, _registeredUserPassword);

			mainPage.OpenUsingUrl(_baseUrl);

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the User is present on the screen");
			Assert.That(mainPage.FindElement(By.XPath(ControlPanelIDs.RegisterLink)).Text, Is.EqualTo(_registeredUserDisplayName),
						"The registered User is not logged in correctly");
		}