Пример #1
0
        public void create_a_context_from_warmup_without_failure()
        {
            using (var system = new SerenitySystem())
            {
                system.As <ISystem>().Warmup();

                system.As <ISystem>().CreateContext().ShouldBeOfType <SerenitySystem.SerenityContext>();
            }
        }
Пример #2
0
        public void security_settings_are_reset_on_each_test_run()
        {
            using (var system = new SerenitySystem())
            {
                system.As <ISystem>().CreateContext();
                system.Runtime.Get <SecuritySettings>().AuthenticationEnabled = false;

                // okay, now create a new context and the settings should go back to everything
                // being enabled
                system.As <ISystem>().CreateContext();
                system.Runtime.Get <SecuritySettings>().AuthenticationEnabled.ShouldBeTrue();
            }
        }
Пример #3
0
        public void the_build_runtime_will_be_in_testing_mode()
        {
            using (var system = new SerenitySystem())
            {
                system.As <ISystem>().Warmup().Wait();

                system.Runtime.Mode.InTesting().ShouldBeTrue();
            }
        }
Пример #4
0
        public void warmup_will_create_a_fuburuntime()
        {
            using (var system = new SerenitySystem())
            {
                system.As <ISystem>().Warmup().Wait();

                system.Runtime.ShouldNotBeNull();
            }
        }
        public void build_with_system_for_profile()
        {
            Project.CurrentProject = new Project { Profile = "phantom/katana" };
            using (var system = new SerenitySystem { DefaultBrowser = BrowserType.Firefox })
            {
                system.As<ISystem>().Warmup().Wait();

                system.Runtime.Get<IBrowserLifecycle>()
                    .ShouldBeOfType<PhantomBrowser>();
            }
        }
        public void build_for_a_system_with_default()
        {
            Project.CurrentProject = new Project { Profile = null };
            using (var system = new SerenitySystem{DefaultBrowser = BrowserType.Firefox})
            {
                system.As<ISystem>().Warmup().Wait();

                system.Runtime.Get<IBrowserLifecycle>()
                    .ShouldBeOfType<FirefoxBrowser>();
            }
        }
        public void build_for_a_system_all_defaults()
        {
            Project.CurrentProject = new Project { Profile = null };
            using (var system = new SerenitySystem())
            {
                system.As<ISystem>().Warmup().Wait();

                system.Runtime.Get<IBrowserLifecycle>()
                    .ShouldBeOfType<ChromeBrowser>();
            }
        }
Пример #8
0
        public void build_for_a_system_all_defaults()
        {
            Project.CurrentProject = new Project {
                Profile = null
            };
            using (var system = new SerenitySystem())
            {
                system.As <ISystem>().Warmup().Wait();

                system.Runtime.Get <IBrowserLifecycle>()
                .ShouldBeOfType <ChromeBrowser>();
            }
        }
Пример #9
0
        public void build_with_system_for_profile()
        {
            Project.CurrentProject = new Project {
                Profile = "phantom/katana"
            };
            using (var system = new SerenitySystem {
                DefaultBrowser = BrowserType.Firefox
            })
            {
                system.As <ISystem>().Warmup().Wait();

                system.Runtime.Get <IBrowserLifecycle>()
                .ShouldBeOfType <PhantomBrowser>();
            }
        }
Пример #10
0
        public void build_for_a_system_with_default()
        {
            Project.CurrentProject = new Project {
                Profile = null
            };
            using (var system = new SerenitySystem {
                DefaultBrowser = BrowserType.Firefox
            })
            {
                system.As <ISystem>().Warmup().Wait();

                system.Runtime.Get <IBrowserLifecycle>()
                .ShouldBeOfType <FirefoxBrowser>();
            }
        }
Пример #11
0
        public void warmup_will_create_a_fuburuntime()
        {
            using (var system = new SerenitySystem())
            {
                system.As<ISystem>().Warmup().Wait();

                system.Runtime.ShouldNotBeNull();
            }
        }
Пример #12
0
        public void the_build_runtime_will_be_in_testing_mode()
        {
            using (var system = new SerenitySystem())
            {
                system.As<ISystem>().Warmup().Wait();

                system.Runtime.Mode.InTesting().ShouldBeTrue();
            }
        }
Пример #13
0
        public void security_settings_are_reset_on_each_test_run()
        {
            using (var system = new SerenitySystem())
            {
                system.As<ISystem>().CreateContext();
                system.Runtime.Get<SecuritySettings>().AuthenticationEnabled = false;

                // okay, now create a new context and the settings should go back to everything
                // being enabled
                system.As<ISystem>().CreateContext();
                system.Runtime.Get<SecuritySettings>().AuthenticationEnabled.ShouldBeTrue();

            }
        }
Пример #14
0
 public void create_a_context_without_warmup_without_failure()
 {
     using (var system = new SerenitySystem())
     {
         system.As<ISystem>().CreateContext().ShouldBeOfType<SerenitySystem.SerenityContext>();
     }
 }