Beispiel #1
0
        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];
                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);
                await uploadLogsPage.Display();
            }
            else
            {
                await Alert("Error", "A test group needs to be selected");
            }
        }
Beispiel #2
0
        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();
                }
            }
        }