public MessengerViewModel(ServiceManager serviceManager, MessagesPage page) { _random = new Random(); _parent = page; ServiceManager = serviceManager; _conversations = new ObservableCollection <Conversation>(); }
public void TabFunctionality() { LoginPage loginPage = new LoginPage(this.driver, this.wait); MessagesPage messagesPage = new MessagesPage(this.driver, this.wait); this.driver.Navigate().GoToUrl(this.baseUrl + "/dialysis/login"); this.driver.SwitchTo().ActiveElement().SendKeys(Keys.Tab); System.Threading.Thread.Sleep(1000); this.driver.SwitchTo().ActiveElement().SendKeys(Keys.Tab); System.Threading.Thread.Sleep(1000); this.driver.SwitchTo().ActiveElement().SendKeys(Keys.Enter); System.Threading.Thread.Sleep(1000); var emailMsg = messagesPage.GetEmailValidationMsg().Text; var passMsg = messagesPage.GetPasswordValidationMsg().Text; Assert.Multiple(() => { Assert.AreEqual("Email is required.", emailMsg, "[ERROR] Email error message is not displayed!"); Assert.AreEqual("Password is required.", passMsg, "[ERROR] Password error message is not displayed!"); }); }
public override void TestInitialize() { this.FriendsPage = new FriendsPage(); this.MessagesPage = new MessagesPage(); this.Browser.ClearCache(BrowserCacheType.Cookies); this.Browser.Refresh(); }
public override IEnumerable <DataObject> ProcessInternal(ClientBase client, ResponseContainer container) { HtmlDocument doc = container.ResponseHtml.Value; HtmlNodeCollection messageList = doc.DocumentNode.SelectNodes("//li[@data-msg-id]"); HtmlNodeCollection paginationItems = doc.DocumentNode.SelectNodes("//li[@data-tab and @data-page]"); if (messageList == null || paginationItems == null) { yield break; } MessagesPage result = new MessagesPage(); HtmlNode currentPageNode = doc.DocumentNode.SelectSingleNode("//li[@data-tab and not(@data-page)]"); string currentPageText = currentPageNode.InnerText.Split('/').First(); result.Page = int.Parse(currentPageText, NumberStyles.AllowThousands | NumberStyles.Integer, client.ServerCulture); foreach (HtmlNode item in paginationItems) { result.TabType = (MessageTabType)item.GetAttributeValue("data-tab", 0); int page = item.GetAttributeValue("data-page", 0); if (page > result.MaxPage) { result.MaxPage = page; } } foreach (HtmlNode node in messageList) { int msgId = node.GetAttributeValue("data-msg-id", 0); MessageType type = MessageType.Unknown; if (result.TabType == MessageTabType.FleetsEspionage) { bool hasDefText = node.SelectSingleNode(".//span[@class='espionageDefText']") != null; if (hasDefText) { type = MessageType.EspionageAction; } else { type = MessageType.EspionageReport; } } result.MessageIds.Add(Tuple.Create(msgId, type)); } yield return(result); }
public override void TestInitialize() { this.FriendsPage = new FriendsPage(); this.MessagesPage = new MessagesPage(); this.StartPageElements = new LoggedUserStartPageElements(); this.Browser.ClearCache(BrowserCacheType.Cookies); this.Browser.Refresh(); Manager.Current.Settings.Web.RecycleBrowser = true; }
private async Task OpenNotificationsAsync() { using (UserDialogs.Instance.Loading("Duke ngarkuar mesazhet")) { MessagesPage MessagesPage = new MessagesPage(); App.instance.MessagesViewModel = App.instance.MessagesViewModel != null ? App.instance.MessagesViewModel : new MessagesViewModel(); await App.instance.MessagesViewModel.GetMessages(); MessagesPage.BindingContext = App.instance.MessagesViewModel; (App.instance.MainPage as MainPage).IsPresented = false; await App.instance.PushAsyncNewPage(MessagesPage); } }
public void CloseButton() { LoginPage loginPage = new LoginPage(this.driver, this.wait); MessagesPage messagesPage = new MessagesPage(this.driver, this.wait); this.driver.Navigate().GoToUrl(this.baseUrl + "/dialysis/login"); loginPage.ClickOnCloseBtn(); var displayed = messagesPage.IsTitleDisplayed(); Assert.IsFalse(displayed, "Close button is not working"); }
public void IvalidCredentialsLogin(string email, string password) { LoginPage loginPage = new LoginPage(this.driver, this.wait); MessagesPage messagesPage = new MessagesPage(this.driver, this.wait); this.driver.Navigate().GoToUrl(this.baseUrl + "/dialysis/login"); loginPage.LoginUser(email, password); System.Threading.Thread.Sleep(2000); var msg = messagesPage.GetInvalidCombinationMsg().Text; Assert.AreEqual("Invalid email/password combination.", msg, "[ERROR] You log in with INVALID credentials!"); }
public void SuccessfulLogin(string email, string password, bool remember) { LoginPage loginPage = new LoginPage(this.driver, this.wait); MessagesPage messagesPage = new MessagesPage(this.driver, this.wait); LogoutPage logoutPage = new LogoutPage(this.driver, this.wait); this.driver.Navigate().GoToUrl(this.baseUrl + "/dialysis/login"); loginPage.LoginUser(email, password, remember); Assert.AreEqual(true, messagesPage.GetSuccessMessage(), "[ERROR] You didn't log in with valid credentials!"); logoutPage.UserLogout(); }
public void EmptyFiledsLogin() { LoginPage loginPage = new LoginPage(this.driver, this.wait); MessagesPage messagesPage = new MessagesPage(this.driver, this.wait); this.driver.Navigate().GoToUrl(this.baseUrl + "/dialysis/login"); loginPage.GetLoginBtn()?.Click(); var emailMsg = messagesPage.GetEmailValidationMsg().Text; var passMsg = messagesPage.GetPasswordValidationMsg().Text; Assert.Multiple(() => { Assert.AreEqual("Email is required.", emailMsg, "[ERROR] Email error message is not displayed!"); Assert.AreEqual("Password is required.", passMsg, "[ERROR] Password error message is not displayed!"); }); }
static void Main(string[] args) { User user = new User(); IWebDriver driver = new FirefoxDriver(); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(11)); RegistrationPageLocators registrationPageLocators = new RegistrationPageLocators(); RegistrationPage registrationPage = new RegistrationPage(driver); registrationPage.GoToRegistrationPage(driver); HomePage homePage = registrationPage.RegistrationUserSuccesful(user, wait, registrationPageLocators); HomePageLocators homePageLocators = new HomePageLocators(); MessagesPage messagesPage = homePage.GoToMessagesPage(driver, homePageLocators, wait); MessagesPageLocators messagesPageLocators = new MessagesPageLocators(); LastDialogPage lastDialogPage = messagesPage.GoToLastDialog(driver, messagesPageLocators, wait); LastDialogLocators lastDialogLocators = new LastDialogLocators(); Console.WriteLine("Last mesage : " + lastDialogPage.GetTextOfLastMessage(driver, lastDialogLocators, wait)); driver.Quit(); }
private async void OnOpenEntity() { var page = new MessagesPage(_ItemSelected.Description, _ItemSelected.Messages.ToList()); await Shell.Current.Navigation.PushAsync(page); }
public App() { InitializeComponent(); MainPage = new MessagesPage(); }