Exemplo n.º 1
0
        public void ExecuteTest()
        {
            Console.WriteLine("1. Starting");

            //login to application by creating an instance of Authentication class
            Authentication authentication = new Authentication();

            Console.WriteLine("2. Authentication loaded");
            AccountPage accountPage = authentication.SignIn("*****@*****.**", "@nuK1978");

            Console.WriteLine("3. Sign In Done");
            SearchResultsPage searchResults = accountPage.EnterSearchText("printed summer dress");

            Console.WriteLine("4. Search Done");
            CheckOut checkout = searchResults.AddToCart();

            Console.WriteLine("5. Added to cart");

            System.Threading.Thread.Sleep(5000);
            checkout.CompleteTransaction();
            Console.WriteLine("6. Proceed to checkout");

            IWebElement OrderConfirm = PropertiesCollection.driver.FindElement(By.XPath("//*[@id=\"center_column\"]/p[1]"));

            Console.WriteLine(OrderConfirm);
            Boolean Message = OrderConfirm.Text.Contains("Your order on My Store is complete");

            Assert.IsTrue(Message);
        }
Exemplo n.º 2
0
        public void WhenEndUserNavigatesToInvoicePage(string hotelName)
        {
            AccountPage accountPage = new AccountPage(driver);

            accountPage.InvoiceButton(hotelName).Click();
            accountPage.GoInvoicePage();
        }
Exemplo n.º 3
0
 public BaseSteps()
 {
     HomePage              = PageFactory.HomePage;
     RegistrationPage      = PageFactory.RegistrationPage;
     RegistrationStartPage = PageFactory.RegistrationStartPage;
     AccountPage           = PageFactory.AccountPage;
 }
Exemplo n.º 4
0
 public LoginFacade(UserLoginPage userLoginPage, AdminLoginPage adminLoginPage, AccountPage accountPage, DashboardPage dashboardPage)
 {
     _accountPage    = accountPage;
     _adminLoginPage = adminLoginPage;
     _dashboardPage  = dashboardPage;
     _userLoginPage  = userLoginPage;
 }
Exemplo n.º 5
0
        public void TestLogIn()
        {
            _driver.Url = "http://www.store.demoqa.com";

            var homePage = new HomePage();

            //Initializes the elements of the homePage PageObject
            PageFactory.InitElements(_driver, homePage);
            homePage.MyAccount.Click(); //Clicks on the MyAccount button

            var loginPage = new LogInPage();

            //Initializes the elements of the loginPage PageObject
            PageFactory.InitElements(_driver, loginPage);
            //Note: Set up your own username and password at http://www.store.demoqa.com
            loginPage.UserName.SendKeys("dummyUserTest"); //Types the username in the text box
            loginPage.Password.SendKeys("$Olive%Pass$");  //Types the password in the other text box
            loginPage.Submit.Submit();                    //Submits the login request, this is like clicking the 'submit' button

            //Wait 4 seconds for page to load, this freezes the current processing thread
            System.Threading.Thread.Sleep(4000);

            var accountPage = new AccountPage();

            PageFactory.InitElements(_driver, accountPage);
            accountPage.Logout.Click();
            //Wait 4 seconds to make sure logout is successful
            System.Threading.Thread.Sleep(4000);
            _driver.Quit();
        }
Exemplo n.º 6
0
        public void A08_Admin_Merges_Users_that_Both_Have_Selected_Interests_33987()
        {
            Driver.CreateNewAccount_Specific(user + "User1");
            LoginPage.LoginAs(user + "User1").WithPassword("").Login();
            CommonSection.Avatar.Account();
            AccountPage.ClickProfiletab();
            string primaryuser1_tags = AccountPage.addInterest();

            Driver.CreateNewAccount_Specific(user + "User2");
            LoginPage.LoginAs(user + "User2").WithPassword("").Login();
            CommonSection.Avatar.Account();
            AccountPage.ClickProfiletab();
            string primaryuser2_tags = AccountPage.addInterest();

            LoginPage.LoginAs("").WithPassword("").Login();
            CommonSection.Administer.People.MergeUser();
            MergeUsersPage.mergeUsers(user + "User1", user + "User2");

            driver.LogoutUser(ObjectRepository.LogoutHoverLink, ObjectRepository.HoverMainLink);
            LoginPage.LoginAs(user + "User1").WithPassword("").Login();
            CommonSection.Avatar.Account();
            AccountPage.ClickProfiletab();
            string expectedTag = Driver.Instance.GetElement(By.XPath("//a[@class='btn btn-add-remove btn-outline-primary']")).Text;

            StringAssert.AreEqualIgnoringCase(primaryuser1_tags, expectedTag);
        }
        public static void AssertCurrentDateIsDisplayed(this AccountPage page)
        {
            var actualDate   = page.CurrentDate;
            var expectedDate = DateTime.Now.Date.ToString("dd MMMM yyyy", new DateTimeFormatInfo());

            StringAssert.AreEqualIgnoringCase(expectedDate, actualDate, "Displayed date does not match today date on account page");
        }
        public void Registration_Confirm_Test()
        {
            // Arrange
            string expectedURL = new AccountPage().GetSucessPageURL();
            string actualURL;

            // Act
            drive.NavigatePage(startPage.GetPageURL());
            drive.FindElementByXPath(startPage.ButtonRegister()).Click();
            drive.FindElementByIdAndInputData(registerPage.Firstname()).SendKeys(user.Firstname);
            drive.FindElementByIdAndInputData(registerPage.LastName()).SendKeys(user.Lastname);
            drive.FindElementByIdAndInputData(registerPage.Email()).SendKeys(user.Email);
            drive.FindElementByIdAndInputData(registerPage.Telephone()).SendKeys(user.Telephone);
            drive.FindElementByIdAndInputData(registerPage.Fax()).SendKeys(user.Fax);
            drive.FindElementByIdAndInputData(registerPage.Company()).SendKeys(user.Company);
            drive.FindElementByIdAndInputData(registerPage.Address1()).SendKeys(user.Address1);
            drive.FindElementByIdAndInputData(registerPage.Address2()).SendKeys(user.Address2);
            drive.FindElementByIdAndInputData(registerPage.City()).SendKeys(user.City);
            drive.FindElementByIdAndInputData(registerPage.Postcode()).SendKeys(user.Postcode);
            drive.FindElementByIdAndSelectIt(registerPage.Region()).SelectByText(user.Region);
            drive.FindElementByIdAndInputData(registerPage.Password()).SendKeys(user.Password);
            drive.FindElementByIdAndInputData(registerPage.PasswordConfirm()).SendKeys(user.Password);
            drive.FindElementByName(registerPage.CheckboxConfirm()).Click();
            drive.FindElementByXPath(registerPage.ButtonContinue()).Click();
            actualURL = drive.GetURL();

            // Assert
            Assert.AreEqual(expectedURL, actualURL);
        }
Exemplo n.º 9
0
        public void CheckMails()
        {
            AccountPage AccountP = new AccountPage(driver);

            Assert.AreEqual("Невелика довідка про можливості пошти", AccountP.Message1.Text);
            Assert.AreEqual("Ласкаво просимо на I.UA!", AccountP.Message2.Text);
        }
Exemplo n.º 10
0
        private void BackClick_ToAccountPage(object sender, RoutedEventArgs e)
        {
            AccountPage accPage = new AccountPage(user);

            accPage.Show();
            this.Close();
        }
Exemplo n.º 11
0
        public void CheckYourEmail()
        {
            AccountPage AccountP = new AccountPage(driver);

            AccountP.SetAccountTitle();
            Assert.AreEqual("*****@*****.**", AccountP.AccountTitle.Text);
        }
Exemplo n.º 12
0
        public AccountPage GoToAccountPage()
        {
            var accountPage = new AccountPage(webDriver);

            AccountBtn.Click();
            return(accountPage);
        }
Exemplo n.º 13
0
        public void UploadFiles()
        {
            AccountPage AccountP = new AccountPage(driver);

            AccountP.SetOpenSavedMessage();
            AccountP.UploadFileToMessage();
        }
Exemplo n.º 14
0
        // [Test]
        public void LogoutTestCounter()
        {
            var numberOfTries = 5;
            var numberOfFails = 0;

            for (int i = 0; i < numberOfTries; i++)
            {
                try
                {
                    Driver = MyDriver.InitDriver(Browser.Chrome);
                    WebDriverWait wait = new WebDriverWait(Driver, TimeSpan.FromSeconds(20));
                    Driver.Url = "https://www.pet24.lt/";
                    CommonElements commonElements = new CommonElements(Driver);
                    commonElements.CloseCookiesBar();
                    LoginPage   loginPage   = new LoginPage(Driver);
                    HomePage    homePage    = new HomePage(Driver);
                    AccountPage accountPage = new AccountPage(Driver);

                    homePage.goToUserLoginPage();
                    loginPage.LoginAsUser(User.TestUser);
                    accountPage.ClickLogoutButton();
                    loginPage.AssertUserIsLoggedOut();
                }
                catch (Exception e)
                {
                    numberOfFails++;
                }
                finally
                {
                    Driver.Quit();
                }
            }

            Console.WriteLine($"Out of {numberOfTries} times, test failed {numberOfFails} times");
        }
Exemplo n.º 15
0
        public override void OneTimeSetUp()
        {
            driver = WebDriverFactory.GetInstance();
            AccountPage accountPage = Navigator.NavigateToInbox(driver);

            //AccountPage accountPage = new AccountPage(driver);
            accountPage.SetCreateMEssage();
        }
Exemplo n.º 16
0
        public void CheckPopup()
        {
            AccountPage AccountP = new AccountPage(driver);

            AccountP.MoveOnMessage();
            Thread.Sleep(1000);
            AccountP.SetWaitTranslateButton();
        }
Exemplo n.º 17
0
        public void User_Can_Remove_Buttons_from_Accounts_tab()
        {
            AccountsPage.GoTo();
            AccountPage.RemoveButtons();

            Assert.IsTrue(AccountPage.ButtonsRemoved(), "Removal of one of the Text Message buttons failed.");
            AccountPage.ReturnToHomePage();
        }
 public SalaryAddingWindow(int accountID, BudgetService budgetService, AccountPage mainWindow)
 {
     this.budgetService = budgetService;
     this.accountID     = accountID;
     this.mw            = mainWindow;
     InitializeComponent();
     InitializeData();
 }
Exemplo n.º 19
0
        public void ThenHotelIsDisplayed()
        {
            AccountPage accountPage = new AccountPage(driver);

            Thread.Sleep(3500);

            accountPage.scrollToelement();
            accountPage.elementIsDisplayed();
        }
Exemplo n.º 20
0
        public void ProfileUpdateTest()
        {
            Log.Information("Profile update test starting...");
            AccountPage account = AccountPage.Instance;

            account.open();
            account.updateUser();
            Log.Information("Profile update test finished");
        }
Exemplo n.º 21
0
        public void AccessAccountTest()
        {
            User      testUser  = UserCreator.withCorrectCredentials();
            LoginPage loginPage = new LoginPage(driver);

            loginPage.OpenPage();
            HomePage    homePage    = loginPage.Login(testUser);
            AccountPage accountPage = homePage.GoToAccountPage();

            Assert.True(accountPage.IsOpen());
        }
Exemplo n.º 22
0
 public void SetUp()
 {
     drive = new Driver();
     drive.SetUpChromeDriver();
     startPage         = new StartPage();
     loginPage         = new LoginPage();
     user              = new User1();
     homePage          = new HomePage();
     accountPage       = new AccountPage();
     accountLogoutPage = new AccountLogoutPage();
 }
 public void SetUp()
 {
     driver = new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
     //driver = new FirefoxDriver(@"C:\TMP");
     driver.Manage().Window.Maximize();
     wait        = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
     homePage    = new HomePage(driver);
     loginPage   = new LoginPage(driver);
     regPage     = new RegistrationPage(driver);
     accountPage = new AccountPage(driver);
 }
Exemplo n.º 24
0
        static NavigationManager()
        {
            //SINGLE PAGES
            accounts = new AccountPage();
            //groups = new GroupsPage();
            import = new ImportPage();
            //reconcile = new ReconcilePage();
            rules = new RulesPage();

            modifyRules = new ModifyRules();
        }
Exemplo n.º 25
0
        public void EditMail2(string body)
        {
            AccountPage AccountP = new AccountPage(driver);

            AccountP.SetOpenSavedMessage();
            AccountP.EditToField2Message(body);
            AccountP.SetSaveMessageButton();
            AccountP.SetOpenSavedMessage();

            Assert.AreEqual(body + "\r\n", AccountP.BodyFieldMessage.GetAttribute("value"));
            AccountP.SetSaveMessageButton();
        }
Exemplo n.º 26
0
        public void GivenIHaveUsernamePassword(string username, string password)
        {
            this._username = username;
            this._password = password;
            //IWebDriver driver = new ChromeDriver();
            BasePage basePage = new BasePage(_driver);//let us create a driver above

            _accountPage = basePage.HomePage.GoToAccountPage();
            //bcos we will use "AccountPage" somewhere
            //we do no want to use it here as a local
            //variable
        }
Exemplo n.º 27
0
 public void InitPages()
 {
     loginPage         = new LoginPage(Driver);
     homePage          = new HomePage(Driver);
     commonElements    = new CommonElements(Driver);
     productPage       = new ProductPage(Driver);
     searchPage        = new SearchPage(Driver);
     productFilterPage = new ProductFilterPage(Driver);
     shoppingCartPage  = new ShoppingCartPage(Driver);
     accountPage       = new AccountPage(Driver);
     userInfoPage      = new UserInfoPage(Driver);
 }
Exemplo n.º 28
0
        public void CheckSiteLoad()
        {
            //WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));
            var accountPage = new AccountPage(this.driver);

            accountPage.NavigateTo();

            var logo = driver.FindElement(By.XPath("/html/body/div[1]/div/div[1]/a"));

            Assert.AreEqual("SOFTUNI BLOG", logo.Text);
            driver.Close();
        }
Exemplo n.º 29
0
        public void EditMail(string mail)
        {
            AccountPage AccountP = new AccountPage(driver);

            AccountP.SetOpenSavedMessage();
            AccountP.EditToField1Message(mail);
            //AccountP.UploadFiles();
            AccountP.SetSaveMessageButton();
            AccountP.SetOpenSavedMessage();

            Assert.AreEqual(AccountP.ToFieldMessage.GetAttribute("value"), mail);
            AccountP.SetSaveMessageButton();
        }
Exemplo n.º 30
0
        public void Excercise1(string url, string loginName, string password)
        {
            driver.Navigate().GoToUrl(url);
            var         homePage    = new HomePage(driver);
            LogInPage   loginPage   = homePage.ClickLogin();
            AccountPage accountPage = loginPage.LogIn(loginName, password);

            Assert.AreEqual(DateTime.Now.ToString("dd MMMM yyyy"), accountPage.GetDateText(), "Date is wrong");
            homePage = accountPage.ClickHome();
            var price = homePage.GetTheCheapestFeaturedHotelsPrice();

            Assert.Fail($"The cheapest Features Hotel is : '{homePage.GetTheCheapestFeaturedHotelsName(price)}' with Price: ${price}");
        }