Ejemplo n.º 1
0
        /// <summary>Registers the type mappings with the Unity container.</summary>
        /// <param name="services"></param>
        /// <param name="configuration"></param>
        /// <param name="container">The unity container to configure.</param>
        /// <remarks>There is no need to register concrete types such as controllers or API controllers (unless you want to
        /// change the defaults), as Unity allows resolving a concrete type even if it was not previously registered.</remarks>
        public static void AddNakedObjects(this IServiceCollection services, IConfiguration configuration)
        {
            // NOTE: To load from web.config uncomment the line below. Make sure to add a Microsoft.Practices.Unity.Configuration to the using statements.
            // container.LoadConfiguration();
            //Standard configuration

            ParallelConfig.RegisterStandardFacetFactories(services);
            ParallelConfig.RegisterCoreSingletonTypes(services);
            ParallelConfig.RegisterCoreScopedTypes(services);

            // add custom factories

            ConfigHelpers.RegisterFacetFactory(typeof(AWNotNavigableFacetFactoryParallel), services, 1000);
            ConfigHelpers.RegisterFacetFactory(typeof(AWNotCountedAnnotationFacetFactoryParallel), services, 1001);

            // config
            services.AddSingleton <IReflectorConfiguration>(p => NakedObjectsRunSettings.ReflectorConfig());
            services.AddSingleton <IEntityObjectStoreConfiguration>(p => NakedObjectsRunSettings.EntityObjectStoreConfig(configuration));

            // frameworkFacade
            services.AddTransient <IOidTranslator, OidTranslatorSlashSeparatedTypeAndIds>();

            services.AddTransient <IOidStrategy, EntityOidStrategy>();
            services.AddTransient <IStringHasher, InvariantStringHasher>();
            services.AddTransient <IFrameworkFacade, FrameworkFacade>();

            //Externals
            services.AddScoped <IPrincipal>(p => p.GetService <IHttpContextAccessor>().HttpContext.User);
        }
        public static void HoverAndClick(this IWebElement element, ParallelConfig _parallelConfig, IWebElement clickableElement)
        {
            Actions actions = new Actions(_parallelConfig.Driver);

            element.ScrollTo(_parallelConfig);
            _parallelConfig.Driver.WaitFive();
            clickableElement.Click();
        }
Ejemplo n.º 3
0
        public static void TakeScreenshot(ParallelConfig driver, string feature, string scenario)
        {
            Screenshot screenshot     = driver.Driver.GetScreenshot();
            string     screenshotFile = Path.Combine(TestContext.CurrentContext.WorkDirectory, "[Feature]" + feature + "[Scenario]" + scenario + ".png");

            LogHelpers.WriteSteps("(Se realiza captura de pantalla...)", feature, scenario);
            screenshot.SaveAsFile(screenshotFile, ScreenshotImageFormat.Png);
            TestContext.AddTestAttachment(screenshotFile, scenario);
        }
Ejemplo n.º 4
0
        private string GetParallelConfigJson(DeployArg arg)
        {
            var config = new ParallelConfig
            {
                IsParallelEnable = false
            };

            var result = JsonSerializer.Instance.Serialize(config);

            return(result);
        }
Ejemplo n.º 5
0
        public static void AddNakedFunctions(this NakedCoreOptions coreOptions, Action <NakedFunctionsOptions> setupAction)
        {
            var options = new NakedFunctionsOptions();

            setupAction(options);

            options.RegisterCustomTypes?.Invoke(coreOptions.Services);

            ParallelConfig.RegisterWellKnownServices(coreOptions.Services);
            coreOptions.Services.RegisterFacetFactories <IFunctionalFacetFactoryProcessor>(FunctionalFacetFactories.StandardFacetFactories());
            coreOptions.Services.AddSingleton <FunctionalFacetFactorySet, FunctionalFacetFactorySet>();
            coreOptions.Services.AddSingleton <FunctionClassStrategy, FunctionClassStrategy>();
            coreOptions.Services.AddSingleton <IReflector, FunctionalReflector>();
            coreOptions.Services.AddSingleton <IFunctionalReflectorConfiguration>(p => FunctionalReflectorConfig(options));
        }
Ejemplo n.º 6
0
        public void InitializeSettings()
        {
            _parallelConfig = new ParallelConfig();
            ChromeOptions copt = new ChromeOptions();

            copt.AddArguments("--ignore-certificate-errors");
            copt.AddArguments("--incognito");
            new WebDriverManager.DriverManager().SetUpDriver(new ChromeConfig());
            _parallelConfig.Driver = new ChromeDriver(ChromeDriverService.CreateDefaultService(), copt, TimeSpan.FromSeconds(timeout));
            _parallelConfig.Driver.Manage().Window.Maximize();
            _parallelConfig.Driver.Navigate().GoToUrl("https://davies-group.com/");
            _parallelConfig.Driver.WaitForPageLoaded();

            _parallelConfig.CurrentPage = new HomePage(_parallelConfig);
            _parallelConfig.CurrentPage.As <HomePage>().AllowAllCookies();
        }
Ejemplo n.º 7
0
        /// <summary>Registers the type mappings with the Unity container.</summary>
        /// <param name="services"></param>
        /// <param name="configuration"></param>
        /// <param name="container">The unity container to configure.</param>
        /// <remarks>
        ///     There is no need to register concrete types such as controllers or API controllers (unless you want to
        ///     change the defaults), as Unity allows resolving a concrete type even if it was not previously registered.
        /// </remarks>
        public static void AddNakedObjects(this IServiceCollection services, IConfiguration configuration)
        {
            // NOTE: To load from web.config uncomment the line below. Make sure to add a Microsoft.Practices.Unity.Configuration to the using statements.
            // container.LoadConfiguration();
            //Standard configuration

            ParallelConfig.RegisterStandardFacetFactories(services);
            ParallelConfig.RegisterCoreSingletonTypes(services);
            ParallelConfig.RegisterCoreScopedTypes(services);

            // config
            services.AddSingleton <IReflectorConfiguration>(p => NakedObjectsRunSettings.ReflectorConfig());
            services.AddSingleton <IEntityObjectStoreConfiguration>(p => NakedObjectsRunSettings.EntityObjectStoreConfig(configuration));

            services.AddScoped <IBatchRunner, BatchRunner>();

            //Externals
            services.AddScoped(p => Thread.CurrentPrincipal);
        }
Ejemplo n.º 8
0
        public static void AddNakedObjects(this IServiceCollection services, IConfiguration configuration)
        {
            ParallelConfig.RegisterStandardFacetFactories(services);
            ParallelConfig.RegisterCoreSingletonTypes(services);
            ParallelConfig.RegisterCoreScopedTypes(services);

            // config
            services.AddSingleton <IReflectorConfiguration>(p => NakedObjectsRunSettings.ReflectorConfig());
            services.AddSingleton <IEntityObjectStoreConfiguration>(p => NakedObjectsRunSettings.EntityObjectStoreConfig(configuration));

            // frameworkFacade
            services.AddTransient <IOidTranslator, OidTranslatorSlashSeparatedTypeAndIds>();

            services.AddTransient <IOidStrategy, EntityOidStrategy>();
            services.AddTransient <IStringHasher, InvariantStringHasher>();
            services.AddTransient <IFrameworkFacade, FrameworkFacade>();


            //Externals
            services.AddScoped <IPrincipal>(p => p.GetService <IHttpContextAccessor>().HttpContext.User);
        }
Ejemplo n.º 9
0
        private static void AddNakedCoreFramework(this IServiceCollection services, NakedCoreOptions options)
        {
            ParallelConfig.RegisterCoreSingletonTypes(services);
            ParallelConfig.RegisterCoreScopedTypes(services);

            if (options.AuthorizationConfiguration is not null)
            {
                services.AddSingleton(options.AuthorizationConfiguration);
                services.AddSingleton <IFacetDecorator, AuthorizationManager>();
            }

            if (options.AuditConfiguration is not null)
            {
                services.AddSingleton(options.AuditConfiguration);
                services.AddSingleton <IFacetDecorator, AuditManager>();
            }

            if (options.ProfileConfiguration is not null)
            {
                services.AddSingleton(options.ProfileConfiguration);
                services.AddSingleton <IFacetDecorator, ProfileManager>();
            }


            services.AddSingleton <ICoreConfiguration>(p => CoreConfig(options));


            // frameworkFacade
            services.AddTransient <IOidTranslator, OidTranslatorSlashSeparatedTypeAndIds>();
            services.AddTransient <IOidStrategy, EntityOidStrategy>();
            services.AddTransient <IStringHasher, InvariantStringHasher>();
            services.AddTransient <IFrameworkFacade, FrameworkFacade>();

            //Externals
            services.AddScoped <IPrincipal>(p => p.GetService <IHttpContextAccessor>().HttpContext.User);
        }
Ejemplo n.º 10
0
 public BaseStep(ParallelConfig parallelConfig) : base(parallelConfig)
 {
 }
Ejemplo n.º 11
0
 public LoginPage(ParallelConfig parallelConfig) : base(parallelConfig)
 {
 }
Ejemplo n.º 12
0
 public PageHelpers(ParallelConfig parallelConfig) : base(parallelConfig)
 {
 }
Ejemplo n.º 13
0
 public DriverContext(ParallelConfig parallelConfig)
 {
     this.parallelConfig = parallelConfig;
 }
Ejemplo n.º 14
0
 public HomePage(ParallelConfig parallelConfig) : base(parallelConfig)
 {
 }
Ejemplo n.º 15
0
 public AccountModule(ParallelConfig parallelConfig) : base(parallelConfig)
 {
 }
Ejemplo n.º 16
0
 public ModalsDialogPage(ParallelConfig parallelConfig) : base(parallelConfig)
 {
 }
Ejemplo n.º 17
0
 public CaseStudyPage(ParallelConfig parallelConfig) : base(parallelConfig)
 {
 }
Ejemplo n.º 18
0
 public BuildTrimPage(ParallelConfig parallelConfig) : base(parallelConfig)
 {
 }
 public BuildLoginTestBase(ParallelConfig parallelConfig) : base(parallelConfig)
 {
 }
Ejemplo n.º 20
0
 public BuildTrimTestBase(ParallelConfig parallelConfig) : base(parallelConfig)
 {
 }
 public CreateEmployeeStep(ParallelConfig parellelConfig) : base(parellelConfig)
 {
     _parallelConfig = parellelConfig;
 }
Ejemplo n.º 22
0
 public BuildPackagePage(ParallelConfig parallelConfig) : base(parallelConfig)
 {
 }
 public CompleteRegistrationPage(ParallelConfig parallelConfig) : base(parallelConfig)
 {
 }
Ejemplo n.º 24
0
 public TakeScreenshot(ParallelConfig parallelConfig) : base(parallelConfig)
 {
 }
Ejemplo n.º 25
0
 public LoginSteps(ParallelConfig parallelConfig) : base(parallelConfig)
 {
     _parallelConfig = parallelConfig;
 }
Ejemplo n.º 26
0
 public BuildInfoModalPage(ParallelConfig parallelConfig) : base(parallelConfig)
 {
 }
Ejemplo n.º 27
0
 public ExtendedSteps(ParallelConfig parallelConfig) : base(parallelConfig)
 {
     _parallelConfig = parallelConfig;
 }
Ejemplo n.º 28
0
 public HookInitialize(ParallelConfig parallelConfig, FeatureContext featureContext, ScenarioContext scenarioContext) : base(parallelConfig)
 {
     _parallelConfig  = parallelConfig;
     _featureContext  = featureContext;
     _scenarioContext = scenarioContext;
 }
Ejemplo n.º 29
0
 public EmployeeListPage(ParallelConfig parallelConfig) : base(parallelConfig)
 {
 }
Ejemplo n.º 30
0
 public AddWorkoutPage(ParallelConfig parallelConfig) : base(parallelConfig)
 {
 }