Example #1
0
 public void LogInToMailboxUsingSingleton()
 {
     IWebDriver driver = WebDriverSingleton.GetInstance();
     driver.Navigate().GoToUrl("https://mail.ru/");
     LoginPage lp = new LoginPage(driver);
     lp.SetUserNamePassword();
     MainPage mp = lp.ClickLoginButton();
     Assert.IsTrue(mp.loginEmail.Text.ToLower().Equals(lp.Email));
     mp.LogOut();
     WebDriverSingleton.CloseDriver();
 }
Example #2
0
 public void LogInToMailboxUsingFactory()
 {
     WebDriverCreator creator = new ChromeDriverCreator();
     IWebDriver driver = creator.FactoryMethod();
     driver.Navigate().GoToUrl("https://mail.ru/");
     LoginPage lp = new LoginPage(driver);
     lp.SetUserNamePassword();
     MainPage mp = lp.ClickLoginButton();
     Assert.IsTrue(mp.loginEmail.Text.ToLower().Equals(lp.Email));
     mp.LogOut();
     driver.Quit();
 }
Example #3
0
 public void LogInToMailboxUsingFactory()
 {
     driver = new ChromeDriver(driverPath);
     driver.Manage().Window.Maximize();
     IWebDriver decorDriver = new Decorator(driver);
     decorDriver.Navigate().GoToUrl("https://mail.ru/");
     LoginPage lp = new LoginPage(decorDriver);
     lp.SetUserNamePassword();
     MainPage mp = lp.ClickLoginButton();
     Assert.IsTrue(mp.loginEmail.Text.ToLower().Equals(lp.Email));
     mp.LogOut();
     driver.Quit();
 }
Example #4
0
 public void Test3_SendMessage()
 {
     LoginPage lp = new LoginPage(_driver);
     lp.SetUserNamePassword();
     MainPage mp = lp.ClickLoginButton();
     mp.NavigateToDraft();
     NewMessagePage nmp = mp.SelectMessageFromDraft();
     nmp.SendMessage();
     nmp.NavigateToDraft();
     Assert.IsFalse(Verifier.VerifyMessageExistInFolder(By.XPath(mp.messageXpath), "Message not exist in Draft folder"));
     mp.NavigateToSent();
     Assert.IsTrue(Verifier.VerifyMessageExistInFolder(By.XPath(mp.messageXpath), "Message not exist in Sent folder"));
     mp.LogOut();
 }
Example #5
0
 public void Test1_LogInToMailbox()
 {
     XmlConfigurator.Configure();
     Logger.Debug("Started Test1");
     LoginPage lp = new LoginPage(_driver);
     Logger.Info("Open LoginPage");
     lp.SetUserNamePassword();
     Logger.Warn("Enetr username and password...");
     MainPage mp = lp.ClickLoginButton();
     Assert.IsTrue(mp.loginEmail.Text.ToLower().Equals(lp.Email));
     Logger.Error("Assert passed");
     Utils.HighlightElement(mp.loginEmail);
     mp.LogOut();
     Logger.Fatal("Test finished!");
 }
Example #6
0
 public void Test2_CreateNewMessageAndSave()
 {
     XmlConfigurator.Configure();
     Logger.Debug("Started Test2");
     LoginPage lp = new LoginPage(_driver);
     Logger.Info("Open LoginPage");
     lp.SetUserNamePassword();
     Logger.Warn("Enetr username and password...");
     MainPage mp = lp.ClickLoginButton();
     Logger.Info("Login to Mailbox");
     NewMessagePage nmp = mp.CreateNewMessage();
     Logger.Info("Create New Message");
     nmp.FillTextFields();
     Logger.Info("Fill the fields");
     nmp.SaveAsDraft();
     Logger.Info("Save as Draft");
     nmp.NavigateToDraft();
     Logger.Info("Check Draft folder");
     Assert.IsTrue(_driver.FindElement(By.XPath(mp.messageXpath)).Displayed);
     Logger.Error("Assert passed");
     mp.LogOut();
 }