public void Test001_VerifyNoneRegistration() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Verify 'None' registration option'"); var loginPage = new LoginPage(_driver); loginPage.LoginAsHost(_baseUrl); var adminSiteSettingsPage = new AdminSiteSettingsPage(_driver); adminSiteSettingsPage.OpenUsingButtons(_baseUrl); adminSiteSettingsPage.SetUserRegistrationType(AdminSiteSettingsPage.NoneRadioButton); loginPage.LetMeOut(); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the 'Register' link is NOT present on the screen"); Assert.IsFalse(loginPage.ElementPresent(By.XPath(ControlPanelIDs.RegisterLink)), "The Register link is present on the screen"); loginPage.OpenUsingUrl(_baseUrl); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the 'Register' button is NOT present on the screen"); Assert.IsFalse(loginPage.ElementPresent(By.XPath(LoginPage.RegisterFrameButton)), "The Register button is present on the screen"); }
//[Test] public void NavigationToLoginPage() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Navigation To Login Page'"); var mainPage = new MainPage(_driver); mainPage.OpenUsingUrl(_baseUrl); var loginPage = new LoginPage(_driver); loginPage.LetMeOut(); loginPage.OpenUsingUrl(_baseUrl); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT Page Title for '" + loginPage.PageTitleLabel + "' page:"); StringAssert.Contains(loginPage.PageTitleLabel, loginPage.WaitForElement(By.XPath(ControlPanelIDs.PageTitleID)).Text, "The wrong page is opened or The title of " + loginPage.PageTitleLabel + " page is changed"); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The Search Box is present'"); Assert.IsTrue(loginPage.ElementPresent(By.XPath(ControlPanelIDs.SearchBox)), "The Search Box is missing."); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT The Search Button is present'"); Assert.IsTrue(loginPage.ElementPresent(By.XPath(ControlPanelIDs.SearchButton)), "The Search Button is missing."); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT Copyright notice is present'"); Utilities.SoftAssert( () => StringAssert.Contains(ControlPanelIDs.CopyrightText, loginPage.FindElement(By.Id(ControlPanelIDs.CopyrightNotice)).Text, "Copyright notice is not present or contains wrong text message")); }
public void Test002_VerifyPrivateRegistration() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Verify 'Private' registration option'"); var loginPage = new LoginPage(_driver); loginPage.LoginAsHost(_baseUrl); var adminSiteSettingsPage = new AdminSiteSettingsPage(_driver); adminSiteSettingsPage.OpenUsingButtons(_baseUrl); adminSiteSettingsPage.SetUserRegistrationType(AdminSiteSettingsPage.PrivateRadioButton); loginPage.RegisterUser(_userWithPrivateRegistration, "DisplayName", "*****@*****.**", "www3434"); loginPage.LoginUsingLoginLink(_userWithPrivateRegistration, "www3434"); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Warning message is present"); Assert.IsTrue(loginPage.ElementPresent(By.XPath(LoginPage.NotAuthorizedWarningMessage)), "The Warning message is not present"); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Warning message text is correct"); Assert.That(loginPage.WaitForElement(By.XPath(LoginPage.NotAuthorizedWarningMessage)).Text, Is.EqualTo(LoginPage.NotAuthorizedWarningMessageText), "The Warning message text is not correct"); loginPage.LoginAsHost(_baseUrl); var manageUsersPage = new ManageUsersPage(_driver); manageUsersPage.OpenUsingControlPanel(_baseUrl); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the User is NOT authorized"); Assert.IsFalse( manageUsersPage.ElementPresent( By.XPath("//tr[td[text() = '" + _userWithPrivateRegistration + "']]/td/img[contains(@id, '_imgApproved')]")), "The User is authorized"); }