public void Initialize(TestContext c)
 {
     driver        = Provider.CreateDriver();
     map           = new MyAccountPage(driver);
     driver.AppUrl = "http://shop.demoqa.com/my-account/";
     map.Navigate();
 }
示例#2
0
        //[Ignore("")]
        public void US4ScenarioCorrectInfo()
        {
            var index     = new IndexPage(driver);
            var signIn    = new SignInPage(driver);
            var register  = new RegistrationFormPage(driver);
            var myAccount = new MyAccountPage(driver);

            //from home click signin
            index.NavigateToSignIn();

            //from signin register with email
            signIn.ClickRegister();

            //go to form page and send keys for info
            //correct info/no error takes us to account page
            register.EnterCorrectInfo();

            //arrived at my account page?
            Assert.IsTrue(myAccount.arrivedOnPage());

            //assert my account page and name on top right corner
            Assert.IsTrue(myAccount.IsNamePresent());

            myAccount.signOut();
        }
示例#3
0
        public void AuthenticationPageComUsuarioEPasswordCorretos()
        {
            #region Arranje

            MyAccountPage myAccountPage = new MyAccountPage(driver);

            var User = ManipularArquivoHelper.LerDeUmArquivoQueEstaNoFormatoJson();

            #endregion Arranje

            #region Act

            index.NavegaParaPagina(Resources.Resource.UrlPrincipal);

            index.ClickBtnSign_in();
            authenticationPage.PreencheCampoEmail(User.Email);
            authenticationPage.PreencheCampoPassword(User.Password);
            authenticationPage.ClickBtnSign_in();

            #endregion Act

            #region Assert

            Assert.AreEqual(myAccountPage.RetornaTextoDaMensagem(), "MY ACCOUNT");

            #endregion Assert
        }
示例#4
0
 public Test4()
 {
     _homePage      = new HomePage(Driver);
     _logInPage     = new LogInPage(Driver);
     _myAccountPage = new MyAccountPage(Driver);
     _dashboardPage = new AccountDashboardPage(Driver);
 }
示例#5
0
        public void ValidarCadastroDeUsuario()
        {
            #region Arranje

            MyAccountPage myAccount = new MyAccountPage(driver);
            var           usuario   = GerarUsuarioHelper.GerarUsuario();

            #endregion Arranje

            #region Act

            authenticationPage.NavegaParaPagina(Resources.Resource.UrlAuthentication);
            authenticationPage.PreencheCampoEmailCreateAccount(usuario.Email);
            authenticationPage.ClickBtnCreateAccount();
            authenticationPage.PreecherDadosUsuario(usuario);
            authenticationPage.ClickBtnRegisterAnAccount();

            #endregion Act

            #region Assert

            Assert.AreEqual(myAccount.RetornaTextoDaMensagem(), "MY ACCOUNT", "Não foi encontrado o texto referente a pagina My account");
            Assert.AreEqual(myAccount.RetornaNomeDoUsuarioDaPagina(), usuario.NomeCompleto, "O nome do usuário esta diferente do esperado");

            #endregion Assert

            #region Finalization

            ManipularArquivoHelper.SalvarNoArquivoEmFormatoJson(usuario);

            #endregion Finalization
        }
示例#6
0
        public void ThenUserWilBeLoggedIn()
        {
            MyAccountPage map = new MyAccountPage(Driver);

            // imlementacija Then scenarija uvek ima Assert ,uvek, uvek
            Assert.True(ut.ElementDispayed(map.SignOutBtn), "User is not logged in");
        }
示例#7
0
        public void setUp()
        {
            options = new ChromeOptions();
            options.AddArgument("--ignore-ssl-errors=yes");
            options.AddArgument("--ignore-certificate-errors");

            driver = new ChromeDriver(options);
            driver.Manage().Window.Maximize();
            driver.Navigate().GoToUrl("https://opencart.abstracta.us");

            var loginPage = new LoginPage(driver);

            loginPage.NavigateToLoginPage(driver);

            LoginBO loginBO = new LoginBO();

            loginPage.LoginApplication(loginBO);

            var myAccountPage = new MyAccountPage(driver);

            myAccountPage.NavigateToMyAccountPage(driver);

            var addressPage = new AddressPage(driver);

            addressPage.NavigateToAddressPage(driver);

            changeAddressPage = new ChangeAddressPage(driver);
        }
示例#8
0
        public static void PurchaseByCheck()
        {
            WebDriverWait wait = new WebDriverWait(Driver.driver, TimeSpan.FromSeconds(60));

            MyAccountPage myAcc = new MyAccountPage();
            myAcc.MenuWomen.Click();

            WomenPage wp = new WomenPage();
            wp.Product1AddToCart.Click();
            wait.Until(ExpectedConditions.ElementIsVisible(By.Id("layer_cart")));
            wp.ProceedToCheckout.Click();

            CheckoutPages checkout = new CheckoutPages();
            checkout.BtnSummaryCheckout.Click();
            wait.Until(ExpectedConditions.ElementIsVisible(By.Name("processAddress")));
            checkout.BtnAddressCheckout.Click();
            wait.Until(ExpectedConditions.ElementIsVisible(By.Name("processCarrier")));
            checkout.CheckboxTermsOfService.Click();
            checkout.BtnShippingCheckout.Click();

            wait.Until(ExpectedConditions.ElementIsVisible(By.Id("HOOK_PAYMENT")));
            checkout.BtnPayByCheck.Click();
            wait.Until(ExpectedConditions.ElementIsVisible(By.CssSelector("#center_column > form")));
            checkout.BtnConfirmPurchase.Click();            
        }
示例#9
0
        public MyAccountPage ClickMyAccountLink()
        {
            ClickMenu("My account");
            MyAccountPage page = new MyAccountPage(Driver);

            return(page);
        }
示例#10
0
        public void TestMethod1()
        {
            HomePage              homePage              = new HomePage(driver);
            LogInPage             logInPage             = new LogInPage(driver);
            MyAccountPage         myAccountPage         = new MyAccountPage(driver);
            CatalogPage           catalogPage           = new CatalogPage(driver);
            Window                window                = new Window(driver);
            ShoppingCartPage      shoppingCartPage      = new ShoppingCartPage(driver);
            AdressPage            adressPage            = new AdressPage(driver);
            ShippingPage          shippingPage          = new ShippingPage(driver);
            PaymentPage           paymentPage           = new PaymentPage(driver);
            OrderSummaryPage      orderSummaryPage      = new OrderSummaryPage(driver);
            OrderConfirmationPage orderConfirmationPage = new OrderConfirmationPage(driver);

            homePage.GoToPage();
            homePage.ClickOnSignIn();
            logInPage.FillLogInForm("*****@*****.**", "clave1");
            logInPage.ClickOnSubmitLogin();
            Assert.AreEqual("Welcome to your account. Here you can manage all of your personal information and orders.", myAccountPage.GetSuccessMessage());
            myAccountPage.ClickOnWomenOption();
            catalogPage.ClickOnAddtoCartButton();
            window.ClickOnProceedCheckout();
            shoppingCartPage.ClickOnProceedCheckout();
            adressPage.ClickOnProceedCheckout();
            shippingPage.AgreeTermsOfService();
            shippingPage.ClickOnProceedCheckout();
            paymentPage.PaybyCheck();
            orderSummaryPage.ClickOnProceedCheckout();
            orderConfirmationPage.GetSuccessMessage();
        }
示例#11
0
        public void WhenUserOpensMyWishlist()
        {
            Utilities     ut = new Utilities(Driver);
            MyAccountPage ma = new MyAccountPage(Driver);

            ut.ClickOnElement(ma.wishlist);
        }
        public void WhenIPerformLogin(Table table)
        {
            var email    = table.Rows.First()["email"];
            var password = table.Rows.First()["password"];

            _myAccountPage = _authPage.SignIn(email, password);
        }
示例#13
0
        public void BuyProductAndCheckSuccessMessage()
        {
            var register = new RegisterPage(driver);

            register.RegisterUserFirstStep();
            register.FillRegisterForm();

            //Go to MainPage
            var myAccountPage = new MyAccountPage(driver);

            myAccountPage.GoToMainPage();

            //Find a short, add it to cart and proceed to checkout
            var mainPage = new BuyingProductPage(driver);

            mainPage.AddOneProductToShoppingCart();
            mainPage.ProceedToCheckout();

            //Check the success message
            WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));

            wait.Until(finish => finish.FindElement(By.CssSelector(".alert.alert-success")).Displayed);
            var successMessage = driver.FindElement(By.CssSelector(".alert.alert-success"));

            Assert.AreEqual("Your order on My Store is complete.", successMessage.Text);
        }
示例#14
0
 public void Initialize()
 {
     driver        = Provider.CreateDriver();
     mcp           = new MyAccountPage(driver);
     driver.AppUrl = ("http://shop.demoqa.com/my-account/");
     mcp.Navigate();
 }
        public void PerformMyAccountoperations()
        {
            AuthenticatedHome home = new AuthenticatedHome(driver);

            home.Navigate();

            MyAccountTestData testData      = new MyAccountTestData(TestContext.DataRow);
            MyAccountPage     myAccountPage = home.ClickMyAccountLink();

            myAccountPage.Clear();
            myAccountPage.Email       = testData.Email;
            myAccountPage.PhoneNumber = testData.PhoneNumber;
            myAccountPage.Save();

            if (testData.ExpectedResult == "Pass")
            {
                Assert.IsTrue(myAccountPage.IsMyAccountSavedSuccesfully);
            }
            else if (testData.ExpectedResult == "Fail")
            {
                Assert.IsTrue(myAccountPage.SummaryHasErrorMessage(testData.ExpectedErrorMessages));
            }
            else
            {
                throw new Exception("Unknown expected result, fix data file");
            }
        }
示例#16
0
        public void RegisterNewUser()
        {
            RegistrationData registrationData = MemberSiteUserRegistrationHelper.RegisterUserAPI();
            HomePage         homePage         = new HomePage(_driver);

            //homePage.GoToRegistrationPage();
            //RegistrationPage registrationPage = new RegistrationPage(_driver);
            //registrationPage.EnterRegistrationData();
            //Console.WriteLine("This is test");
            homePage.GoToLoginForm();
            LoginPage loginPage = new LoginPage(_driver);

            loginPage.SubmitLogin(registrationData.Username, registrationData.Password);
            MyAccountPage myAccountPage = new MyAccountPage(_driver);

            myAccountPage.NavigateToResponsibleGamblingPage();
            ResponsibleGamblingPage responsibleGemblingPage = new ResponsibleGamblingPage(_driver);

            responsibleGemblingPage.SetTimeOut();
            ConfirmationPopUpForm confirmationPopUpForm = new ConfirmationPopUpForm(_driver);

            confirmationPopUpForm.ApproveTimeOut();
            HomePage homePage2 = new HomePage(_driver);

            homePage2.GoToLoginForm();
            loginPage.SubmitLogin(registrationData.Username, registrationData.Password);
        }
示例#17
0
        public void ThenUserWillBeLoggedIn()
        {
            Utilities     ut  = new Utilities(Driver);
            MyAccountPage map = new MyAccountPage(Driver);

            Assert.True(ut.ElementDisplayed(map.logOutBtn), "Log out failed");
        }
示例#18
0
        public void ThenUserWillBeLoggedIn()
        {
            Utilities     ut = new Utilities(Driver);
            MyAccountPage ma = new MyAccountPage(Driver);

            Assert.False(ut.ElementDisplayed(ma.logOut), "User is not logged in");
        }
示例#19
0
        public void LoginWithValidCredentialsShouldLoginTheUserAndRedirectToMyAccountPage(string email, string password)
        {
            this.OpenLoginPage();
            this.loginPage.Login(email, password);
            var myAccountPage = new MyAccountPage(this.Driver);

            Assert.That(myAccountPage.IsVisible, "Login is not successful. My account page is not loaded properly.");
        }
示例#20
0
 public UpdatePersonalInformationStep(WebDriver webDriver)
 {
     _webDriver    = webDriver;
     homePage      = new HomePage(_webDriver.Driver);
     signInPage    = new SignInPage(_webDriver.Driver);
     myAccountPage = new MyAccountPage(_webDriver.Driver);
     yourPersonalInformationPage = new YourPersonalInformationPage(_webDriver.Driver);
 }
示例#21
0
        public void WhenMyAccountPageIsOpened()
        {
            MyAccountPage myAccountPage = new MyAccountPage();

            Assert.IsTrue(myAccountPage.IsVisible());
            var NavigationStep = Driver.FindElement(By.ClassName("navigation_page")).Text;

            Assert.IsTrue(NavigationStep.Contains("My account"));
        }
示例#22
0
        public void ShouldUserSignIn()
        {
            //test = extent.CreateTest("blabla1");
            MainPage      mainPage      = new MainPage();
            SignInPage    signInPage    = mainPage.ClickOnSignIn();
            MyAccountPage myAccountPage = signInPage.enterEmailAndPasswordAndClickOk();

            Assert.IsTrue(myAccountPage.CheckIfOrderExits());
        }
示例#23
0
        public AccountDetailsViewModel(MyAccountPage myAccountPage)
        {
            _myAccountPage = myAccountPage;

            IsFreeAccount = true;  // Default value
            IsDataLoaded  = false; // Default value

            CacheSize = AppService.GetAppCacheSize();
        }
示例#24
0
        public void ConversationOportunitie()
        {
            var auth         = new AuthPage(driver);
            var conversation = new MyAccountPage(driver);

            driver.Url = Url.Deautos.Views.Login.Auth;
            auth.SecondaryLogin(OfficialUser, OfficialUserPassword);
            conversation.Consult("Oportunitie");
        }
示例#25
0
        public void WhenClickOnRegisterButton()
        {
            CreateAccountPage createAccountPage = new CreateAccountPage();
            MyAccountPage     myAccountPage     = new MyAccountPage();

            createAccountPage.ClickRegister();
            Wait.Until(condition => condition.FindElement(By.ClassName("icon-user")));
            Assert.IsTrue(myAccountPage.IsVisible());
        }
示例#26
0
        public void YChangePasswordContactData()
        {
            var auth      = new AuthPage(driver);
            var myAccount = new MyAccountPage(driver);

            driver.Url = Url.Deautos.Views.Login.Auth;
            auth.SecondaryLogin();
            myAccount.ChangePasswordData();
        }
示例#27
0
        public void DataContact()
        {
            var auth      = new AuthPage(driver);
            var myAccount = new MyAccountPage(driver);

            driver.Url = Url.Deautos.Views.Login.Auth;
            auth.SecondaryLogin();
            myAccount.ModifyContactData();
        }
示例#28
0
        public void Company()
        {
            var auth      = new AuthPage(driver);
            var myAccount = new MyAccountPage(driver);

            driver.Url = Url.Deautos.Views.Login.Auth;
            auth.SecondaryLogin();
            myAccount.ModifyClientUser();
        }
示例#29
0
        public void ShouldUserSignOut()
        {
            //test = extent.CreateTest("blabla2");
            MainPage      mainPage      = new MainPage();
            SignInPage    signInPage    = mainPage.ClickOnSignIn();
            MyAccountPage myAccountPage = signInPage.enterEmailAndPasswordAndClickOk();
            SignInPage    signInPage2   = myAccountPage.SignOut();

            Assert.IsTrue(signInPage2.IfSignInExists());
        }
示例#30
0
 public void Before()
 {
     _homePage    = new HomePage(Browser);
     _loginPage   = new LoginPage(Browser);
     _accountPage = new MyAccountPage(Browser);
     _loginPage.AcessarPagina();
     _loginPage.PreencheUsuario("********");
     _loginPage.PreencheSenha("**********");
     _loginPage.BotaoLogin();
 }