private async void btnSendLogs_Click_1(object sender, RoutedEventArgs e) { int selectedIndex = this.lstTestGroups.SelectedIndex; if (selectedIndex >= 0) { // Saves URL in local storage SavedAppInfo appInfo = await AppInfoRepository.Instance.GetSavedAppInfo(); string uploadUrl = this.txtUploadLogsUrl.Text; if (appInfo.LastUploadUrl != uploadUrl) { appInfo.LastUploadUrl = uploadUrl; await AppInfoRepository.Instance.SaveAppInfo(appInfo); } ZumoTestGroup testGroup = allTests[selectedIndex]; Popup popup = new Popup(); List<string> lines = new List<string>(); foreach (var test in testGroup.AllTests) { lines.Add(string.Format("Logs for test {0} (status = {1})", test.Name, test.Status)); lines.AddRange(test.GetLogs()); lines.Add("-----------------------"); } UploadLogsPage uploadLogsPage = new UploadLogsPage(testGroup.Name, string.Join("\n", lines), uploadUrl); popup.Child = uploadLogsPage; uploadLogsPage.CloseRequested += (snd, ea) => { popup.IsOpen = false; }; popup.IsOpen = true; } else { await Alert("Error", "A test group needs to be selected"); } }
private void lstTests_DoubleTapped_1(object sender, DoubleTappedRoutedEventArgs e) { int selectedGroup = this.lstTestGroups.SelectedIndex; if (selectedGroup >= 0) { ZumoTestGroup testGroup = allTests[selectedGroup]; int selectedTest = this.lstTests.SelectedIndex; List<ZumoTest> tests = testGroup.AllTests.ToList(); if (selectedTest >= 0 && selectedTest < tests.Count) { ZumoTest test = tests[selectedTest]; Popup popup = new Popup(); List<string> lines = new List<string>(); lines.Add(string.Format("Logs for test {0} (status = {1})", test.Name, test.Status)); lines.AddRange(test.GetLogs()); lines.Add("-----------------------"); UploadLogsPage uploadLogsPage = new UploadLogsPage(testGroup.Name, string.Join("\n", lines), null); popup.Child = uploadLogsPage; uploadLogsPage.CloseRequested += (snd, ea) => { popup.IsOpen = false; }; popup.IsOpen = true; } } }
private void lstTests_DoubleTapped_1(object sender, DoubleTappedRoutedEventArgs e) { int selectedGroup = this.lstTestGroups.SelectedIndex; if (selectedGroup >= 0) { ZumoTestGroup testGroup = allTests[selectedGroup]; int selectedTest = this.lstTests.SelectedIndex; List<ZumoTest> tests = testGroup.AllTests.ToList(); if (selectedTest >= 0 && selectedTest < tests.Count) { ZumoTest test = tests[selectedTest]; List<string> lines = new List<string>(); lines.Add(string.Format("Logs for test {0} (status = {1})", test.Name, test.Status)); lines.AddRange(test.GetLogs()); lines.Add("-----------------------"); UploadLogsPage uploadLogsPage = new UploadLogsPage(testGroup.Name, string.Join("\n", lines), null); uploadLogsPage.Display(); } } }