예제 #1
0
        public void SignInAccountTest()
        {
            LoginPageView loginPageView = new LoginPageView();

            loginPageView.SetTextCreateEmail("standard_user");
            loginPageView.SetTextCreatePassword("secret_sauce");
            loginPageView.LoginButtonTest();
            loginPageView.AddToCartTest();
            loginPageView.GoToCartTest();
            loginPageView.RemoveTest();
            loginPageView.ContinueShoppingTest();
            loginPageView.Addonesie();
            loginPageView.GoToCartTest();
            loginPageView.ContionueShopTest();
            loginPageView.AddToCartTest();
            loginPageView.GoToCartTest();
            loginPageView.CheckoutTest();
            loginPageView.SetTextId("Zorba");
            loginPageView.SetTextLastName("Test");
            loginPageView.SetTextZipCode("12345");
            loginPageView.ContinueAfterMessage();
            loginPageView.ClickForFinishTest();
            Assert.AreEqual("THANK YOU FOR YOUR ORDER", loginPageView.GetTextForAfterClickFinishButton());
            Console.WriteLine(loginPageView.GetTextForAfterClickFinishButton());
            loginPageView.HamburgerMenuButton();
            loginPageView.LogoutTEst();
        }
예제 #2
0
        public void ThirdScenarioTest()
        {
            LoginPageView loginPageView = new LoginPageView();

            loginPageView.SetTextCreateEmail("standard_user");
            loginPageView.SetTextCreatePassword("secret_sauce");
            loginPageView.LoginButtonTest();
            loginPageView.CartTest();
            loginPageView.CheckoutTest();
            loginPageView.SetTextId("Zorba");
            loginPageView.SetTextLastName("Test");
            loginPageView.SetTextZipCode("12345");
            loginPageView.ContinueAfterMessage();
            loginPageView.ClickForFinishTest();
        }
예제 #3
0
        public void SecondScenarioLoginTest()
        {
            LoginPageView loginPageView = new LoginPageView();

            loginPageView.SetTextCreateEmail("standard_user");
            loginPageView.SetTextCreatePassword("secret_sauce");
            loginPageView.LoginButtonTest();
            loginPageView.GoToCartTest();
            loginPageView.CheckoutTest();
            loginPageView.ContinueAfterMessage();
            Assert.AreEqual("Error: First Name is required", loginPageView.GetTextErorMEssage());
            Console.WriteLine(loginPageView.GetTextErorMEssage());
            loginPageView.HamburgerMenuButton();
            loginPageView.LogoutTEst();
        }
예제 #4
0
        public ActionResult Login(LoginPageView LoginData, string ReturnUrl = "/")
        {
            if (ModelState.IsValid)
            {
                // Проверяем пользователя по логину и паролю
                if (SecurityManager.ValidateUser(LoginData.Login, LoginData.Password))
                {
                    // Если все ок - запоминаем его
                    FormsAuthentication.SetAuthCookie(LoginData.Login, false);
                    return(Redirect(ReturnUrl));
                }
                else
                {
                    ModelState.AddModelError("Login", "Login or password is incorrect");
                    ModelState.AddModelError("Password", "Login or password is incorrect");
                }
            }

            return(View(LoginData));
        }
예제 #5
0
        public App()
        {
            InitializeComponent();

            MainPage = new LoginPageView();
        }
예제 #6
0
 public MainWindowViewModel( )
 {
     _INPCInvoke = new INPCInvoker(this);
     CurrentView = new LoginPageView( );
 }