Exemplo n.º 1
0
        public async Task Initialize()
        {
            _driver = WebDriverUtils.InitializeChromeDriver();
            _client = new DocmsApiClient("docms-client", Constants.TestUrlBase);
            await DocumentUtils.ClearAllAsync(_client.CreateDocumentClient()).ConfigureAwait(false);

            WebDriverUtils.LoginAsAdmin(_driver);
        }
Exemplo n.º 2
0
        public void RedirectToLoginPageWhenLogout()
        {
            WebDriverUtils.LoginAsAdmin(_driver);
            var navbarSettingsDropdownLink = _driver.FindElement(By.CssSelector("#navbarSettingsDropdown"));

            navbarSettingsDropdownLink.Click();
            var logoutButton = _driver.FindElement(By.CssSelector("form[action='/account/logout'] button[type=submit]"));

            logoutButton.Click();
            Assert.AreEqual(Constants.UrlFor("/account/login?returnUrl=%2F"), _driver.Url);
            Assert.IsNull(_driver.Manage().Cookies.GetCookieNamed(".AspNetCore.Identity.Application"));
        }
Exemplo n.º 3
0
 public void RedirectToFileListWhenLoginSucceeded()
 {
     WebDriverUtils.LoginAsAdmin(_driver);
     Assert.AreEqual(Constants.UrlFor("/files/view"), _driver.Url);
     Assert.IsNotNull(_driver.Manage().Cookies.GetCookieNamed(".AspNetCore.Identity.Application"));
 }