public void UnauthorizedUserNavigation() { using (IWebDriver driver = new ChromeDriver()) { WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(3)); var conferencesPage = new ConferencesPage(driver, wait); conferencesPage.NavigateTo(); conferencesPage.WaitForPartialViewAndClickSeeTalksLink(); Assert.Equal(SeeTalksTitle, driver.Title); TalksPage talksPage = conferencesPage.NavigateToAllTalks(); talksPage.EnsurePageLoaded(); } }
public void UnauthorizedUserRedirection() { using (IWebDriver driver = new ChromeDriver()) { WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(8)); var talksPage = new TalksPage(driver, wait); var loginPage = new LoginPage(driver, wait); talksPage.NavigateTo(); loginPage.Logoff(); talksPage.NavigateTo(); talksPage.ClickCreateTalkLink(); loginPage.EnsurePageLoaded(); driver.Navigate().Back(); talksPage.ClickDeleteFirstTalkLink(); loginPage.EnsurePageLoaded(); } }
public void CreateAndDeleteConference() { using (IWebDriver driver = new ChromeDriver()) { WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(8)); var talksPage = new TalksPage(driver, wait); var loginPage = new LoginPage(driver, wait); talksPage.NavigateTo(); loginPage.Logoff(); loginPage.NavigateTo(); loginPage.Login(AdminLogin, AdminPassword); var helloMessageOrRegisterLink = loginPage.HelloMessageOrRegisterLink(); Assert.Equal($"Hello {AdminLogin}!", helloMessageOrRegisterLink); talksPage.NavigateTo(); var talksListBeforeCreateNewTalk = talksPage.GetTalksList(); talksPage.ClickCreateTalkLink(); talksPage.FillCreateTalkFormAndSubmit("TitleTest", "AbstractTest"); talksPage.EnsurePageLoaded(); var talksListAfterCreateNewTalk = talksPage.GetTalksList(); Assert.Equal(talksListBeforeCreateNewTalk.Count, talksListAfterCreateNewTalk.Count - 1); Assert.Contains("TitleTest", talksListAfterCreateNewTalk.Last()); talksPage.ClickDeleteTalkLastLink(); Assert.Equal(DeleteTitle, driver.Title); talksPage.DeleteSubmit(); Assert.Equal(DeleteSuccessTitle, driver.Title); talksPage.ClickBackToListLink(); talksPage.EnsurePageLoaded(); var talksListAfterDeleteNewTalk = talksPage.GetTalksList(); Assert.Equal(talksListBeforeCreateNewTalk.Count, talksListAfterDeleteNewTalk.Count); Assert.DoesNotContain("TitleTest", talksListAfterDeleteNewTalk.Last()); } }
public void AuthorizedUserNavigation() { using (IWebDriver driver = new ChromeDriver()) { WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(8)); var talksPage = new TalksPage(driver, wait); var loginPage = new LoginPage(driver, wait); talksPage.NavigateTo(); loginPage.Logoff(); loginPage.NavigateTo(); loginPage.Login(AdminLogin, AdminPassword); var helloMessageOrRegisterLink = loginPage.HelloMessageOrRegisterLink(); Assert.Equal($"Hello {AdminLogin}!", helloMessageOrRegisterLink); talksPage.NavigateTo(); talksPage.ClickCreateTalkLink(); Assert.Equal(CreateTitle, driver.Title); driver.Navigate().Back(); talksPage.ClickDeleteFirstTalkLink(); Assert.Equal(DeleteTitle, driver.Title); } }