public TestEvent OpenEventDetails(TestEvent @event) { VisitEventsList(); CreateEvent(@event); GetPastEvents()[0].ClickLink(@event.Name); browser.WaitForAjax(); return @event; }
/// <summary> /// We should be on events page /// </summary> public TestEvent CreateEvent(TestEvent @event) { browser.ClickButton("createEventButton"); FillEditor(@event); browser.ClickButton("modalOkButton"); browser.WaitForAjax(); return @event; }
private void AssertEvent(TestEvent e) { Assert.True(Browser.HasContent(e.Name)); Assert.True(Browser.HasContent(e.StartDate)); Assert.True(Browser.HasContent(e.Description)); var bros = Browser.FindAllCss("#module-event-details ul.list-group li").ToList(); Assert.AreEqual(e.Bros.Count, bros.Count()); Assert.True(e.Bros.All(b => bros.Any(be => be.HasContent(b)))); }
public void ShouldUpdateEvent() { eventSupport.OpenEventDetails(new TestEvent { Name = "Event Name", StartDate = "01-09-2013", Bros = defaultBros, Description = "Event Description" }); var ue = new TestEvent { Name = "Updated Name", StartDate = "01-09-2014", Bros = new List<string> { "Копыч", "Сильвер" }, Description = "Updated Description" }; Browser.ClickButton("Edit"); eventSupport.FillEditor(ue); Browser.ClickButton("Save"); Browser.WaitForAjax(); AssertEvent(ue); }
/// <summary> /// We should be in event editor /// </summary> public void FillEditor(TestEvent e) { browser.FillIn("Name").With(e.Name); browser.FillIn("StartDate").With(e.StartDate); browser.FillIn("Description").With(e.Description); foreach (var checkbox in GetActiveBroCheckboxes()) { checkbox.Click(); } foreach (string bro in e.Bros) { browser.ClickButton(bro); } }
private void AssertEvent(ElementScope row, TestEvent e) { Assert.AreEqual(e.Name, row.FindCss("a").Text); Assert.AreEqual(e.StartDate, row.FindCss("small").Text); }