Inheritance: System.Web.UI.Page
示例#1
0
        public void TestRegistration()
        {
            //Se crea string para guardar el nombre del metodo para luego usarlo en el report
            string testName = System.Reflection.MethodBase.GetCurrentMethod().Name;
            //Se crea el objeto test
            ExtentTest test = extent.CreateTest(testName).Info("Test started");

            try
            {
                var RP = new RegisterPage(driver);
                RP.NameField.SendKeys("Adrian");
                RP.EmailField.SendKeys("*****@*****.**");
                RP.PasswordField.SendKeys("12345");
                RP.IcecreamChecbox.Click();
                RP.SelectGender("Male");
                RP.SelectStatus("Student");
                RP.DoBField.SendKeys("03/21/1992");
                RP.SubmitBtn.Click();
                var msg = RP.SuccessMsg.Text;
                Assert.IsTrue(msg == "Success!");
                test.Log(Status.Pass, testName + " Passed");
            }
            catch (Exception ex)
            {
                test.Log(Status.Error, "Se encontró un error: " + ex.Message);
            }
        }
示例#2
0
        private async void CreateAccount_Tapped(object sender, EventArgs e)
        {
            RegisterPage registerPage = new RegisterPage();

            registerPage.OnAccountChanged += OnAccountChange;
            await Navigation.PushAsync(registerPage);
        }
示例#3
0
        public void Inititalize()
        {
            // advisasble to read this documentation before proceeding http://extentreports.relevantcodes.com/net/
            switch (Browser)
            {
            case 1:
                Driver.driver = new FirefoxDriver();
                break;

            case 2:
                Driver.driver = new ChromeDriver();
                Driver.driver.Manage().Window.Maximize();
                Driver.driver.Manage().Cookies.DeleteAllCookies();

                break;
            }
            if (Keys_Resource.IsLogin == "true")
            {
                LoginPage loginobj = new LoginPage();
                loginobj.LoginSuccessfull(2);
            }
            else
            {
                RegisterPage obj = new RegisterPage();
                obj.Navigateregister();
            }
            extent = new ExtentReports(ReportPath, false);
            extent.LoadConfig(Keys_Resource.ReportXMLPath);
        }
        private void OnRegisterPageRequested(object sender, EventArgs e)
        {
            RegisterPage RegisterView = new RegisterPage();

            Login_RegisterPageController.setView(RegisterView);
            Login_RegisterPageController.getView().Show();
        }
示例#5
0
        public void FailedRegistration()
        {
            RegisterPage registerPage = new RegisterPage(_driver);
            User         user         = User.GetRandomUser();

            user.Email = "test";
            //user.Password = "******";
            try
            {
                registerPage.Navigate().FillUser(user).Submit();
            }
            catch (TextException e)
            {
                Assert.AreEqual("Email is incorrect", e.Message);
            }

            user.Email    = TextHelpers.GetRandomWord(10) + "@" + TextHelpers.GetRandomWord(6) + "." + TextHelpers.GetRandomWordWithoutNumbers(2);
            user.Password = "";
            try
            {
                registerPage.Navigate().FillUser(user).Submit();
            }
            catch (TextException e)
            {
                Assert.AreEqual("Password is empty", e.Message);
            }
        }
 public void RegisterationSetup()
 {
     _homePage     = new HomePage(ActiveBrowser.WebDriverInstance);
     _registerPage = new RegisterPage(ActiveBrowser.WebDriverInstance);
     _searchAPI    = new SearchAPI();
     password      = "******";
 }
示例#7
0
        public bool SubmitCookiesNotAccepted(BrowserFactory.BrowserType browserType)
        {
            IWebDriver driver       = BrowserFactory.StartBrowser(browserType, RegisterPage.url);
            var        registerPage = new RegisterPage(driver);

            PageFactory.InitElements(driver, registerPage);
            registerPage.Login.SendKeys("cookieTest");
            registerPage.Email.SendKeys("*****@*****.**");
            registerPage.Password.SendKeys("password1");
            registerPage.PasswordConfirmation.SendKeys("password1");
            registerPage.PasswordConfirmation.Submit();
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(2);
            //   WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5));
            //   wait.Until(((IJavaScriptExecutor) driver).ExecuteScript("return document.readyState").Equals("complete"));
            try
            {
                IWebElement message = driver.FindElement(By.XPath("//*[@id=\"successMsg\"]"));
                Debug.WriteLine("Page title = " + message);
                driver.Close();
                driver.Dispose();
                return(true);
            }
            catch (Exception e)
            {
                driver.Close();
                driver.Dispose();
                Debug.WriteLine("Register Not Succeeded." + "\n" + e.ToString());
                return(false);
            }
        }
示例#8
0
        public void RegisterNewPhotographer_OneEmptyField_Negative()
        {
            MainPage             = new MainPage(driver);
            PageWithRegisterLink = MainPage.GoToPageWithRegisterLink();
            RegisterPage         = PageWithRegisterLink.GoToRegisterPage();

            RegisterPage.FillTheFirstNameField();
            RegisterPage.FillTheEmailField();
            RegisterPage.FillThePasswordField();
            RegisterPage.ConfirmPasswordField.Clear();
            RegisterPage.CreateAccountButton.Click();
            Assert.True(RegisterPage.ErrorMessage.Displayed);

            RegisterPage.FirstNameField.Clear();
            RegisterPage.FillTheEmailField();
            RegisterPage.FillThePasswordField();
            RegisterPage.FillTheConfirmPasswordField();
            RegisterPage.CreateAccountButton.Click();
            Assert.True(RegisterPage.ErrorMessage.Displayed);

            RegisterPage.FillTheFirstNameField();
            RegisterPage.EmailField.Clear();
            RegisterPage.FillThePasswordField();
            RegisterPage.FillTheConfirmPasswordField();
            RegisterPage.CreateAccountButton.Click();
            Assert.True(RegisterPage.ErrorMessage.Displayed);
        }
示例#9
0
        public void TC05_CreateNewAccount()
        {
            Console.WriteLine("TC05 - User can create new account");

            //1.Navigate to QA Railway Website
            HomePage homePage = new HomePage();

            homePage.Open();

            //2.Click on "Register" tab
            RegisterPage registerPage = homePage.GoToRegisterPage();

            //3.Enter valid information into all fields
            //4.Click on "Register" button
            //VP. New account is created and message "Thank you for registering your account" appears.
            string email    = String.Format("khanh{0}@gmail.com", StringUtils.RandomString(8, true));
            string password = StringUtils.RandomString(8, true);
            string confirm  = StringUtils.RandomString(8, true);
            string pid      = StringUtils.RandomString(8, true);

            string actualMsg   = registerPage.Register(email, password, confirm, pid).GetThankYouMessage().Trim();
            string expectedMsg = "Thank you for registering your account";

            Assert.AreEqual(expectedMsg, actualMsg);
        }
示例#10
0
        public void TC09_UserCannotCreateAccountWithDiffPass()
        {
            Console.WriteLine("TC09 - User can't create account with 'Confirm password' is not the same as 'Password'");

            //1.Navigate to QA Railway Website
            HomePage homePage = new HomePage();

            homePage.Open();

            //2.Click on "Register" tab
            RegisterPage registerPage = homePage.GoToRegisterPage();

            //3.Enter valid information into all fields except "Confirm password" is not the same as "Password"
            //4.Click on "Register" button
            //VP. New account is created and message "Thank you for registering your account" appears.
            string email    = String.Format("khanh{0}@gmail.com", StringUtils.RandomString(8, true));
            string password = StringUtils.RandomString(8, true) + "password";
            string confirm  = StringUtils.RandomString(8, true) + "confirm";
            string pid      = StringUtils.RandomString(8, true);

            string actualMsg   = registerPage.RegisterInvalid(email, password, confirm, pid).GetErrorMessage();
            string expectedMsg = "There're errors in the form. Please correct the errors and try again.";

            Assert.AreEqual(expectedMsg, actualMsg);
        }
示例#11
0
        public void SetUp()
        {
            Console.WriteLine("Run test initialize");

            //start firefox
            Constant.WebDriver = new FirefoxDriver();
            //maximize
            Constant.WebDriver.Manage().Window.Maximize();

            //Pre-condition: Create a new account but do not activate it
            //1.Navigate to QA Railway Website
            HomePage homePage = new HomePage();

            homePage.Open();

            //2.Click on "Register" tab
            RegisterPage registerPage = homePage.GoToRegisterPage();

            //3.Enter valid information into all fields
            //4.Click on "Register" button
            //VP. New account is created and message "Thank you for registering your account" appears.
            user = new User();
            user.InitData();
            string actualMsg   = registerPage.Register(user).GetThankYouMessage().Trim();
            string expectedMsg = "Thank you for registering your account";

            Assert.AreEqual(expectedMsg, actualMsg);
            //End Pre-condition
        }
 public RegisterUserSteps(IWebDriver webDriver)
 {
     driver = webDriver;
     driver.Manage().Window.Maximize();
     regPage     = new RegisterPage(driver);
     welcomePage = new WelcomePage(driver);
 }
示例#13
0
        public RegisterPageVM(MainWindow mainWindow, RegisterPage registerPage)
        {
            _mw = mainWindow;
            _rp = registerPage;

            ButtonClickCommand = new RelayCommand(ButtonClickCommandImpl);
        }
示例#14
0
        private void Register_Click(object sender, EventArgs e)
        {
            this.Hide();
            RegisterPage rg = new RegisterPage();

            rg.Show();
        }
示例#15
0
 public RegisterViewModel()
 {
     User         = new User();
     registerpage = new RegisterPage();
     registerpage.button.Click += Button_Click;
     registerpage.DataContext   = this;
 }
示例#16
0
        public async Task Signup()
        {
            var randomName = DateTime.Now.ToUniversalTime().Ticks.ToString("x");
            var userName   = $"devusr_{randomName}";

            var page = new RegisterPage(Driver);

            page.Navigate();

            page.Username        = $"devusr_{randomName}";
            page.Email           = $"development+{userName}@weedseeker.net";
            page.Password        = "******";
            page.ConfirmPassword = "******";
            page.Country         = "United States";
            page.State           = "California";
            page.City            = "San Jose";
            //Agree
            page.Agree.Click();

            await page.WaitAngularAsync();

            page.Submit();

            page.ConfirmationLabel.Should()
            .Be("Account created successfully.");
        }
示例#17
0
        public RegisterPage CreateRegister(int groupId, DateTime startDate, DateTime endDate)
        {
            var registerPage = new RegisterPage();

            registerPage.GroupId = groupId;

            registerPage.Children = RegisterService.GetChildren(groupId);

            var marksByDays = new List <DayMarks>();
            var currentDate = startDate;

            while ((endDate - currentDate).TotalDays > 0)
            {
                var marks = RegisterService.GetMarks(groupId, currentDate);

                var marksByDay = new DayMarks()
                {
                    Date = currentDate, Marks = marks
                };
                marksByDays.Add(marksByDay);

                currentDate = currentDate.AddDays(1);
            }

            registerPage.MarksByDays = marksByDays;

            return(registerPage);
        }
示例#18
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);
        }
示例#19
0
        public void FailedRegistration()
        {
            RegisterPage registerPage = new RegisterPage(_driver);
            User         user         = User.GetRandomUser();

            user.Login       = "";
            user.FromService = FromService.Social;
            try
            {
                registerPage.Navigate().FillUser(user).Submit();
            }
            catch (MessageException e)
            {
                Assert.AreEqual("Login is empty", e.Message);
            }

            user.Login = TextHelper.GetRandomWord(10);
            user.Email = "test@t";

            try
            {
                registerPage.Navigate().FillUser(user).Submit();
            }
            catch (MessageException e)
            {
                Assert.AreEqual("Email is incorrect", e.Message);
            }
        }
示例#20
0
        private void NewUserButton_Click(object sender, EventArgs e)
        {
            RegisterPage j = new RegisterPage();

            j.Show();
            this.Hide();
        }
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            var registerPage = new RegisterPage(repository);

            this.Hide();
            registerPage.Show();
        }
示例#22
0
 public RegisterFormPresenter()
 {
     instance        = RegisterPage.instance;
     RegisterCommand = new Command(() => Reg());
     CancelCommand   = new Command(() => LoginOpen());
     _model          = new User();
 }
示例#23
0
        public void RegisterNewPhotographer_Positive()
        {
            RegisterPage = new RegisterPage(driver);
            RegisterPage.GoToPage();
            RegisterPage.ClearAllInputsOnThePage();

            RegisterPage.FirstNameField.SendKeys(Data.firstName);
            RegisterPage.EmailField.SendKeys(Data.email);
            RegisterPage.PasswordField.SendKeys(Data.password);
            RegisterPage.ConfirmPasswordField.SendKeys(Data.password);
            RegisterPage.AcceptTermCheckBox.Click();
            CreateBusinessProfilePage = RegisterPage.CreateAccountButtonClick();

            //   Assert.True(CreateBusinessProfilePage.PageTitle.Text.Contains("Create a public business profile"));

            CreateBusinessProfilePage.ClearAllInputsOnThePage();
            CreateBusinessProfilePage.BusinessNameField.SendKeys(Data.firstName);
            CreateBusinessProfilePage.CityField.SendKeys(Data.City);
            CreateBusinessProfilePage.StateListBox.SelectByText("Alabama");
            CreateBusinessProfilePage.ZipCodeField.SendKeys(Data.ZipCode);
            CreateBusinessProfilePage.WeddingCategoryListBox.SelectByText("Photographer");
            CreateBusinessProfilePage.PublicEmailAddressField.SendKeys(Data.email_3);
            CreateBusinessProfilePage.PhoneField.SendKeys(Data.Phone);
            CreateBusinessProfilePage.CreateAccount.Click();
        }
        public void Test10()
        {
            RegisterPage rPage = loginPage.ClickRegisterHereLink();
            LoginPage    lPage = rPage.ClickLoginHereLink();

            Assert.IsTrue(lPage.IsPageDisplayed, "Login Page is not displayed when the user clicks 'Log in here' link.");
        }
示例#25
0
        public void TC09_UserCannotCreateAccountWithDiffPass()
        {
            Console.WriteLine("TC09 - User can't create account with \"Confirm password\" is not the same as \"Password\"");

            //1.Navigate to QA Railway Website
            HomePage homePage = new HomePage();

            homePage.Open();

            //2.Click on "Register" tab
            RegisterPage registerPage = homePage.GoToRegisterPage();

            //3.Enter valid information into all fields except "Confirm password" is not the same as "Password"
            //4.Click on "Register" button
            //VP. New account is created and message "Thank you for registering your account" appears.
            User user = new User();

            user.InitData();
            user.Password        += "pass";
            user.PasswordConfirm += "confirm";

            string actualMsg   = registerPage.RegisterInvalid(user).GetErrorMessage();
            string expectedMsg = "There're errors in the form. Please correct the errors and try again.";

            Assert.AreEqual(expectedMsg, actualMsg);
        }
示例#26
0
 public MainWindow()
 {
     InitializeComponent();
     mManager = new DatabaseManager();
     mPage    = new RegisterPage(this);
     ShowCurrentPage();
 }
        public void Teste3()
        {
            //Validar telefone repetido
            IWebDriver driver = new ChromeDriver();

            driver.Navigate().GoToUrl("http://demo.automationtesting.in/Register.html");
            driver.Manage().Window.Maximize();


            RegisterPage register = new RegisterPage(driver);

            register.BntRefresh();
            register.CampoFirtsName("Mario");
            register.CampoLastName("Ramos");
            register.CampoAndress("Heriberto Hulse");
            register.CampoEmail("*****@*****.**");
            register.CampoTelephone("7999655510");
            register.RadioGender();
            register.CheckboxHobbies();
            register.SelectLanguages();
            register.SelectSkills();
            register.SelectCoutry();
            register.SelectCoutry2();
            register.BirthDay();
            register.CampoFirstPassword("Mario18");
            register.CampoSecondPassword("Mario18");
            register.BntSubmit();

            Assert.IsTrue(driver.FindElement(By.XPath("/html/body/section/div[1]")).Displayed);


            Console.Out.Write(" Teste Passou");

            driver.Close();
        }
示例#28
0
 public LoginPage(Evento evento, RegisterPage registerPage)
 {
     InitializeComponent();
     this.evento    = evento;
     loginViewModel = new LoginViewModel(evento, Navigation, registerPage);
     BindingContext = loginViewModel;
 }
示例#29
0
 public RegisterDialog() : base(new DialogPage[]
 {
     new RegisterPage()
 })
 {
     page = this.Pages[0] as RegisterPage;
 }
示例#30
0
        public void WhenIFillTheRegisterFormWithFollowingData(Table table)
        {
            var          user         = table.CreateInstance <UserDto>();
            RegisterPage registerPage = new RegisterPage(Driver);

            registerPage.EnterRegistrationCredentials(user);
        }
        public bool Execute(string username, string password, string email)
        {
            var mainPage = new MainPage(_browser);
            var loginPage = new LogonPage(_browser);
            var registerPage = new RegisterPage(_browser);

            _browser.Go(mainPage.Url);
            mainPage.LogOnLink().Click();
            loginPage.RegisterLink().Click();
            registerPage.Username().SendKeys(username);
            registerPage.Password().SendKeys(password);
            registerPage.Email().SendKeys(email);
            registerPage.ConfirmPassword().SendKeys(password);
            registerPage.RegisterBtn().Click();

            return mainPage.LogonDisplay().Text.Contains("Welcome "+username);
        }
示例#32
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;
        }
示例#33
0
 public RegisterUser(ITestOutputHelper output, IISExpress issexpress)
     : base(output, issexpress)
 {
     registerPage = new RegisterPage(driver);
 }