From 37cf53e97eeecd75ab0c70f1b3f8bcd0e7cf2d1a Mon Sep 17 00:00:00 2001 From: gdosreis Date: Wed, 19 Mar 2014 17:34:10 -0300 Subject: [PATCH 1/4] test23 --- README - Copy.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 README - Copy.md diff --git a/README - Copy.md b/README - Copy.md new file mode 100644 index 0000000..5c3a85c --- /dev/null +++ b/README - Copy.md @@ -0,0 +1,4 @@ +Bootstrap3Test +============== + +Testing bootstrap 3 basic functionality From 83b0c076fcf02ad594efa0ffba3b59e0549de57d Mon Sep 17 00:00:00 2001 From: gdosreis Date: Thu, 20 Mar 2014 10:46:31 -0300 Subject: [PATCH 2/4] otra subidaaaa --- README - Copy.md | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 README - Copy.md diff --git a/README - Copy.md b/README - Copy.md deleted file mode 100644 index 5c3a85c..0000000 --- a/README - Copy.md +++ /dev/null @@ -1,4 +0,0 @@ -Bootstrap3Test -============== - -Testing bootstrap 3 basic functionality From 4e7f66d2a819ceb7966c0de29df36cd644500441 Mon Sep 17 00:00:00 2001 From: gdosreis Date: Thu, 20 Mar 2014 11:27:59 -0300 Subject: [PATCH 3/4] test2 --- README - Copy.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 README - Copy.md diff --git a/README - Copy.md b/README - Copy.md new file mode 100644 index 0000000..5c3a85c --- /dev/null +++ b/README - Copy.md @@ -0,0 +1,4 @@ +Bootstrap3Test +============== + +Testing bootstrap 3 basic functionality From 87a3a9daaa61e85e5e4a5646d2c8c7986dcfc87c Mon Sep 17 00:00:00 2001 From: gdosreis Date: Thu, 20 Mar 2014 14:22:41 -0300 Subject: [PATCH 4/4] add new class --- PageLogin.cs | 152 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 PageLogin.cs diff --git a/PageLogin.cs b/PageLogin.cs new file mode 100644 index 0000000..11a5315 --- /dev/null +++ b/PageLogin.cs @@ -0,0 +1,152 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using OpenQA.Selenium; +using OpenQA.Selenium.Support.PageObjects; +using BaseLander; +using BaseLander.Util; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using OpenQA.Selenium.Chrome; +using OpenQA.Selenium.Support.UI; + + +namespace Test.LanderTestFW.Pages +{ + + public class PageLogin : TestBase + { + [FindsBy(How = How.Id, Using = "signup_email")] + private IWebElement Email; + + [FindsBy(How = How.Id, Using = "signup_password")] + private IWebElement Password; + + [FindsBy(How = How.Id)] + private IWebElement buttonLogin; + + [FindsBy(How = How.Id)] + private IWebElement forgotPassword; + + [FindsBy(How = How.Id)] + private IWebElement resetPasswordSubmit; + + [FindsBy(How = How.Id)] + private IWebElement resetPasswordSubmitButton; + + [FindsBy(How = How.CssSelector, Using = "label.comment-login.fail")] + private IWebElement Error; + + [FindsBy(How = How.CssSelector, Using = "[htmlfor=Password]")] + private IWebElement passwordError; + + [FindsBy(How = How.CssSelector, Using = "label[for=signup_email]")] + private IWebElement emailError; + + [FindsBy(How = How.ClassName, Using = "field-validation-error")] + private IWebElement loginError; + + [FindsBy(How = How.CssSelector, Using = "span.error-found.comment-login")] + private IWebElement Errors; + + [FindsBy(How = How.ClassName, Using = "validationContainer2")] + private IWebElement sent; + + private IWebDriver driver; + + private WebDriverWait wait; + + + public PageLogin(IWebDriver driver) + { + this.driver = driver; + PageFactory.InitElements(driver, this); + wait = new WebDriverWait(this.driver, new TimeSpan(0, 0, 30)); + } + + public void setEmail(string value) + { + wait.Until((d => Email.Displayed)); + Email.Clear(); + Email.SendKeys(value); + } + + protected override bool Condition() + { + throw new NotImplementedException(); + } + + public void setPassword(string value) + { + wait.Until((d => Password.Displayed)); + Password.Clear(); + Password.SendKeys(value); + } + + public void setNewEmail(string value) + { + wait.Until((d => resetPasswordSubmit.Displayed)); + resetPasswordSubmit.Clear(); + resetPasswordSubmit.SendKeys(value); + } + + public void pressLogInButton() + { + wait.Until((d => buttonLogin.Displayed)); + buttonLogin.Click(); + } + + public void pressForgotPassword() + { + wait.Until((d => forgotPassword.Displayed)); + forgotPassword.Click(); + } + + public void pressResetPassword() + { + wait.Until((d => resetPasswordSubmitButton.Displayed)); + resetPasswordSubmitButton.Click(); + } + + public string getForGotErrorMessage() { + wait.Until((d => Error.Displayed)); + return Error.Text; + } + + public string getPasswordErrorMessage() + { + wait.Until((d => passwordError.Displayed)); + return passwordError.Text.ToString(); + } + + public string getLoginErrorMessage() + { + wait.Until((d => Errors.Displayed)); + return Errors.Text.ToString(); + } + public string getEmailErrorMessage() + { + wait.Until((d => emailError.Displayed)); + return emailError.Text.ToString(); + } + + public string getSentMessage() + { + wait.Until((d => sent)); + return sent.Text.ToString(); + } + + public string getloginErrorMessage() + { + wait.Until((d => loginError.Displayed)); + return loginError.Text.ToString(); + } + + public OverallPage LogIn(string email,string pass) { + setEmail(email); + setPassword(pass); + pressLogInButton(); + return new OverallPage(this.driver); + } + } +}