Exemple #1
0
        public void ShouldBeAbleToLogin()
        {
            var outPutDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            _driver = new FirefoxDriver(outPutDirectory);
            var HomePO = new HomePO(_driver);

            HomePO.Visit();
            HomePO.FillForm("standard_user", "secret_sauce");
            HomePO.SubmitForm();

            Assert.IsTrue(_driver.Url.Contains("inventory.html"));
        }
Exemple #2
0
        public void ShouldNotBeAbleToLogin()
        {
            var outPutDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            _driver = new FirefoxDriver(outPutDirectory);
            var HomePO = new HomePO(_driver);

            HomePO.Visit();
            HomePO.FillForm("WrongUser", "Admin1234");
            HomePO.SubmitForm();

            IWebElement err_message = _driver.FindElement(By.XPath("/html/body/div[2]/div[1]/div/div/form/h3"));

            Assert.IsTrue(err_message.Displayed);
        }