Ejemplo n.º 1
0
        public void testClearForm(SchoolNet schoolnet)
        {
            schoolnet.LoadWebPage();
            AuthenticationPage page = new AuthenticationPage();

            page.Form.ClearForm();
        }
Ejemplo n.º 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
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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
        }
Ejemplo n.º 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();



        }
Ejemplo n.º 7
0
        public void WhenUserSubmitsTheLoginForm()
        {
            Utilities          ut = new Utilities(Driver);
            AuthenticationPage ap = new AuthenticationPage(Driver);

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

            authPage.EmailInputField().SendKeys(emailValue);
            string userEmail = authPage.EmailInputField().GetAttribute("vaule");
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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")}");
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 16
0
        public void GivenInitiatesAFlowForCreatingAnAccount()
        {
            AuthenticationPage ap    = new AuthenticationPage(Driver);
            string             email = ut.GenerateRandomEmail();

            ut.EnterTextInElement(ap.cemail, email);
            ut.ClickOnElement(ap.subemail);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 19
0
 public void ScreenshotUponFailure()
 {
     UITest(() =>
     {
         AuthenticationPage authentication = new AuthenticationPage(driver);
         authentication.ClickSignIn();
         authentication.LoginFailed("12345", "12345");
     });
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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());
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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
        }
Ejemplo n.º 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();
        }
Ejemplo n.º 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();
                }
            }
        }
Ejemplo n.º 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();
				}
			}
		}