コード例 #1
0
        public void passwordHint()
        {
            LoginPage loginPage = new LoginPage();
            HintPage  hintPage  = new HintPage();

            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
            loginPage.ClickHint();
            hintPage.enterEmail(Data.GetMailSacEmail());
            hintPage.clickSubmit();
            hintPage.clickCancel();

            /*
             * TODO Set this up in a new Tab
             * Driver.FindElement(By.TagName("body")).SendKeys(Keys.Control + "t");
             * Driver.SwitchTo().Window(Driver.WindowHandles.Last());
             */

            Driver.Navigate().GoToUrl("https://mailsac.com/login");
            MailSac mailSac = new MailSac();

            mailSac.LogIn(Data.GetMailSacUser(), Data.GetPassword());
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
            mailSac.ClickMaiBox();
            bool emailRecieved = mailSac.IsEmailReceived("Your Master Password Hint");

            Assert.That(emailRecieved, Is.True, "Can't find the email");
            //TODO: Change to only take screenshot of failed test cases
            GetScreenshot.TakeScreenshot();
            mailSac.DeleteEmail();
        }
コード例 #2
0
        public void CreateAccount()
        {
            LoginPage     loginPage = new LoginPage();
            CreateAccount account   = new CreateAccount();

            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
            loginPage.ClickCreate();
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
            account.enterAccountInfo(Data.GetNewAccountEmail(), "Test Account 2", Data.GetPassword(), "The Hint");
            account.ClickSubmit();
            account.ClickYesOnAlert();


            Driver.Navigate().GoToUrl("https://mailsac.com/login");
            MailSac mailSac = new MailSac();

            mailSac.LogIn(Data.GetMailSacUser(), Data.GetPassword());
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
            mailSac.ClickMailBox2();
            bool emailRecieved = mailSac.IsEmailReceived("Welcome");

            Assert.That(emailRecieved, Is.True, "Can't find the email");
            //TODO: Change to only take screenshot of failed test cases
            GetScreenshot.TakeScreenshot();
            mailSac.DeleteEmail();
        }
コード例 #3
0
        public void Login()
        {
            Driver.Navigate().GoToUrl("https://testdo.bitwarden.com");
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);

            LoginPage loginPage = new LoginPage();
            VaultPage vaultPage = new VaultPage();

            loginPage.EnterUserNameAndPassword(Data.GetEmail(), Data.GetPassword());
            loginPage.ClickLogin();

            Thread.Sleep(3000);

            Assert.AreEqual(Driver.Url, "https://testdo.bitwarden.com/#/vault", "URL doesn't match");
            GetScreenshot.TakeScreenshot();
        }