public ExtentReporter(string reportName, TargetEnvironment environment, string reportFileName = "")
        {
            Extent    = new ExtentReports();
            Features  = new Dictionary <string, ExtentTest>();
            Scenarios = new Dictionary <string, ExtentTest>();

            ReportFolder = Path.Combine(Directory.GetParent(AppDomain.CurrentDomain.BaseDirectory).Parent.Parent.FullName, "TestResults");

            if (!Directory.Exists(ReportFolder))
            {
                Directory.CreateDirectory(ReportFolder);
            }

            Reporter = new ExtentHtmlReporter($@"{ReportFolder}\");
            Reporter.Config.DocumentTitle = "Automated Test Report";
            Reporter.Config.ReportName    = $"{reportName}";
            Reporter.Config.Theme         = AventStack.ExtentReports.Reporter.Configuration.Theme.Standard;
            Extent.AttachReporter(Reporter);
            Extent.AddSystemInfo("Report Name", reportName);
            Extent.AddSystemInfo("Environment", environment.ToString());
            Extent.AddSystemInfo("Machine", Environment.MachineName);
            Extent.AddSystemInfo("OS", Environment.OSVersion.VersionString);

            ReportFileName = reportFileName;
        }
        public IEnumerable <string> GetScriptsForEnvironment(TargetEnvironment environment)
        {
            var env = environment.ToString().ToLowerInvariant();

            var modules = AppDef.Element("application")
                          .Element("modules");

            if (modules == null)
            {
                return(Enumerable.Empty <string>());
            }

            var module = modules.Elements("module").Where(
                m => m.Attribute("environment").Value.ToLowerInvariant() == env);

            if (module == null)
            {
                return(Enumerable.Empty <string>());
            }

            var excluded = new List <string> {
                "_package_start.js", "_package_end.js"
            };

            var files = module.Elements("file")
                        .Where(f => !excluded.Contains(f.Value.ToLowerInvariant()))
                        .Select(f => f.Value);

            return(files);
        }
Beispiel #3
0
        public DbCommand CreateCommand(TargetEnvironment targetEnvironment = TargetEnvironment.User)
        {
            DbCommand command = null;

            switch (targetEnvironment)
            {
            case TargetEnvironment.Master:
                command = _masterConnection.CreateCommand();
                break;

            case TargetEnvironment.Tenant:
                command = _tenantConnection.CreateCommand();
                break;

            case TargetEnvironment.User:
                //NOTE: Kept for future enhancement support. The developer needs to call the SetClaimsContext
                //on the DatabaseProvider class instance to initialize the
                //connection to a specific users group db account
                command = _tenantConnection.CreateCommand();
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(targetEnvironment), targetEnvironment, null);
            }

            return(command);
        }
        public ForgotPasswordPage(FluentTest test) : base(test)
        {
            Url = TargetEnvironment.GetApplicationUrl("/#/forgot-password");
            At  = () => I.Expect.Exists(EmailInput);

            _server = SimpleSmtpServer.Start(25);
        }
Beispiel #5
0
 public WeorderPOSClient(string baseUri,
                         HttpClient httpClient,
                         string accessToken            = null,
                         ILoggerFactory loggerFactory  = null,
                         TargetEnvironment environment = TargetEnvironment.STAGING) : base(httpClient, accessToken, loggerFactory)
 {
     SetBaseUri(environment == TargetEnvironment.PRODUCTION ? "https://poshub.weorder.com" : environment == TargetEnvironment.STAGING ? "https://staging-poshub.snappo.com" : "http://82.196.1.109");
 }
        public WeorderOrderingClient(HttpClient httpClient,
                                     string accessToken            = null,
                                     ILoggerFactory loggerFactory  = null,
                                     TargetEnvironment environment = TargetEnvironment.STAGING) : base(httpClient, accessToken, loggerFactory)
        {
            SetBaseUri(environment == TargetEnvironment.PRODUCTION ? OrderingUrls.PRODUCTION : environment == TargetEnvironment.STAGING ? OrderingUrls.STAGING : OrderingUrls.QA);

            _integrationsClient  = new IntegrationsClient(this);
            _ordersClient        = new OrdersClient(this);
            _inventoryClient     = new InventoryClient(this);
            _tableSessionsClient = new TableSessionsClient(this);
        }
 public static string GetServiceUrl( TargetEnvironment env = TargetEnvironment.Live )
 {
    switch ( env )
    {
       case TargetEnvironment.Local:
       {
          return "http://desktop-or80phq/PixelPrinterService";
       }
       case TargetEnvironment.Live:
       default:
       {
          return "https://pixelprinter.azurewebsites.net";
       }
    }
 }
      public static async Task<string> GetAuthToken( TargetEnvironment env = TargetEnvironment.Live )
      {
         try
         {
            var mobileService = new MobileServiceClient( GetServiceUrl( env ) );
            mobileService.AlternateLoginHost = new Uri( GetServiceUrl( TargetEnvironment.Live ) );
            var user = await mobileService.LoginAsync( MobileServiceAuthenticationProvider.Google );

            return user.MobileServiceAuthenticationToken;
            //return string.Join( ",", new string[] { user.MobileServiceAuthenticationToken, user.UserId } );
         }
         catch ( Exception ex )
         {
            return null;
         }
      }
Beispiel #9
0
        public iBanFirstClient(HttpClient httpClient,
                               string userName               = null,
                               string clientSecret           = null,
                               ILoggerFactory loggerFactory  = null,
                               TargetEnvironment environment = TargetEnvironment.SANDBOX)
            : base(httpClient, userName, clientSecret, loggerFactory)
        {
            SetBaseUri(environment == TargetEnvironment.PRODUCTION ? iBanFirstUrls.PRODUCTION : iBanFirstUrls.SANDBOX);

            _walletsClient              = new WalletsClient(this);
            _financialMovementsClient   = new FinancialMovementsClient(this);
            _externalBankAccountsClient = new ExternalBankAccountsClient(this);
            _paymentsClient             = new PaymentsClient(this);
            _tradesClient    = new TradesClient(this);
            _documentsClient = new DocumentsClient(this);
            _logsClient      = new LogsClient(this);
        }
        public static IEnvironmentHelper CreateHelper(TargetEnvironment target, string version)
        {
            switch (target)
            {
            case TargetEnvironment.CSharp:
                return(new EnvironmentCSharp(target, version));

            case TargetEnvironment.OracleDb:
                return(new EnvironmentOracleDb(target, version));

            case TargetEnvironment.SqlServer:
                return(new EnvironmentSqlServer(target, version));

            case TargetEnvironment.Sqlite:
                return(new EnvironmentSqliteDb(target, version));

            default:
                throw new GlException("Target environment not implemented. {0}", target);
            }
        }
Beispiel #11
0
        protected override void Prepare(IOutputAppender outputAppender)
        {
            if (AffiliateApplicationName.IsNullOrEmpty())
            {
                throw new ArgumentNullException(nameof(AffiliateApplicationName));
            }
            if (EnvironmentSettingsAssemblyFilePath.IsNullOrEmpty())
            {
                throw new ArgumentNullException(nameof(EnvironmentSettingsAssemblyFilePath));
            }
            if (TargetEnvironment.IsNullOrEmpty())
            {
                throw new ArgumentNullException(nameof(TargetEnvironment));
            }

            DeploymentContext.TargetEnvironment = TargetEnvironment;
            if (!EnvironmentSettingOverridesTypeName.IsNullOrEmpty())
            {
                DeploymentContext.EnvironmentSettingOverridesType = ResolveEnvironmentSettingOverridesType(outputAppender);
            }
        }
Beispiel #12
0
        public IEnumerable<string> GetScriptsForEnvironment( TargetEnvironment environment )
        {
            var env = environment.ToString().ToLowerInvariant();

            var modules = AppDef.Element( "application" )
                    .Element( "modules" );

            if( modules == null ) return Enumerable.Empty<string>();

            var module = modules.Elements( "module" ).Where(
                m => m.Attribute( "environment" ).Value.ToLowerInvariant() == env );

            if( module == null ) return Enumerable.Empty<string>();

            var excluded = new List<string> { "_package_start.js", "_package_end.js" };

            var files = module.Elements( "file" )
                .Where( f => !excluded.Contains( f.Value.ToLowerInvariant() ) )
                .Select( f => f.Value );
            return files;
        }
        private void SetupIoCContainer(TargetEnvironment targetEnvironment)
        {
            const string settingsFile = "settings.json";

            if (System.IO.File.Exists(settingsFile))
            {
                var text     = System.IO.File.ReadAllText(settingsFile);
                var settings = JsonConvert.DeserializeObject <AppSettings>(text);
                ioc.RegisterCustomShared <AppSettings>(() => settings);
            }
            else
            {
                ioc.RegisterCustomShared <AppSettings>(() => new AppSettings(null, null, null, null, null));
            }

            switch (targetEnvironment)
            {
            case TargetEnvironment.Production:
                ioc.RegisterShared <IAppSettings, ProductionRavenNestStreamSettings>();
                break;

            case TargetEnvironment.Staging:
                ioc.RegisterShared <IAppSettings, StagingRavenNestStreamSettings>();
                break;

            case TargetEnvironment.Local:
                ioc.RegisterShared <IAppSettings, LocalRavenNestStreamSettings>();
                break;
            }

            ioc.RegisterCustomShared <IIoC>(() => ioc);

            ioc.RegisterShared <IPlayerManager, PlayerManager>();
            ioc.RegisterShared <ILogger, SDK.ConsoleLogger>();
            ioc.RegisterShared <IGameCache, GameCache>();
            ioc.RegisterShared <IGameManager, GameManager>();
            ioc.RegisterShared <IRavenNestClient, RavenNestClient>();
            ioc.RegisterShared <IGameClient, GameClient>();
            ioc.RegisterShared <EventTriggerSystem, EventTriggerSystem>();
        }
Beispiel #14
0
 public EnvironmentCSharp(TargetEnvironment target, string version)
     : base(target, version)
 {
 }
Beispiel #15
0
 public void GivenTheFeatureIsAvailableIn(string p0)
 {
     TargetEnvironment.Set(p0);
 }
Beispiel #16
0
 public void SetTargetEnv(TargetEnvironment target, uint version)
 {
     shaderc_compile_options_set_target_env(_handle, target, version);
 }
 public void AddTargetEnvironment(TargetEnvironment targetEnvironment)
 {
     _releaseTask.TargetEnvironments.Add(targetEnvironment);
 }
 public void Initialize(TargetEnvironment targetEnvironment)
 {
     _targetEnvironment = targetEnvironment;
 }
Beispiel #19
0
 protected void SetEnvironment(TargetEnvironment target)
 {
     this.Environment = Importer.Genie.Lamp.GenieLampUtils.GetEnvironmentHelper(target);
 }
 public IoCContainerRegistry(IIoC ioc, TargetEnvironment targetEnvironment)
 {
     this.ioc = ioc;
     SetupIoCContainer(targetEnvironment);
 }
        public bool SetEnvironment(string hostname, bool keepDefaults = true)
        {
            // get ip address
            var ip = Environments.FirstOrDefault(s => s.Hostname == hostname)?.IpAddress;

            if (ip == null)
            {
                return(false);
            }

            // generate 'hostconfig' file data
            var hostEntries = new List <string>();

            foreach (var item in Domains)
            {
                hostEntries.Add($"{ip} {item.DomainName}");
            }

            var header = $"# hosts configuration autogenerated for environment '{hostname}' {Environment.NewLine}# at '{DateTime.Now.ToLongDateString()} {DateTime.Now.ToLongTimeString()}' by '{Environment.UserName}'";

            try
            {
                // identify OS
                var osPlatform = this.GetOSPlatform();
                switch (osPlatform.ToString().ToLower())
                {
                case "windows":
                {
                    // create backup copy
                    var hostconfigPath = @"c:\Windows\System32\Drivers\etc\hosts";
                    File.Copy(hostconfigPath, hostconfigPath + ".bak", true);

                    // copy accordingly
                    using (var sr = new StreamWriter(hostconfigPath))
                    {
                        if (keepDefaults)
                        {
                            sr.WriteLine(this.LoadDefault());
                        }
                        sr.WriteLine(header);
                        sr.WriteLine();
                        foreach (var line in hostEntries)
                        {
                            sr.WriteLine(line);
                        }
                        sr.Close();
                    }

                    // update current environment
                    CurrentEnvironment = Environments.FirstOrDefault(s => s.Hostname == hostname);
                }
                break;

                case "osx":
                {
                    // create backup copy
                    var hostconfigPath = @"/etc/hosts";
                    File.Copy(hostconfigPath, hostconfigPath + ".bak", true);

                    // copy accordingly
                    using (var sr = new StreamWriter(hostconfigPath))
                    {
                        if (keepDefaults)
                        {
                            sr.WriteLine(this.LoadDefault());
                        }
                        sr.WriteLine(header);
                        sr.WriteLine();
                        foreach (var line in hostEntries)
                        {
                            sr.WriteLine(line);
                        }
                        sr.Close();
                    }
                    // update current environment

                    CurrentEnvironment = Environments.FirstOrDefault(s => s.Hostname == hostname);
                    break;
                }

                default:
                    throw new Exception($"Unsupported OS: {osPlatform.ToString()}");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return(false);
            }

            return(true);
        }
 public AssetEnvironment(TargetEnvironment env, IEnumerable <Asset> resources)
 {
     this.TargetEnvironment = env;
     this.Resources         = resources.ToList();
 }
Beispiel #23
0
        private void UpdateRpsServerConfig(string xmlConfigFile, string xmlTargetFile, string certificateName, LiveIdInstanceType instance, TargetEnvironment environment, string proxy, uint siteId, string siteName, uint accrualSiteId, string accrualSiteName, string rpsNetworkProd, string rpsNetworkInt, string internalSiteName, string o365SiteName)
        {
            base.WriteVerbose(Strings.AboutToUpdateCongigFile(xmlConfigFile, siteId.ToString()));
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.Load(xmlConfigFile);
            XmlElement documentElement = xmlDocument.DocumentElement;

            try
            {
                string  text    = "/RPSServer/CryptoParams/CryptoEncCertName";
                XmlNode xmlNode = documentElement.SelectSingleNode(text);
                if (xmlNode == null)
                {
                    throw new XmlMissingElementException(new LocalizedString(text));
                }
                xmlNode.InnerText = certificateName;
                text    = "/RPSServer/CryptoParams/CryptoSignCertName";
                xmlNode = documentElement.SelectSingleNode(text);
                if (xmlNode == null)
                {
                    throw new XmlMissingElementException(new LocalizedString(text));
                }
                xmlNode.InnerText = certificateName;
                if (!string.IsNullOrEmpty(rpsNetworkProd))
                {
                    text    = "/RPSServer/Environment/Production";
                    xmlNode = documentElement.SelectSingleNode(text);
                    if (xmlNode == null)
                    {
                        throw new XmlMissingElementException(new LocalizedString(text));
                    }
                    xmlNode.InnerText = rpsNetworkProd;
                }
                if (!string.IsNullOrEmpty(rpsNetworkInt))
                {
                    text    = "/RPSServer/Environment/INT";
                    xmlNode = documentElement.SelectSingleNode(text);
                    if (xmlNode == null)
                    {
                        throw new XmlMissingElementException(new LocalizedString(text));
                    }
                    xmlNode.InnerText = rpsNetworkInt;
                }
                text    = "/RPSServer/NetworkServices/Url";
                xmlNode = documentElement.SelectSingleNode(text);
                if (xmlNode == null)
                {
                    throw new XmlMissingElementException(new LocalizedString(text));
                }
                switch (environment)
                {
                case TargetEnvironment.Integration:
                    if (string.IsNullOrEmpty(rpsNetworkInt))
                    {
                        xmlNode.InnerText = xmlNode.InnerText.Replace("-ppe", "-int");
                    }
                    else
                    {
                        xmlNode.InnerText = rpsNetworkInt;
                    }
                    break;

                case TargetEnvironment.Production:
                    if (string.IsNullOrEmpty(rpsNetworkProd))
                    {
                        xmlNode.InnerText = xmlNode.InnerText.Replace("-ppe", "");
                    }
                    else
                    {
                        xmlNode.InnerText = rpsNetworkProd;
                    }
                    break;
                }
                text    = "/RPSServer/NetworkServices/Proxy";
                xmlNode = documentElement.SelectSingleNode(text);
                if (xmlNode == null)
                {
                    throw new XmlMissingElementException(new LocalizedString(text));
                }
                if (!string.IsNullOrEmpty(proxy))
                {
                    xmlNode.InnerText = proxy;
                }
                else
                {
                    xmlNode.InnerText = "";
                }
                xmlNode = null;
                XmlNode        xmlNode2 = null;
                XmlNode        xmlNode3 = null;
                List <XmlNode> list     = new List <XmlNode>(2);
                text = "/RPSServer/Sites/Site";
                using (XmlNodeList xmlNodeList = documentElement.SelectNodes(text))
                {
                    if (xmlNodeList == null)
                    {
                        throw new XmlMissingElementException(new LocalizedString(text));
                    }
                    foreach (object obj in xmlNodeList)
                    {
                        XmlElement xmlElement = (XmlElement)obj;
                        xmlNode2 = xmlElement;
                        string text2 = xmlElement.GetAttribute("SiteName");
                        if (text2 != null)
                        {
                            text2 = text2.Trim();
                            if (text2 != null && text2.Equals("default"))
                            {
                                xmlNode3 = xmlElement;
                            }
                            else
                            {
                                switch (environment)
                                {
                                case TargetEnvironment.Integration:
                                    if (text2.IndexOf("INT") == -1)
                                    {
                                        list.Add(xmlElement);
                                    }
                                    else
                                    {
                                        xmlNode = xmlElement;
                                    }
                                    break;

                                case TargetEnvironment.Preproduction:
                                    if (text2.IndexOf("PPE") == -1)
                                    {
                                        list.Add(xmlElement);
                                    }
                                    else
                                    {
                                        xmlNode = xmlElement;
                                    }
                                    break;

                                case TargetEnvironment.Production:
                                    if (text2.IndexOf("PRODUCTION") == -1)
                                    {
                                        list.Add(xmlElement);
                                    }
                                    else
                                    {
                                        xmlNode = xmlElement;
                                    }
                                    break;
                                }
                            }
                        }
                    }
                }
                if (xmlNode != null)
                {
                    xmlNode2 = xmlNode;
                }
                xmlNode = documentElement.SelectSingleNode("/RPSServer/Sites");
                foreach (XmlNode oldChild in list)
                {
                    xmlNode.RemoveChild(oldChild);
                }
                xmlNode = xmlNode2;
                this.UpdateSiteInformation(xmlNode, certificateName, siteId, siteName, "https://" + siteName + "/owa", siteName, siteName, siteName);
                if (xmlNode3 == null)
                {
                    throw new XmlMissingElementException(new LocalizedString("/RPSServer/Sites/Site/"));
                }
                this.UpdateSiteInformation(xmlNode3, certificateName, siteId, "default", "", "", "", "");
                if (instance == LiveIdInstanceType.Consumer)
                {
                    XmlNode xmlNode4 = xmlNode.Clone();
                    this.UpdateSiteInformation(xmlNode4, certificateName, accrualSiteId, accrualSiteName, "https://" + accrualSiteName + "/owa", siteName, siteName, siteName);
                    documentElement.SelectSingleNode("/RPSServer/Sites").AppendChild(xmlNode4);
                }
                if (!string.IsNullOrEmpty(internalSiteName))
                {
                    XmlNode xmlNode5 = xmlNode.Clone();
                    this.UpdateSiteInformation(xmlNode5, certificateName, siteId, internalSiteName, "https://" + internalSiteName + "/owa", internalSiteName, internalSiteName, internalSiteName);
                    documentElement.SelectSingleNode("/RPSServer/Sites").AppendChild(xmlNode5);
                }
                if (!string.IsNullOrEmpty(o365SiteName))
                {
                    XmlNode xmlNode6 = xmlNode.Clone();
                    this.UpdateSiteInformation(xmlNode6, certificateName, siteId, o365SiteName, "https://" + o365SiteName + "/owa", o365SiteName, o365SiteName, o365SiteName);
                    documentElement.SelectSingleNode("/RPSServer/Sites").AppendChild(xmlNode6);
                }
                xmlDocument.Save(xmlTargetFile);
            }
            catch (XmlMissingElementException ex)
            {
                base.WriteError(new ArgumentException(Strings.CannotFindXPath(xmlConfigFile, ex.Message)), ErrorCategory.InvalidArgument, null);
            }
        }
Beispiel #24
0
 public static void shaderc_compile_options_set_target_env(nint options, TargetEnvironment target, uint version)
 {
     shaderc_compile_options_set_target_env_(options, target, version);
 }
Beispiel #25
0
 public EnvironmentSqlServer(TargetEnvironment target, string version)
     : base(target, version)
 {
 }
Beispiel #26
0
 public AssetEnvironment(TargetEnvironment env, IEnumerable <Asset> assets)
 {
     TargetEnvironment = env;
     Assets            = assets.ToList();
 }
Beispiel #27
0
 internal static extern void shaderc_compile_options_set_target_env(IntPtr options, TargetEnvironment target, EnvironmentVersion version);
Beispiel #28
0
 public EnvironmentSqliteDb(TargetEnvironment target, string version)
     : base(target, version)
 {
 }
Beispiel #29
0
 public IEnvironmentHelper GetEnvironmentHelper(TargetEnvironment target, string version)
 {
     return(EnvironmentHelperBase.CreateHelper(target, version));
 }
Beispiel #30
0
 public static string GetEnvironmentServiceUri(TargetEnvironment environment)
 {
     return(App.Environments[environment]);
 }
Beispiel #31
0
 public EnvironmentOracleDb(TargetEnvironment target, string version)
     : base(target, version)
 {
 }
Beispiel #32
0
 public LoginPage(FluentTest test)
     : base(test)
 {
     Url = TargetEnvironment.GetApplicationUrl("/");
     At  = () => I.Expect.Exists(EmailInput);
 }
 protected EnvironmentHelperBase(TargetEnvironment target, string version)
 {
     this.target  = target;
     this.version = version;
 }