コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: fanslations/web
        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
                    },
                },
            };
        }
コード例 #2
0
ファイル: PlayWindow.xaml.cs プロジェクト: fanslations/web
        public PlayWindow(MainWindow parent, IWebDriver webDriver, TestCaseHtml testCase)
        {
            InitializeComponent();

            _parent    = parent;
            _webDriver = webDriver;
            _testCase  = testCase;

            _testLogService = new TestLogService();
        }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: fanslations/web
        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);
                }
            }
        }