public void RefreshWindow() { var json = new WebClient().DownloadString("http://localhost:8000/testcase/index"); var model = JsonHelper.Deserialize <TestCaseModel>(json); var testLogs = new TestLogService().GetLogs(); _mainModel = new MainModel() { TestCases = new ObservableCollection <TestCaseHtml>(model.TestCases.OrderByDescending(o => o.Date).ThenBy(o => o.Name).Select(s => { var testLog = testLogs.OrderByDescending(o => o.Date).FirstOrDefault(w => w.TestCase.Url == s.Url); if (testLog != null) { s.IsPassed = testLog.IsPassed; s.TestedDate = testLog.Date; } return(s); })), Browsers = new[] { new Browser { Name = "Firefox", WorkingLevel = 1 }, new Browser { Name = "Chrome", WorkingLevel = 2 }, //new Browser { Name = "Edge", WorkingLevel = 9 }, new Browser { Name = "Internet Explorer", WorkingLevel = 9 }, }, }; }
public PlayWindow(MainWindow parent, IWebDriver webDriver, TestCaseHtml testCase) { InitializeComponent(); _parent = parent; _webDriver = webDriver; _testCase = testCase; _testLogService = new TestLogService(); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var testLogs = new TestLogService().GetLogs(); var testLog = testLogs.Where(w => w.TestCase.Url == value.ToString()).OrderByDescending(o => o.Date).FirstOrDefault(); if (testLog == null) { return("N/A"); } else { if (testLog.IsPassed) { return("✓ " + testLog.Date);; } else { return("Ⓔ " + testLog.Date); } } }