Example #1
0
        public void Test_Account_CreateAccount()
        {
            var loginPage  = AccountsLoginPage.Go(driver);
            var signupPage = loginPage.ClickSignup();

            string rndstr = StringUtil.MakeRandomString();

            User newUser = new User()
            {
                name     = "newuser_" + rndstr,
                fullName = "New User " + rndstr,
                email    = rndstr + "@here.com",
                password = rndstr,
            };

            var homePage = signupPage.SignupValid(newUser);

            Assert.IsTrue(homePage.CheckNoticeAccountcreated(newUser), "account created notice not displayed");
            Assert.IsTrue(homePage.CheckLoggedinMessage(), "regular logged-in message not displayed");
            Assert.IsTrue(homePage.CheckYourInfo(newUser), "Your Info validation failed");

            // now try to logout and log back in as the new user
            loginPage = homePage.ClickMenuLogout();
            homePage  = loginPage.LoginAsValid(newUser);

            Assert.IsTrue(homePage.CheckLoggedinMessage(), "logged-in Notice Flash not displayed in Accounts Home");
            Assert.IsTrue(homePage.CheckNoticeValidLogin(), "logged-in message not displayed in Accounts Home");
            Assert.IsTrue(homePage.CheckYourInfo(newUser), "correct user name not displayed under Your Info in Accounts Home");
        }
        public void Test_General_Menu()
        {
            User user = TestData.UsersValid[0];

            // login
            var loginPage = AccountsLoginPage.Go(driver);
            var homePage  = loginPage.LoginAsValid(user);

            // check the menu
            Assert.IsTrue(loginPage.CheckMenuLoggedin(user), "validation of menu failed");
        }
Example #3
0
        public void Test_Account_Password()
        {
            User user = TestData.UsersValid[0];

            // login
            var loginPage = AccountsLoginPage.Go(driver);
            var homePage  = loginPage.LoginAsValid(user);

            // actual test
            var accountPasswordPage = homePage.ClickMenuPassword();
        }
Example #4
0
        public void Test_Login_Invalid()
        {
            User invalidUser = TestData.UsersInvalid[0];

            var loginPage = AccountsLoginPage.Go(driver);

            loginPage = loginPage.LoginAsInvalid(invalidUser);

            Assert.IsTrue(loginPage.CheckTextNotloggedin(), "not-logged-in message not displayed in Accounts Login");
            Assert.IsTrue(loginPage.CheckErrorInvalidLogin(), "invalid-login Error Flash not displayed in Accounts Login");
        }
Example #5
0
        public void Test_Login_Valid()
        {
            User validUser = TestData.UsersValid[0];

            var loginPage = AccountsLoginPage.Go(driver);
            var homePage  = loginPage.LoginAsValid(validUser);

            // check the page text
            Assert.IsTrue(homePage.CheckLoggedinMessage(), "logged-in Notice Flash not displayed in Accounts Home");
            Assert.IsTrue(homePage.CheckNoticeValidLogin(), "logged-in message not displayed in Accounts Home");
            Assert.IsTrue(homePage.CheckYourInfo(validUser), "correct user name not displayed under Your Info in Accounts Home");
        }
        public void Test_Mailbox_Home()
        {
            User user = TestData.UsersValid[0];

            // login
            var loginPage = AccountsLoginPage.Go(driver);
            var homePage  = loginPage.LoginAsValid(user);

            // actual test
            var mailboxPage = homePage.ClickMenuMailbox();

            Assert.IsTrue(mailboxPage.CheckText(user), "page content failed validation");
        }
        public void Test_Mailbox_SendMessage()
        {
            User user  = TestData.UsersValid[0];
            User user2 = TestData.UsersValid[1];

            Message message = new Message()
            {
                subject = "hello " + StringUtil.MakeRandomString(),
                text    = "This is a simple hello message for testing. " + StringUtil.MakeRandomString(),
                from    = user,
                to      = user2,
            };

            // login
            var loginPage = AccountsLoginPage.Go(driver);
            var homePage  = loginPage.LoginAsValid(user);

            // actual test
            var newmessagePage = homePage.ClickMenuNewmessage();

            Assert.IsTrue(newmessagePage.CheckFromInfo(user), "from info is wrong");
            var mailboxPage = newmessagePage.SendMessage(user2, message);

            // make sure message is in sent folder
            var sentFolderPage = mailboxPage.ClickMenuFolder(Folder.Builtin.Sent);

            sentFolderPage.CheckFolderName(Folder.Builtin.Sent);

            Assert.IsTrue(sentFolderPage.CheckIfMessageIsListed(message), "sent message not listed in sent folder");

            // view the actual message
            var messagePage = sentFolderPage.ClickMessageRead(message);

            message.id = messagePage.GetMessageId();
            Assert.IsTrue(messagePage.CheckMessageDetails(message), "message details are wrong for sender");


            loginPage = sentFolderPage.ClickMenuLogout();

            // login as recipient, and check inbox
            homePage = loginPage.LoginAsValid(user2);
            Assert.IsTrue(homePage.CheckLoggedinMessage(), "valid login");

            var inboxPage = homePage.ClickMenuFolder(Folder.Builtin.Inbox);

            Assert.IsTrue(inboxPage.CheckIfMessageIsListed(message), "sent message is not listed in recipient's folder");

            messagePage = inboxPage.ClickMessageRead(message);
            message.id  = messagePage.GetMessageId();
            Assert.IsTrue(messagePage.CheckMessageDetails(message), "message details are wrong for recipient");
        }
Example #8
0
        public void Test_Account_Logout()
        {
            User user = TestData.UsersValid[0];

            // login
            var loginPage = AccountsLoginPage.Go(driver);
            var homePage  = loginPage.LoginAsValid(user);

            // actual test
            loginPage = homePage.ClickMenuLogout();

            Assert.IsTrue(loginPage.CheckTextNotloggedin(), "not-logged-in message not displayed in Accounts/Login");
            Assert.IsTrue(loginPage.CheckNoticeMessageLoggedOut(), "logged-out Notice flash not displayed in Accounts");
        }
Example #9
0
        public void Test_Account_Users()
        {
            User user = TestData.UsersValid[0];

            // login
            var loginPage = AccountsLoginPage.Go(driver);
            var homePage  = loginPage.LoginAsValid(user);

            // actual test
            var accountUsersPage = homePage.ClickMenuUsers();

            Assert.IsTrue(accountUsersPage.CheckTextIsUserListed(user.name), "user '" + user.name + "' is not displayed in the user list on Accounts/Users");

            var accountUserPage = accountUsersPage.ClickLinkUser(user.name);

            Assert.IsTrue(accountUserPage.CheckText(user), "general check failed in Accounts/User");
        }
        public void Test_Mailbox_CreateFolder()
        {
            User   user   = TestData.UsersValid[0];
            Folder folder = new Folder()
            {
                name = "my new custom folder " + StringUtil.MakeRandomString()
            };

            // login
            var loginPage = AccountsLoginPage.Go(driver);
            var homePage  = loginPage.LoginAsValid(user);

            // actual test
            var foldersPage   = homePage.ClickMenuFolders();
            var newfolderPage = foldersPage.ClickLinkNewfolder();
            var folderPage    = newfolderPage.CreateFolder(folder);

            Assert.IsTrue(folderPage.CheckNoticeFolderCreated(), "Notice about successful creation of folder is missing");

            folderPage.CheckFolderName(folder);
            folder.id = folderPage.GetFolderId();
            user.customFolders.Add(folder);
        }
        public void Test_NotLoggedIn_Home()
        {
            var loginPage = AccountsLoginPage.Go(driver);

            Assert.IsTrue(loginPage.CheckTextNotloggedin(), "not-logged-in message is not displayed");
        }