Пример #1
0
        public void LoginToSite()
        {
            var doc = XDocument.Load(@"P1\" + Settings.Default.P1DataFile);

            XElement settings     = doc.Document.Element("Tests").Element("settings");
            XElement pageSettings = doc.Document.Element("Tests").Element("adminExtensions");

            _driver  = StartBrowser(settings.Attribute("browser").Value);
            _baseUrl = settings.Attribute("baseURL").Value;

            string testName = pageSettings.Attribute("name").Value;

            _adminExtensionToEdit = pageSettings.Attribute("adminExtensionToEdit").Value;

            Trace.WriteLine(BasePage.RunningTestKeyWord + "'" + testName + "'");
            Trace.WriteLine(BasePage.PreconditionsKeyWord);

            MainPage mainPage = new MainPage(_driver);

            mainPage.OpenUsingUrl(_baseUrl);

            _loginPage = new LoginPage(_driver);
            _loginPage.OpenUsingUrl(_baseUrl);
            _loginPage.DoLoginUsingUrl("host", "dnnhost");

            ManageUsersPage manageUsersPage = new ManageUsersPage(_driver);

            manageUsersPage.OpenUsingControlPanel(_baseUrl);
            manageUsersPage.AddNewUser("Admin", "Admin", "*****@*****.**", "dnnadmin");
            manageUsersPage.ManageRoles("Admin");
            manageUsersPage.AssignRoleToUser("Administrators");

            _loginPage.LoginUsingUrl(_baseUrl, "Admin", "dnnadmin");
        }
Пример #2
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");
        }
        public void Search()
        {
            CommonSection.ClickSearchIcon();
            _test.Log(Status.Info, "Clicked on Search icon present in top bar");
            CommonSection.MobileCatalogSearchText("Test");
            _test.Log(Status.Info, "Test searched successfully from Catalog search");
            Assert.IsTrue(SearchResultsPage.CheckSearchRecord("Test") >= 1); //chcks the records are not zero
            _test.Log(Status.Pass, "search record is greater than 1");       //CommonSection.Manage.People();

            CommonSection.ClickToggleNevigationIcon();
            _test.Log(Status.Info, "Taped Responsive Menu Icon on Top Nevigation Bar");
            CommonSection.Manage.People_Mobile();
            _test.Log(Status.Info, "open people page from common section on mobile web ");
            ManageUsersPage.SearchUser("");
            _test.Log(Status.Info, "blank search takes place from manage users page");
            Assert.IsTrue(ManageUsersPage.DisplaysUserlist >= 1);//checks people search is working
            _test.Log(Status.Pass, "search record is greater than 1");

            CommonSection.ClickToggleNevigationIcon();
            _test.Log(Status.Info, "Taped Responsive Menu Icon on Top Nevigation Bar");
            CommonSection.Manage.Catalog_Mobile();
            _test.Log(Status.Info, "open Catalog page from common section on mobile web ");
            CatalogPage.SearchContent_OnMobile("test");
            Assert.IsTrue(SearchResultsPage.CheckSearchRecord("Test") >= 1);//chcks the records are not zero
            _test.Log(Status.Pass, "search record is greater than 1");
        }
Пример #4
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");
        }
Пример #5
0
        public void LoginToSite()
        {
            var doc = XDocument.Load(@"BVT\" + Settings.Default.BVTDataFile);

            XElement settings = doc.Document.Element("Tests").Element("settings");

            _driver  = StartBrowser(settings.Attribute("browser").Value);
            _baseUrl = settings.Attribute("baseURL").Value;

            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Security Roles BVT'");
            Trace.WriteLine(BasePage.PreconditionsKeyWord);

            MainPage mainPage = new MainPage(_driver);

            mainPage.OpenUsingUrl(_baseUrl);

            _loginPage = new LoginPage(_driver);
            _loginPage.OpenUsingUrl(_baseUrl);
            _loginPage.DoLoginUsingUrl("host", "dnnhost");

            ManageRolesPage manageRolesPage = new ManageRolesPage(_driver);

            manageRolesPage.OpenUsingControlPanel(_baseUrl);
            manageRolesPage.AddNewSecurityRole(_assignedRoleName);

            ManageUsersPage manageUsersPage = new ManageUsersPage(_driver);

            manageUsersPage.OpenUsingControlPanel(_baseUrl);
            manageUsersPage.AddNewUser(_userName, _userDisplayName, _userEmail, _userPassword);
        }
Пример #6
0
        public void LoginToSite()
        {
            XDocument doc = XDocument.Load(DataFileLocation);

            XElement settings     = doc.Document.Element("Tests").Element("settings");
            XElement testSettings = doc.Document.Element("Tests").Element("securityRoles");

            _driver  = StartBrowser(settings.Attribute("browser").Value);
            _baseUrl = settings.Attribute("baseURL").Value;

            string testName = testSettings.Attribute("name").Value;

            _roleName        = testSettings.Attribute("roleName").Value;
            _roleDescription = testSettings.Attribute("roleDescription").Value;

            _assignedRoleName = testSettings.Attribute("assignedRoleName").Value;
            _userName         = testSettings.Attribute("userName").Value;
            _userDisplayName  = testSettings.Attribute("userDisplayName").Value;

            Trace.WriteLine(BasePage.RunningTestKeyWord + "'" + testName + "'");
            Trace.WriteLine(BasePage.PreconditionsKeyWord);

            OpenMainPageAndLoginAsHost();

            var manageRolesPage = new ManageRolesPage(_driver);

            manageRolesPage.OpenUsingControlPanel(_baseUrl);
            manageRolesPage.AddNewSecurityRole(_assignedRoleName);

            var manageUsersPage = new ManageUsersPage(_driver);

            manageUsersPage.OpenUsingControlPanel(_baseUrl);
            manageUsersPage.AddNewUser(_userName, _userDisplayName, "*****@*****.**", "pAssword10");
        }
Пример #7
0
        public void EditUserFunctionalityTest()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Test edit user functionality");
            var LoginPage  = new LoginPage();
            var ManageUser = new ManageUsersPage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            ManageUser.EditUserFunc("kumaresh", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 1, ManageUser.FirstNameField, "Kumaresh", ManageUser.LastNameField, "Govindan", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn);
            Validations.validateTitle("Manage Users - Chemical Ordering Tool");
            ManageUser.SearchUser(ManageUser.SearchTextBox, "*****@*****.**");
        }
Пример #8
0
        public void FirstNameFieldErrorValidation()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Error validation in firstname field in create user popup message");
            var LoginPage  = new LoginPage();
            var ManageUser = new ManageUsersPage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            ManageUser.CreateUserFunc(ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 1, ManageUser.FirstNameField, " ", ManageUser.LastNameField, "Govindan", ManageUser.CreateUserBtn);
            BasicMethods.VerifyText(ManageUser.firstnameerrormsg, "First Name should not be empty.");
            ManageUser.CreateUserFunc(ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 1, ManageUser.FirstNameField, "****", ManageUser.LastNameField, "Govindan", ManageUser.CreateUserBtn);
            BasicMethods.VerifyText(ManageUser.firstnameerrormsg, "First Name should not contain anything except letters and spaces.");
        }
Пример #9
0
        public void SearchUserFunctionalityTest()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Test search user functionality");
            var LoginPage  = new LoginPage();
            var ManageUser = new ManageUsersPage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            ManageUser.SelectManageUsersTab();
            Validations.validateTitle("Manage Users - Chemical Ordering Tool");
            ManageUser.SearchUser(ManageUser.SearchTextBox, "Navaneeth");
            BasicMethods.VerifyPartialText(ManageUser.ManageUsersTableRow, "Admin [email protected] Navaneetha Krishnan true");
        }
        public void Search()
        {
            CommonSection.CatalogSearchText("Test");
            _test.Log(Status.Info, "Test searched successfully from Catalog search");
            Assert.IsTrue(SearchResultsPage.CheckSearchRecord("Test") >= 1); //chcks the records are not zero
                                                                             // _test.Log(Status.Info, "search record is greater than 1"); CommonSection.Manage.People();
            CommonSection.Manage.People();
            _test.Log(Status.Info, "open people page from common section ");

            ManageUsersPage.SearchUser("");
            _test.Log(Status.Info, "blank search takes place from manage users page");
            Assert.IsTrue(ManageUsersPage.DisplaysUserlist >= 1);//checks people search is working
        }
Пример #11
0
        public void ActiveUserTest()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "ActiveUserTest");
            var LoginPage  = new LoginPage();
            var ManageUser = new ManageUsersPage();
            var HomePage   = new HomePage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            ManageUser.IsActiveUserTrueTest("durga", ManageUser.UserEmailTextBox, "*****@*****.**");
            Validations.validateTitle("Manage Users - Chemical Ordering Tool");
            BasicMethods.ClickBtn(HomePage.LogOffBtn);
            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "Lost4now", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
        }
Пример #12
0
        public void LoginPageUITest()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Verify UI");
            var LoginPage   = new LoginPage();
            var ManageUsers = new ManageUsersPage();
            var HomePage    = new HomePage();

            BasicMethods.CheckImage(LoginPage.HPLogo);
            BasicMethods.VerifyPartialText(LoginPage.Welcometitle, "Chemical Ordering Tool - HP Inc.");
            BasicMethods.VerifyText(LoginPage.WelcomeHeader, "Welcome to the Chemical Ordering Tool");
            BasicMethods.VerifyText(LoginPage.WelcomeBanner, "This is a private tool. Explicit authorization from the tool owner is required for access or use. Unauthorized access or use may result in severe civil and/or criminal liability including without limitation under 18 USC Sections 1030 et seq. All rights whatsoever are reserved.");
            BasicMethods.VerifyText(LoginPage.LoginFormTitle, "Please log in using your HP Email and Password");
            BasicMethods.VerifyText(LoginPage.ContactusLink, "Please contact COT Support ([email protected]) if you have questions.");
        }
Пример #13
0
        public void UserAccountActiveTest()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Scenario to check if the user account is active or inactive ");
            var LoginPage  = new LoginPage();
            var HomePage   = new HomePage();
            var ManageUser = new ManageUsersPage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            // ManageUser.EditUserNameTest("Durga Prasad", "*****@*****.**", ManageUser.ManageUsersTableRow);
            ManageUser.IsActiveUserFalseTest("Durga Prasad", ManageUser.UserEmailTextBox, "*****@*****.**");
            BasicMethods.ClickBtn(HomePage.LogOffBtn);
            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "Lost4now", LoginPage.LoginInBtn, LoginPage.Welcometitle);
            BasicMethods.VerifyText(LoginPage.BlankErrorMsg, "Sorry, you are not an active user for this website.");
        }
Пример #14
0
        public void UnauthorizedAccessTest()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Test Login Page with unauthorized user credentials ");
            var LoginPage  = new LoginPage();
            var HomePage   = new HomePage();
            var ManageUser = new ManageUsersPage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            ManageUser.EditUserFunc("Durga", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 2, ManageUser.FirstNameField, "Durga Prasad", ManageUser.LastNameField, "Palukuri", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn);
            ManageUser.IsActiveUserTrueTest("Durga Prasad", ManageUser.UserEmailTextBox, "*****@*****.**");
            BasicMethods.ClickBtn(HomePage.LogOffBtn);
            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "Lost4now", LoginPage.LoginInBtn, LoginPage.Welcometitle);
            BasicMethods.VerifyText(LoginPage.BlankErrorMsg, "Sorry, you do not have access to this website.");
        }
Пример #15
0
        public void EmailFieldErrorValidation()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Error validation in email field in create user popup message");
            var LoginPage  = new LoginPage();
            var ManageUser = new ManageUsersPage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            ManageUser.CreateUserFunc(ManageUser.UserEmailTextBox, "!@#$%^&*()", ManageUser.UserRole, ManageUser.UserRoleOptions, 1, ManageUser.FirstNameField, "Kumaresh", ManageUser.LastNameField, "Govindan", ManageUser.CreateUserBtn);
            BasicMethods.VerifyText(ManageUser.userEmailErrorMsg, "Please provide a valid email address");
            ManageUser.CreateUserFunc(ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 1, ManageUser.FirstNameField, "Kumaresh", ManageUser.LastNameField, "Govindan", ManageUser.CreateUserBtn);
            BasicMethods.VerifyText(ManageUser.userEmailErrorMsg, "Please enter a valid HP Email Id.");
            ManageUser.CreateUserFunc(ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 1, ManageUser.FirstNameField, "Kumaresh", ManageUser.LastNameField, "Govindan", ManageUser.CreateUserBtn);
            BasicMethods.VerifyText(ManageUser.GeneralErrorMsg, "Email is already exists.");
        }
Пример #16
0
        public void ShowFilterFunctionalityTest()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Test show filter functionality");
            var LoginPage  = new LoginPage();
            var ManageUser = new ManageUsersPage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            ManageUser.SelectManageUsersTab();
            Validations.validateTitle("Manage Users - Chemical Ordering Tool");
            ManageUser.ShowFilter(ManageUser.ShowFilterBtn, "100", ManageUser.ManageUserTableInfo, "Showing 1 to 14 of 14 entries");
            ManageUser.ShowFilter(ManageUser.ShowFilterBtn, "10", ManageUser.ManageUserTableInfo, "Showing 1 to 10 of 14 entries");
            ManageUser.ShowFilter(ManageUser.ShowFilterBtn, "25", ManageUser.ManageUserTableInfo, "Showing 1 to 14 of 14 entries");
            ManageUser.ShowFilter(ManageUser.ShowFilterBtn, "50", ManageUser.ManageUserTableInfo, "Showing 1 to 14 of 14 entries");
        }
Пример #17
0
        public void InActiveUserTest()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Inactive user test");
            var LoginPage  = new LoginPage();
            var ManageUser = new ManageUsersPage();
            var HomePage   = new HomePage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            ManageUser.IsActiveUserFalseTest("durga", ManageUser.UserEmailTextBox, "*****@*****.**");
            Validations.validateTitle("Manage Users - Chemical Ordering Tool");
            BasicMethods.ClickBtn(HomePage.LogOffBtn);
            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "Lost4now", LoginPage.LoginInBtn, LoginPage.Welcometitle);
            BasicMethods.VerifyText(LoginPage.BlankErrorMsg, "Sorry, you are not an active user for this website.");
            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            ManageUser.IsActiveUserTrueTest("durga", ManageUser.UserEmailTextBox, "*****@*****.**");
        }
Пример #18
0
        public void BlankValuesTest()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Test error messages with blank values in create user popup message");
            var LoginPage  = new LoginPage();
            var ManageUser = new ManageUsersPage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            ManageUser.SelectManageUsersTab();
            Validations.validateTitle("Manage Users - Chemical Ordering Tool");
            ManageUser.CreateNewUserBtn.Click();
            ManageUser.CreateUserBtn.Click();
            BasicMethods.VerifyText(ManageUser.userEmailErrorMsg, "Email should not be empty.");
            BasicMethods.VerifyText(ManageUser.firstnameerrormsg, "First Name should not be empty.");
            BasicMethods.VerifyText(ManageUser.lastnameerrormsg, "Last Name should not be empty.");
            ManageUser.CreateUserCloseBtn.Click();
        }
Пример #19
0
        public void SortFunctionalityTest()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Test sort functionality");
            var LoginPage  = new LoginPage();
            var ManageUser = new ManageUsersPage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            ManageUser.SelectManageUsersTab();
            Validations.validateTitle("Manage Users - Chemical Ordering Tool");
            ManageUser.SortFunc(ManageUser.RoleColumn, ManageUser.ManageUsersTableRow, "Admin", "Requester");
            ManageUser.SortFunc(ManageUser.EmailColumn, ManageUser.ManageUsersTableRow, "*****@*****.**", "*****@*****.**");
            ManageUser.SortFunc(ManageUser.FirstNameColumn, ManageUser.ManageUsersTableRow, "Usha", "Angel");
            ManageUser.SortFunc(ManageUser.LastNameColumn, ManageUser.ManageUsersTableRow, "Valdez", "Amanullah");
            ManageUser.SortFunc(ManageUser.IsActiveColumn, ManageUser.ManageUsersTableRow, "true", "false");
            ManageUser.SortFunc(ManageUser.LastLoginColumn, ManageUser.ManageUsersTableRow, "NA", "03/09/2018 08:11:25 AM");
        }
Пример #20
0
        public void UserRoleFieldValidation()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Test with the available options in user role field");
            var LoginPage  = new LoginPage();
            var ManageUser = new ManageUsersPage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            ManageUser.EditUserFunc("kumaresh", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 1, ManageUser.FirstNameField, "Kumaresh", ManageUser.LastNameField, "Govindan", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn);
            ManageUser.SearchUser(ManageUser.SearchTextBox, "*****@*****.**");
            BasicMethods.VerifyPartialText(ManageUser.ManageUsersTableRow, "Admin [email protected]");
            ManageUser.EditUserFunc("kumaresh", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 0, ManageUser.FirstNameField, "Kumaresh", ManageUser.LastNameField, "Govindan", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn);
            ManageUser.SearchUser(ManageUser.SearchTextBox, "*****@*****.**");
            BasicMethods.VerifyPartialText(ManageUser.ManageUsersTableRow, "Requester [email protected]");
            ManageUser.EditUserFunc("kumaresh", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 2, ManageUser.FirstNameField, "Kumaresh", ManageUser.LastNameField, "Govindan", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn);
            ManageUser.SearchUser(ManageUser.SearchTextBox, "*****@*****.**");
            BasicMethods.VerifyPartialText(ManageUser.ManageUsersTableRow, "EHSManager [email protected]");
        }
Пример #21
0
        public void CreateAdminAndLoginAsAdmin(string userName, string displayName, string email, string password)
        {
            ManageUsersPage manageUsersPage = new ManageUsersPage(_driver);

            manageUsersPage.OpenUsingControlPanel(_baseUrl);
            manageUsersPage.AddNewUser(userName, displayName, email, password);
            manageUsersPage.ManageRoles(userName);
            manageUsersPage.AssignRoleToUser("Administrators");

            MainPage mainPage = new MainPage(_driver);

            mainPage.OpenUsingUrl(_baseUrl);

            LoginPage loginPage = new LoginPage(_driver);

            loginPage.LoginUsingLoginLink(userName, password);
        }
Пример #22
0
        public void Test002_VerifyPrivateRegistration()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Verify 'Private' registration option'");

            var mainPage = new MainPage(_driver);

            mainPage.OpenUsingUrl(_baseUrl);

            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");
        }
Пример #23
0
        public void ManageUsersUITest()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Verify UI elements in manage users page");
            var LoginPage  = new LoginPage();
            var ManageUser = new ManageUsersPage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            ManageUser.SelectManageUsersTab();
            Validations.validateScreenByUrl("http://cos-test.psr.rd.hpicorp.net/COSWeb/ManageUser/UserManagement");
            BasicMethods.VerifyText(ManageUser.ManageUsersTitle, "Manage Users");
            Validations.validateElementIsPresent(ManageUser.CreateNewUserBtn);
            Validations.validateElementIsPresent(ManageUser.EditUserBtn);
            Validations.validateElementIsEnabled(ManageUser.SearchTextBox);
            Validations.validateElementIsPresent(ManageUser.ShowFilterBtn);
            Validations.validateElementIsPresent(ManageUser.ManageUsersTable);
            BasicMethods.VerifyText(ManageUser.ManageUsersTableHeader, "Role Email First Name Last Name Is Active Last Login Edit User");
            Validations.validateElementIsPresent(ManageUser.ManageUserTableInfo);
            Validations.validateElementIsPresent(ManageUser.ManageUserPaginateInfo);
        }
Пример #24
0
        public void Test004_VerifyVerifiedRegistration()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Verify 'Verified' registration option'");

            var mainPage = new MainPage(_driver);

            mainPage.OpenUsingUrl(_baseUrl);

            var loginPage = new LoginPage(_driver);

            loginPage.LoginAsHost(_baseUrl);

            var adminSiteSettingsPage = new AdminSiteSettingsPage(_driver);

            adminSiteSettingsPage.OpenUsingButtons(_baseUrl);

            adminSiteSettingsPage.SetUserRegistrationType(AdminSiteSettingsPage.VerifiedRadioButton);

            loginPage.RegisterUser(_userWithVerifiedRegistration, "DisplayName", "*****@*****.**", "www3434");

            var manageUserProfilePage = new ManageUserProfilePage(_driver);

            manageUserProfilePage.OpenUsingLink(_baseUrl);
            manageUserProfilePage.OpenTab(By.XPath(ManageUserProfilePage.ManageAccountTab));
            manageUserProfilePage.AccordionOpen(By.XPath(ManageUserProfilePage.AccountSettings));

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the User can Edit Profile");
            Assert.IsTrue(manageUserProfilePage.FindElement(By.XPath(ManageUserProfilePage.DisplayName)).Enabled,
                          "Display Name textbox is disabled");

            loginPage.LoginAsHost(_baseUrl);

            var manageUsersPage = new ManageUsersPage(_driver);

            manageUsersPage.OpenUsingControlPanel(_baseUrl);

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the User is authorized");
            Assert.IsFalse(
                manageUsersPage.ElementPresent(
                    By.XPath("//tr[td[text() = '" + _userWithVerifiedRegistration + "']]/td/img[contains(@id, '_imgApproved')]")),
                "The User is authorized");
        }
Пример #25
0
        public void Test004_AssignRoleToUser()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Assign the Role to User'");

            ManageUsersPage manageUsersPage = new ManageUsersPage(_driver);

            manageUsersPage.OpenUsingControlPanel(_baseUrl);

            manageUsersPage.ManageRoles(_userName);

            manageUsersPage.AssignRoleToUser(_assignedRoleName);

            ManageRolesPage manageRolesPage = new ManageRolesPage(_driver);

            manageRolesPage.OpenUsingControlPanel(_baseUrl);

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of Users assigned to the Role");
            Assert.That("1", Is.EqualTo(manageRolesPage.FindElement(By.XPath("//tr[td[text() = '" + _assignedRoleName + "']]/td[13]")).Text),
                        "The role is not assigned correctly to User");
        }
Пример #26
0
        public void Test003_RemoveDeletedUser()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Remove the User'");

            ManageUsersPage manageUsersPage = new ManageUsersPage(_driver);

            manageUsersPage.OpenUsingControlPanel(_baseUrl);

            int itemNumber = manageUsersPage.FindElements(By.XPath(ManageUsersPage.UsersList)).Count;

            manageUsersPage.RemoveDeletedUser(_userName);

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of elements in the list decreased by 1");
            Assert.That(manageUsersPage.FindElements(By.XPath(ManageUsersPage.UsersList)).Count, Is.EqualTo(itemNumber - 1),
                        "The User is not removed correctly");

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the User is not present in the list");
            Assert.IsFalse(manageUsersPage.ElementPresent(By.XPath("//tr[td[text() = '" + _userName + "']]")),
                           "The User is not removed correctly");
        }
Пример #27
0
        public void Test006_DeleteUser()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Delete the User'");

            ManageUsersPage manageUsersPage = new ManageUsersPage(_driver);

            manageUsersPage.OpenUsingControlPanel(_baseUrl);

            int itemNumber = manageUsersPage.FindElements(By.XPath(ManageUsersPage.UsersList)).Count;

            manageUsersPage.DeleteUser(_userName);

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of elements in the list is not changed");
            Assert.That(manageUsersPage.FindElements(By.XPath(ManageUsersPage.UsersList)).Count, Is.EqualTo(itemNumber),
                        "The User is not deleted correctly");

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the User is present in the list");
            Assert.IsTrue(manageUsersPage.ElementPresent(By.XPath("//tr/td[text() = '" + _userName + "']")),
                          "The User is not deleted correctly");
        }
Пример #28
0
        public void Test005_AddUser()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new User'");

            ManageUsersPage manageUsersPage = new ManageUsersPage(_driver);

            manageUsersPage.OpenUsingControlPanel(_baseUrl);

            int itemNumber = manageUsersPage.FindElements(By.XPath(ManageUsersPage.UsersList)).Count;

            manageUsersPage.AddNewUser(_userName, "User Display Name", "*****@*****.**", "pAssWrd90");

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of elements in the list increased by 1");
            Assert.That(manageUsersPage.FindElements(By.XPath(ManageUsersPage.UsersList)).Count, Is.EqualTo(itemNumber + 1),
                        "The User is not added correctly");

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the User is present in the list");
            Assert.IsTrue(manageUsersPage.ElementPresent(By.XPath("//tr/td[text() = '" + _userName + "']")),
                          "The User is not added correctly");
        }
Пример #29
0
        public void EditUserLastNameFieldErrorValidation()
        {
            test = extent.CreateTest(TestContext.CurrentContext.Test.Name, "Error validation in lastname field in EditUser popup message");
            var LoginPage  = new LoginPage();
            var ManageUser = new ManageUsersPage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            ManageUser.EditUserFunc("durga", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 2, ManageUser.FirstNameField, "Durga", ManageUser.LastNameField, "", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn);
            BasicMethods.VerifyText(ManageUser.lastnameerrormsg, "Last Name should not be empty.");
            ManageUser.EditUserFunc("durga", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 2, ManageUser.FirstNameField, "Durga", ManageUser.LastNameField, "$$$$@#@", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn);
            BasicMethods.VerifyText(ManageUser.lastnameerrormsg, "Last Name should not contain anything except letters and spaces.");
            ManageUser.EditUserFunc("durga", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 2, ManageUser.FirstNameField, "Durga", ManageUser.LastNameField, "Prasad", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn);
            ManageUser.SearchUser(ManageUser.SearchTextBox, "Durga");
            BasicMethods.VerifyPartialText(ManageUser.ManageUsersTableRow, "Durga Prasad");
            ManageUser.EditUserFunc("durga", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 2, ManageUser.FirstNameField, "Durga", ManageUser.LastNameField, "Prasad Palukuri ", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn);
            ManageUser.SearchUser(ManageUser.SearchTextBox, "Durga");
            BasicMethods.VerifyPartialText(ManageUser.ManageUsersTableRow, "Durga Prasad Palukuri ");
            ManageUser.EditUserFunc("durga", ManageUser.UserEmailTextBox, "*****@*****.**", ManageUser.UserRole, ManageUser.UserRoleOptions, 1, ManageUser.FirstNameField, "Durga", ManageUser.LastNameField, "**** ", ManageUser.IsUserActiveCheckbox, ManageUser.SaveUserBtn);
            BasicMethods.VerifyText(ManageUser.userEmailErrorMsg, "Please enter a valid HP Email Id.");
            BasicMethods.VerifyText(ManageUser.lastnameerrormsg, "Last Name should not contain anything except letters and spaces.");
        }
Пример #30
0
        public void HomepageUITest()
        {
            test = extent.CreateTest("HomepageUITest", "Test includes verification of UI elements in Home Page");
            var LoginPage    = new LoginPage();
            var HomePage     = new HomePage();
            var ContactPage  = new ContactUsPage();
            var AboutPage    = new AboutPage();
            var NOrderPage   = new NewOrderPage();
            var ManageUser   = new ManageUsersPage();
            var ManageOrders = new ManageOrdersPage();

            LoginPage.Login(LoginPage.UserName, "*****@*****.**", LoginPage.Password, "July012018", LoginPage.LoginInBtn, LoginPage.Last10RequestsTitle);
            BasicMethods.ClickBtn(HomePage.HomeTab);
            log.Info("In Home Page Screen");
            //  BasicMethods.GetLocation(HomePage.COTLink);
            // BasicMethods.GetSize(HomePage.COTLink);
            Validations.validateTitle("Home - Chemical Ordering Tool");
            BasicMethods.CheckImage(HomePage.HomePageMyLogo);
            BasicMethods.checkWebsite();
            BasicMethods.VerifyText(HomePage.COTBanner1, "Welcome To The");
            BasicMethods.VerifyText(HomePage.COTBanner2, "Chemical Ordering Tool");
            BasicMethods.VerifyText(HomePage.Last10RequestsHeader, "Last 10 Requests");
            HomePage.TestThirdPartyToolsLink(HomePage.DolphinBtn, "Comply Plus");
            HomePage.TestThirdPartyToolsLink(HomePage.SigmaAldrichBtn, "MilliporeSigma | United States");
            HomePage.TestThirdPartyToolsLink(HomePage.FedexBtn, "Tracking | FedEx Canada");
            HomePage.TestThirdPartyToolsLink(HomePage.FisherScientificBtn, "Fisher Scientific: Lab Equipment and Supplies");
            HomePage.TestThirdPartyToolsLink(HomePage.GoogleSearchBtn, "Google");
            HomePage.TestThirdPartyToolsLink(HomePage.ClassWWToolBtn, "WW-Class - Classification Online Request Form");
            HomePage.TestMainTabs(NOrderPage.OrderTab, "Order Request - Chemical Ordering Tool");
            HomePage.TestMainTabs(ManageOrders.ManageOrdersTab, "Manage Orders - Chemical Ordering Tool");
            ManageUser.SelectManageUsersTab();
            BasicMethods.ClickBtn(HomePage.HomeBtn);
            HomePage.TestMainTabs(HomePage.HomeTab, "Home - Chemical Ordering Tool");
            HomePage.TestMainTabs(AboutPage.AboutTab, "About - Chemical Ordering Tool");
            HomePage.TestMainTabs(ContactPage.ContactTab, "Contact - Chemical Ordering Tool");
            HomePage.TestThirdPartyToolsLink(HomePage.ChemicalWasteCollectionRequestFormLink, "HP San Diego - Chemical Waste Collection and Container Request Form - Formstack");
            HomePage.TestThirdPartyToolsLink(HomePage.InkChemicalRequestFormLink, "HP San Diego - Ink Pour, Chemical, Gas, Nitrogen Request Form - Formstack");
            HomePage.TestThirdPartyToolsLink(HomePage.ReturnToStockFormLink, "HP San Diego - Return to Stock or Scrap Form - Formstack");
            HomePage.TestThirdPartyToolsLink(HomePage.InventoryRequestFormLink, "HP San Diego - Inventory Request Form - Formstack");
        }