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); }
public void WhenEndUserNavigatesToInvoicePage(string hotelName) { AccountPage accountPage = new AccountPage(driver); accountPage.InvoiceButton(hotelName).Click(); accountPage.GoInvoicePage(); }
public BaseSteps() { HomePage = PageFactory.HomePage; RegistrationPage = PageFactory.RegistrationPage; RegistrationStartPage = PageFactory.RegistrationStartPage; AccountPage = PageFactory.AccountPage; }
public LoginFacade(UserLoginPage userLoginPage, AdminLoginPage adminLoginPage, AccountPage accountPage, DashboardPage dashboardPage) { _accountPage = accountPage; _adminLoginPage = adminLoginPage; _dashboardPage = dashboardPage; _userLoginPage = userLoginPage; }
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(); }
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); }
public void CheckMails() { AccountPage AccountP = new AccountPage(driver); Assert.AreEqual("Невелика довідка про можливості пошти", AccountP.Message1.Text); Assert.AreEqual("Ласкаво просимо на I.UA!", AccountP.Message2.Text); }
private void BackClick_ToAccountPage(object sender, RoutedEventArgs e) { AccountPage accPage = new AccountPage(user); accPage.Show(); this.Close(); }
public void CheckYourEmail() { AccountPage AccountP = new AccountPage(driver); AccountP.SetAccountTitle(); Assert.AreEqual("*****@*****.**", AccountP.AccountTitle.Text); }
public AccountPage GoToAccountPage() { var accountPage = new AccountPage(webDriver); AccountBtn.Click(); return(accountPage); }
public void UploadFiles() { AccountPage AccountP = new AccountPage(driver); AccountP.SetOpenSavedMessage(); AccountP.UploadFileToMessage(); }
// [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"); }
public override void OneTimeSetUp() { driver = WebDriverFactory.GetInstance(); AccountPage accountPage = Navigator.NavigateToInbox(driver); //AccountPage accountPage = new AccountPage(driver); accountPage.SetCreateMEssage(); }
public void CheckPopup() { AccountPage AccountP = new AccountPage(driver); AccountP.MoveOnMessage(); Thread.Sleep(1000); AccountP.SetWaitTranslateButton(); }
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(); }
public void ThenHotelIsDisplayed() { AccountPage accountPage = new AccountPage(driver); Thread.Sleep(3500); accountPage.scrollToelement(); accountPage.elementIsDisplayed(); }
public void ProfileUpdateTest() { Log.Information("Profile update test starting..."); AccountPage account = AccountPage.Instance; account.open(); account.updateUser(); Log.Information("Profile update test finished"); }
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()); }
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); }
static NavigationManager() { //SINGLE PAGES accounts = new AccountPage(); //groups = new GroupsPage(); import = new ImportPage(); //reconcile = new ReconcilePage(); rules = new RulesPage(); modifyRules = new ModifyRules(); }
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(); }
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 }
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); }
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(); }
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(); }
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}"); }