Exemplo n.º 1
0
        /// <summary>
        /// The methods provided in this section are simply used to allow
        /// NavigationHelper to respond to the page's navigation methods.
        /// <para>
        /// Page specific logic should be placed in event handlers for the
        /// <see cref="NavigationHelper.LoadState"/>
        /// and <see cref="NavigationHelper.SaveState"/>.
        /// The navigation parameter is available in the LoadState method
        /// in addition to page state preserved during an earlier session.
        /// </para>
        /// </summary>
        /// <param name="e">Provides data for navigation methods and event
        /// handlers that cannot cancel the navigation request.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.Parameter != null && e.Parameter.ToString().Equals("remove"))
            {
                removeParameter = "remove"; Frame.BackStack.Clear();
            }
            Apps app = AppInstance.app;

            updateTile();
            Init();
            if (app.Type.Contains("Info"))
            {
                AppReader.readInfoFile(app.Name); page = typeof(InfoPage);
            }
            else if (app.Type.Contains("Flash"))
            {
                AppReader.readFlashFile(app.Name); page = typeof(FlashCardPage);
            }
            else if (app.Type.Contains("Quiz"))
            {
                AppReader.readQuizFile(app.Name); QuizModel.clearInstance(); page = typeof(QuizPage);
            }
            else if (app.Type.Contains("Spellings"))
            {
                AppReader.readSpellingsFile(app.Name); SpellingsModel.clearInstance(); page = typeof(SpellingsPage);
            }
            else
            {
                Frame.GoBack();
            }
            this.navigationHelper.OnNavigatedTo(e);
            AppLogo.Source = new BitmapImage(new Uri(app.AppIcon));
            AppName.Text   = app.Name;
            AppAuthor.Text = app.Author;
        }
Exemplo n.º 2
0
        private static string GetTokenParameter(string aPIname)
        {
            string TokenValue = "";

            aPIname.Replace(" ", "");
            switch (aPIname.ToLower().Trim())
            {
            case "thematicarea":
                TokenValue = "TAToken";
                break;

            case "localauthority":
                TokenValue = "LAToken";
                break;

            case "partnerdetails":
                TokenValue = "PartnerToken";
                break;

            case "contact":
                TokenValue = "ContactToken";
                break;

            case "partneropportunity":
                TokenValue = "PartnerOppToken";
                break;

            case "sites":
                TokenValue = "SiteToken";
                break;

            case "placeopportunity":
                TokenValue = "PlaceOppToken";
                break;

            case "associateopportunities":
                TokenValue = "APPOToken";
                break;

            case "associatepartners":
                TokenValue = "APPToken";
                break;

            default:
                TokenValue = "InvalidToken";
                break;
            }

            if (StaticObjectRepo.Environment.ToLower().Equals("tst"))
            {
                return(AppReader.GetConfigValue(TokenValue + "Tst"));
            }
            else
            {
                return(AppReader.GetConfigValue(TokenValue + "Dev"));
            }
        }
Exemplo n.º 3
0
        public static void InitialiseReport()
        {
            var htmlReporter = new ExtentV3HtmlReporter($@"{reportsDirectory}\APITestReport {DateTime.Now.ToString("dd-MMM-yy hh-mm")}.html");

            htmlReporter.Config.Theme         = AventStack.ExtentReports.Reporter.Configuration.Theme.Dark;
            htmlReporter.Config.ReportName    = AppReader.GetConfigValue("Project");
            htmlReporter.Config.DocumentTitle = "Automation Testing Report";

            //StaticObjectRepo.Reporter = null; //$@"{reportsDirectory}\\{DateTime.Now.ToString("dd-MMM-yy")}.html", false);

            StaticObjectRepo.Reporter.AttachReporter(htmlReporter);

            StaticObjectRepo.Reporter.AddSystemInfo("Tester", Environment.UserName);
            StaticObjectRepo.Reporter.AddSystemInfo("Environment", AppReader.GetConfigValue("Env").ToUpper());
            //StaticObjectRepo.Reporter.AddSystemInfo("Browser", AppReader.GetConfigValue("Browser").ToUpper());
            StaticObjectRepo.Reporter.AddSystemInfo("Machine", Environment.MachineName);
            StaticObjectRepo.Reporter.AddSystemInfo("OS", Environment.OSVersion.VersionString);
            StaticObjectRepo.Reporter.AddSystemInfo("Execution Date", DateTime.Now.ToString("D"));
            StaticObjectRepo.Reporter.AddSystemInfo("Execution Time", DateTime.Now.ToString("T"));
        }
Exemplo n.º 4
0
        public static void SetBaseURL(string aPIname)
        {
            string BaseURL = "";

            switch (aPIname.ToLower().Trim())
            {
            case "thematicarea":
                BaseURL = "TABase";
                break;

            case "localauthority":
                BaseURL = "LABase";
                break;

            case "partnerdetails":
                BaseURL = "PartnerBase";
                break;

            case "contact":
                BaseURL = "ContactBase";
                break;

            case "partneropportunity":
                BaseURL = "PartnerOppBase";
                break;

            case "sites":
                BaseURL = "SiteBase";
                break;

            case "placeopportunity":
                BaseURL = "PlaceOppBase";
                break;

            case "associateopportunities":
                BaseURL = "APPOBase";
                break;

            case "associatepartners":
                BaseURL = "APPBase";
                break;

            default:
                Console.WriteLine("\n Token not found for {0}", aPIname);
                break;
            }

            if (!String.IsNullOrEmpty(BaseURL))
            {
                if (StaticObjectRepo.Environment.ToLower().Equals("tst"))
                {
                    StaticObjectRepo.BaseURL = AppReader.GetConfigValue(BaseURL + "Tst");
                }
                else
                {
                    StaticObjectRepo.BaseURL = AppReader.GetConfigValue(BaseURL + "Dev");
                }
            }
            else
            {
                StaticObjectRepo.BaseURL = "";
            }
        }