Пример #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");
        }
Пример #2
0
        public void Test004_RegisterUser()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Register the User'");

            MainPage mainPage = new MainPage(_driver);

            mainPage.OpenUsingUrl(_baseUrl);

            _loginPage.LetMeOut();

            _loginPage.DoRegisterUsingRegisterLink(_registeredUserName, _registeredUserDisplayName, _registeredUserEmail, _registeredUserPassword);

            _driver.Navigate().Refresh();

            _loginPage.WaitForElement(By.XPath("//*[@id='" + LoginPage.LoginLink + "' and not(contains(@href, 'Logoff'))]"), 20).WaitTillVisible(20).Click();

            _loginPage.DoLoginUsingLoginLink("host", "dnnhost");

            ManageUsersPage 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.Id(BasePage.RegisteredUserLink)).Text, Is.EqualTo(_registeredUserDisplayName),
                        "The registered User is not logged in correctly");
        }