Example #1
0
        public void testClearForm(SchoolNet schoolnet)
        {
            schoolnet.LoadWebPage();
            AuthenticationPage page = new AuthenticationPage();

            page.Form.ClearForm();
        }
Example #2
0
        public void ValidarCadastroDeUsuario()
        {
            #region Arranje

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

            #endregion Arranje

            #region Act

            login.NavegaParaPagina(Properties.Resource.UrlAuthentication);
            login.PreencheCampoEmailCreateAccount(usuario.Email);
            login.ClickBtnCreateAccount();
            login.PreecherDadosUsuario(usuario);
            login.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
        }
Example #3
0
        private Page CreatePageAsync(string viewModelName)
        {
            if (viewModelName == null)
            {
                throw new ArgumentNullException(nameof(viewModelName));
            }

            Page contentPage;

            switch (viewModelName)
            {
            case nameof(InitialPage):
                contentPage = new InitialPage();
                break;

            case nameof(AuthenticationPage):
                contentPage = new AuthenticationPage();
                break;

            default:
                throw new Exception("Content page does not exist");
            }

            return(contentPage);
        }
Example #4
0
        public void SignUpToMercuryTourApplicationTest()
        {
            LaunchApplicationPage();
            Assert.Equal("My Store", getDriver().Title);

            HomePage home = new HomePage(getDriver());

            home.clickOnSignInLink();
            AuthenticationPage authenticationPage = new AuthenticationPage(getDriver());

            Assert.Equal("Login - My Store", authenticationPage.isAuthenticationPageDisplayed());

            AuthenticationPage authenticationPage1 = new AuthenticationPage(getDriver());

            authenticationPage1.enterEmailForSignUp();
            authenticationPage1.clickOnCreateAccountButton();

            RegisterUserPage registerUserPage = new RegisterUserPage(getDriver());

            Assert.Equal("CREATE AN ACCOUNT", registerUserPage.isDislayedRegisterUserPage());

            registerUserPage.enterUserDetails();
            Assert.Equal(registerUserPage.isDisplayedAccountPage(), testData.FirstName.Concat(" " + testData.LastName));

            closeSession();
        }
Example #5
0
        public void LoginComUsuarioEPasswordCorretos()
        {
            #region Arranje

            IndexPage          index         = new IndexPage(driver);
            MyAccountPage      myAccountPage = new MyAccountPage(driver);
            AuthenticationPage login         = new AuthenticationPage(driver);

            var User = ManipularArquivoHelper.LerDeUmArquivoQueEstaNoFormatoJson();

            #endregion Arranje

            #region Act

            index.NavegaParaPagina(Properties.Resource.UrlPrincipal);

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

            #endregion Act

            #region Assert

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

            #endregion Assert

            #region Finalization

            index.ClickBtnSign_Out();

            #endregion Finalization
        }
Example #6
0
        public static void Registration()
        {

            WebDriverWait wait = new WebDriverWait(Driver.driver, TimeSpan.FromSeconds(60));

            HomePage hp = new HomePage();
            hp.BtnSignIn.Click();

            AuthenticationPage ap = new AuthenticationPage();
            ap.Email.SendKeys(Config.RegistrationValues.NewEmail);
            ap.BtnCreateAnAccount.Click();

            wait.Until(ExpectedConditions.ElementExists(By.Id("account-creation_form")));
            CreateAccountPage createAcP = new CreateAccountPage();
            createAcP.GenderMR.Click();
            createAcP.FirstName.SendKeys(Config.RegistrationValues.firstName);
            createAcP.LastName.SendKeys(Config.RegistrationValues.lastName);
            createAcP.Password.SendKeys(Config.RegistrationValues.password);
            createAcP.Address.SendKeys(Config.RegistrationValues.address);
            createAcP.City.SendKeys(Config.RegistrationValues.city);
            createAcP.StateIllinois.Click();
            createAcP.ZipCode.SendKeys(Config.RegistrationValues.zipcode);
            createAcP.MobilePhone.SendKeys(Config.RegistrationValues.MobilePhoneNumer);
            createAcP.BtnRegister.Click();



        }
Example #7
0
        public void WhenUserSubmitsTheLoginForm()
        {
            Utilities          ut = new Utilities(Driver);
            AuthenticationPage ap = new AuthenticationPage(Driver);

            ut.ClickOnElement(ap.signInbtn);
        }
Example #8
0
        public void WhenUserEntersValidEmailAddress()
        {
            AuthenticationPage authPage = new AuthenticationPage(Driver);

            authPage.EmailInputField().SendKeys(emailValue);
            string userEmail = authPage.EmailInputField().GetAttribute("vaule");
        }
Example #9
0
        public void GivenEntersCorrectCredentials()
        {
            AuthenticationPage ap = new AuthenticationPage(Driver);

            ut.EnterTextInElement(ap.username, TestConstants.Username);
            ut.EnterTextInElement(ap.password, TestConstants.Passwoard);
        }
        public void ValidateEmail(bool isPositive, string email)
        {
            AuthenticationPage authenticationPage = header.ClickOnSingIn();
            bool isEmailOk = authenticationPage.EnterNewAccountEmail(email).IsNewEmailOk();

            Assert.That(isEmailOk, Is.EqualTo(isPositive), $"Email was validated {(isEmailOk ? "successfully" : "unsuccessfully")}"
                        + " but were expected opposite");
        }
Example #11
0
        public void GivenEntersCorrectCredentials()
        {
            //objekat klase AP,metoda se poziva preko objekta ut
            AuthenticationPage ap = new AuthenticationPage(Driver);

            ut.EnterTextInElement(ap.username, TestConstants.Username);
            ut.EnterTextInElement(ap.password, TestConstants.Password);
        }
Example #12
0
        public void Test(bool isPositive, string text)
        {
            AuthenticationPage authenticationPage = mainPage.ClickOnSearch();
            bool isOk = authenticationPage.EnterSearch(text).IsSearchOk();

            Assert.That(isOk, Is.EqualTo(isPositive),
                        $"Search was validated{(isOk ? "successfully" : "unsuccessfully")}");
        }
Example #13
0
        public void GivenEntersCorrectCredentials()
        {
            Utilities          ut = new Utilities(Driver);
            AuthenticationPage ap = new AuthenticationPage(Driver);

            ut.EnterTxtInElement(ap.username, TestConstats.Username);
            ut.EnterTxtInElement(ap.password, TestConstats.password);
        }
        public void WhenIProvideInvalidCredentialsAndSubmit()
        {
            string             username           = DataHooks.EnvData["app.invalidusername"];
            string             password           = DataHooks.EnvData["app.invalidpassword"];
            AuthenticationPage authenticationPage = new AuthenticationPage(sso);

            authenticationPage.Login(username, password);
        }
        public void GivenInitiatesAFlowForCreatingAnAccount()
        {
            AuthenticationPage ap    = new AuthenticationPage(Driver);
            string             email = ut.GeneraterandomEmail();

            ut.EnterTextElement(ap.emailaddress, email);
            ut.ClickOnElement(ap.createanaccount);
        }
Example #16
0
        public void GivenInitiatesAFlowForCreatingAnAccount()
        {
            AuthenticationPage ap    = new AuthenticationPage(Driver);
            string             email = ut.GenerateRandomEmail();

            ut.EnterTextInElement(ap.cemail, email);
            ut.ClickOnElement(ap.subemail);
        }
Example #17
0
        public void GivenInitiatesAFowForCreatingPage()
        {
            Utilities          ut        = new Utilities(Driver);
            AuthenticationPage ap        = new AuthenticationPage(Driver);
            string             randEmail = ut.GenerateRandomEmail();

            ut.EnterTextInElement(ap.email, randEmail);
            ut.ClickOnElement(ap.createAccountBtn);
        }
Example #18
0
        public void GivenInitiatesAFlowForCreatingAnAccount()
        {
            Utilities          ut    = new Utilities(Driver);
            AuthenticationPage ap    = new AuthenticationPage(Driver);
            string             email = ut.GenerateRandomMail();

            ut.EnterTxtInElement(ap.emailfield, email);
            ut.ClickOnElement(ap.createAcc);
        }
Example #19
0
 public void ScreenshotUponFailure()
 {
     UITest(() =>
     {
         AuthenticationPage authentication = new AuthenticationPage(driver);
         authentication.ClickSignIn();
         authentication.LoginFailed("12345", "12345");
     });
 }
Example #20
0
 public void Init()
 {
     Driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20);
     _loginPage = new LoginPage(Driver);
     _regPage   = new RegistrationPage(Driver);
     _authPage  = new AuthenticationPage(Driver);
     _user      = UserFactory.CreateValidUser();
     _wait      = new WebDriverWait(Driver, TimeSpan.FromSeconds(5));
 }
Example #21
0
        public static void LoginFailure()
        {
            HomePage hp = new HomePage();
            hp.BtnSignIn.Click();

            AuthenticationPage ap = new AuthenticationPage();
            ap.EmailLogin.SendKeys(Config.RegistrationValues.email);
            ap.Password.SendKeys("12345");
            ap.BtnLogin.Click();
        }
Example #22
0
        public void GivenInitiatesAFowForCreatingAnAccount()
        {
            //lokator kreira se objekat
            AuthenticationPage ap = new AuthenticationPage(Driver);
            //deklarisem novu promenljivu tipa string email i dodeliti vrednost iz utilities klase
            string email = ut.GenerateRandomEmail();

            ut.EnterTextInElement(ap.emailAddress, email);
            ut.ClickOnElement(ap.caBtn);
        }
Example #23
0
        /// <summary>
        /// Entry point.
        /// </summary>
        public static void Main()
        {
            PayingSystemDataBaseContext db = new PayingSystemDataBaseContext();

            DataProvider dataProvider = new DataProvider(new UnitOfWork(db));

            AuthenticationPage authentication = new AuthenticationPage(dataProvider);

            authentication.Display();
        }
Example #24
0
        public void testInputAndSubmitForm(SchoolNet schoolnet)
        {
            schoolnet.LoadWebPage();
            AuthenticationPage page = new AuthenticationPage();
            AuthenticationData data = new AuthenticationData();

            data.DistrictName = "National";
            data.Username     = "******";
            data.Password     = "******";
            page.Data         = data;
            HomePage homePage = (HomePage)page.Form.InputAndSubmitForm();
        }
Example #25
0
        public void testInputAndSubmitFormAndVerifyErrors(SchoolNet schoolnet)
        {
            schoolnet.LoadWebPage();
            AuthenticationPage page = new AuthenticationPage();
            AuthenticationData data = new AuthenticationData();

            data.DistrictName = "";
            data.Username     = "";
            data.Password     = "";
            page.Data         = data;
            page.Form.InputAndSubmitFormWithErrors();
        }
Example #26
0
        public void LoginIntoAccount()
        {
            homePage = new HomePage(this.DriverContext);
            homePage.OpenHomePage();
            authenticationPage = homePage.ClickSignInButton(this.DriverContext);
            myAccountPage      = authenticationPage
                                 .EnterEmailSignIn(UserData.currentAccountEmail)
                                 .EnterPasswordSignIn(UserData.currentAccountPassword)
                                 .ClickSignInButton(this.DriverContext);

            Assert.AreEqual(expectedHeader, myAccountPage.GetPageHeader());
        }
Example #27
0
        public void Setup()
        {
            InitializeMaximizedBrowser();

            _homePage           = new HomePage(Driver);
            _loginPage          = new LoginPage(Driver);
            _authenticationPage = new AuthenticationPage(Driver);

            Driver.NavigateTo(_homePage.URL);
            _homePage.SignInHeader.Click();
            _homePage.SignUp();
            _userRegistration = UserFactory.CreateValidUser();
        }
Example #28
0
        public void AdicionarItemNoCarrinho()
        {
            #region Arranje

            IndexPage               index     = new IndexPage(driver);
            AuthenticationPage      login     = new AuthenticationPage(driver);
            WomenPage               womenPage = new WomenPage(driver);
            ShoppingCartSummaryPage shoppingCartSummaryPage = new ShoppingCartSummaryPage(driver);
            AddressesPage           addressesPage           = new AddressesPage(driver);
            ShippingPage            shippingPage            = new ShippingPage(driver);
            PaymentPage             paymentPage             = new PaymentPage(driver);

            var User = ManipularArquivoHelper.LerDeUmArquivoQueEstaNoFormatoJson();

            #endregion Arranje

            #region Act

            index.NavegaParaPagina(Resources.Resource.UrlPrincipal);
            index.ClickBtnSign_in();

            login.PreencheCampoEmail(User.Email);
            login.PreencheCampoPassword(User.Password);
            login.ClickBtnSign_in();

            womenPage.NavegaParaAPaginaWomen();
            womenPage.ColocarItemCarrinho();

            shoppingCartSummaryPage.ContinuarCheckout();

            addressesPage.ContinuarCheckout();

            shippingPage.ContinuarCheckout();

            paymentPage.EscolherTipoDePagamento();
            paymentPage.ConfirmarOrdem();

            #endregion Act

            #region Assert

            Assert.AreEqual(paymentPage.RetornaTextoDaMensagem(), "ORDER CONFIRMATION");

            #endregion Assert

            #region Finalization

            index.ClickBtnSign_Out();

            #endregion Finalization
        }
Example #29
0
        public void logInAndPlaceOrderForTShirt()
        {
            logInToApplicationTest();
            AuthenticationPage authenticationPage = new AuthenticationPage(getDriver());

            authenticationPage.switchToTshirtStorePage();

            MyStoreTshirtPage myStoreTshirtPage = new MyStoreTshirtPage(getDriver());

            Assert.Equal("Women - My Store", myStoreTshirtPage.isDisplayedMyStoreTshirtPage());

            myStoreTshirtPage.placeOrderOfTshirt();
            Assert.Equal("Order confirmation - My Store", getDriver().Title);
            closeSession();
        }
Example #30
0
        public async Task EnsureUserAuthenticated()
        {
            if (App.CurrentAthlete == null)
            {
                var authPage = new AuthenticationPage();
                await Navigation.PushModalAsync(authPage);

                await authPage.AttemptToAuthenticateAthlete();

                if (App.CurrentAthlete != null)
                {
                    await Navigation.PopModalAsync();
                }
            }
        }
Example #31
0
		public async Task EnsureUserAuthenticated()
		{
			if(App.CurrentAthlete == null)
			{
				var authPage = new AuthenticationPage();
				await Navigation.PushModalAsync(authPage);
				await authPage.AttemptToAuthenticateAthlete();

				if(App.CurrentAthlete != null)
				{
					await Navigation.PopModalAsync();
				}
			}
		}