Example #1
0
        static Page GetDetailPage(MainMasterPageMenuItem item)
        {
            Page page;

            switch (item.Id)
            {
            case 1:
                page = new BusChoicePage();
                break;

            case 2:
                page = new DelaysBusStopChoosePage();
                break;

            case 3:
                page = new MapPage();
                break;

            case 4:
                page = new UserAccountPage();
                break;

            case 5:
                page = new SettingsPage();
                break;

            default:
                page = new MainMasterPageDetail();
                break;
            }

            page.Title = item.Title;
            return(page);
        }
Example #2
0
        public void Test005_RegisteredUserChangesProfile()
        {
            Trace.WriteLine(BasePage.RunningTestKeyWord + "'Registered User changes Profile'");

            var loginPage = new LoginPage(_driver);

            loginPage.LetMeOut();

            loginPage.OpenUsingUrl(_baseUrl);
            loginPage.DoLoginUsingUrl(_registeredUserName, _registeredUserPassword);

            var manageUserProfilePage = new ManageUserProfilePage(_driver);

            manageUserProfilePage.OpenUsingLink(_baseUrl);

            manageUserProfilePage.AddCity(_cityName);

            var userAccountPage = new UserAccountPage(_driver);

            userAccountPage.OpenUsingLink(_baseUrl);

            userAccountPage.OpenMyProfileInfo();

            Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the City Info is present on the screen");
            Assert.That(userAccountPage.FindElement(By.XPath(UserAccountPage.LocationCity)).Text, Is.EqualTo(_cityName),
                        "The City Info is not displayed correctly");
        }
Example #3
0
 public void CreatePageOnUserLogged(UserModel LoggedUser)
 {
     if (PagesOrganizer.Children.Count == 3)
     {
         if (LoggedUser != null)
         {
             var UserPage = new ManageAccountPage()
             {
                 Title           = "Moje konto",
                 IconImageSource = ImageSource.FromResource("MobilePizzaApp.Zasoby.OsobaIkona.png"),
                 User            = LoggedUser
             };
             PagesOrganizer.Children.Insert(3, UserPage);
         }
         else
         {
             var RegLogPages = new UserAccountPage()
             {
                 Title           = "Moje konto",
                 IconImageSource = ImageSource.FromResource("MobilePizzaApp.Zasoby.OsobaIkona.png"),
             };
             PagesOrganizer.Children.Insert(3, RegLogPages);
         }
     }
 }
Example #4
0
        public ActionResult Show(UserAccountPage page)
        {
            ViewData["message"] = TempData["message"];

            if (CurrentRequestData.CurrentUser != null)
            {
                return(View(page));
            }

            return(Redirect(UniquePageHelper.GetUrl <LoginPage>()));
        }
Example #5
0
        private IEnumerable <Webpage> GetAccountPages()
        {
            var loginPage = new LoginPage
            {
                Name               = "Login",
                UrlSegment         = "login",
                DisplayOrder       = 100,
                RevealInNavigation = false
            };

            yield return(loginPage);

            var forgottenPassword = new ForgottenPasswordPage
            {
                Name               = "Forgot Password",
                UrlSegment         = "forgot-password",
                Parent             = loginPage,
                DisplayOrder       = 0,
                RevealInNavigation = false
            };

            yield return(forgottenPassword);

            var resetPassword = new ResetPasswordPage
            {
                Name               = "Reset Password",
                UrlSegment         = "reset-password",
                Parent             = loginPage,
                DisplayOrder       = 1,
                RevealInNavigation = false
            };

            yield return(resetPassword);

            var userAccountPage = new UserAccountPage
            {
                Name               = "My Account",
                UrlSegment         = "my-account",
                Parent             = loginPage,
                DisplayOrder       = 1,
                RevealInNavigation = false
            };

            yield return(userAccountPage);

            var registerPage = new RegisterPage
            {
                Name       = "Register",
                UrlSegment = "register",
            };

            yield return(registerPage);
        }
Example #6
0
        public override object GetModel(UserLinks widget)
        {
            List <NavigationRecord> navigationRecords = new List <NavigationRecord>();

            bool loggedIn = CurrentRequestData.CurrentUser != null;

            if (loggedIn)
            {
                UserAccountPage userAccountPage = _uniquePageService.GetUniquePage <UserAccountPage>();
                if (userAccountPage != null)
                {
                    string liveUrlSegment = userAccountPage.LiveUrlSegment;
                    navigationRecords.Add(new NavigationRecord
                    {
                        Text = MvcHtmlString.Create(_stringResourceProvider.GetValue("My Account")),
                        Url  =
                            MvcHtmlString.Create(string.Format("/{0}", liveUrlSegment))
                    });
                }


                navigationRecords.Add(new NavigationRecord
                {
                    Text = MvcHtmlString.Create(_stringResourceProvider.GetValue("Logout")),
                    Url  =
                        MvcHtmlString.Create(string.Format("/logout"))
                });
            }
            else
            {
                string liveUrlSegment = _uniquePageService.GetUniquePage <LoginPage>().LiveUrlSegment;
                if (liveUrlSegment != null)
                {
                    navigationRecords.Add(new NavigationRecord
                    {
                        Text = MvcHtmlString.Create(_stringResourceProvider.GetValue("Login")),
                        Url  =
                            MvcHtmlString.Create(string.Format("/{0}", liveUrlSegment))
                    });
                    string urlSegment = _uniquePageService.GetUniquePage <RegisterPage>().LiveUrlSegment;
                    if (urlSegment != null)
                    {
                        navigationRecords.Add(new NavigationRecord
                        {
                            Text = MvcHtmlString.Create(_stringResourceProvider.GetValue("Register")),
                            Url  =
                                MvcHtmlString.Create(string.Format("/{0}", urlSegment))
                        });
                    }
                }
            }
            return(navigationRecords);
        }
Example #7
0
        public void UserLoginTest()
        {
            var loginForm = new LoginForm()
            {
                Email    = "*****@*****.**",
                Password = "******"
            };

            var homePage = new HomePage(_driver);

            homePage.SignUpClick();
            homePage.SubmitLoginForm(loginForm)
            .GoToUserAccountPage()
            .GetPageHeaderName().Should().Be("MY ACCOUNT");

            var user = new UserAccountPage(_driver);

            user.GetInfoAccount().Should().Be("Welcome to your account. Here you can manage all of your personal information and orders.");
        }
Example #8
0
        private void btn_Account_Click(object sender, EventArgs e)
        {
            if (UserSettings.LoggedOn)
            {
                UserAccountPage user_page = new UserAccountPage();
                user_page.ShowDialog();
            }
            else
            {
                LoginPage login_page = new LoginPage();
                login_page.ShowDialog();
            }


            //RegistrationPage regis = new RegistrationPage();
            //regis.ShowDialog();

            //UserAccountPage uap = new UserAccountPage();
            //uap.ShowDialog();
        }
Example #9
0
        private IEnumerable<Webpage> GetAccountPages()
        {
            var loginPage = new LoginPage
            {
                Name = "Login",
                UrlSegment = "login",
                DisplayOrder = 100,
                RevealInNavigation = false
            };

            yield return loginPage;
            var forgottenPassword = new ForgottenPasswordPage
            {
                Name = "Forgot Password",
                UrlSegment = "forgot-password",
                Parent = loginPage,
                DisplayOrder = 0,
                RevealInNavigation = false
            };
            yield return forgottenPassword;

            var resetPassword = new ResetPasswordPage
            {
                Name = "Reset Password",
                UrlSegment = "reset-password",
                Parent = loginPage,
                DisplayOrder = 1,
                RevealInNavigation = false
            };
            yield return resetPassword;

            var userAccountPage = new UserAccountPage
            {
                Name = "My Account",
                UrlSegment = "my-account",
                Parent = loginPage,
                DisplayOrder = 1,
                RevealInNavigation = false
            };
            yield return userAccountPage;

            var registerPage = new RegisterPage
            {
                Name = "Register",
                UrlSegment = "register",
            };
            yield return registerPage;
        }