예제 #1
0
        static BrowserHost()
        {
            Instance.Run(configure => configure
                         .WithWebServer(new InternetWebServer("https://qa-platform.authenticateis.com/")));

            RootUrl = Instance.Application.Browser.Url;
        }
 public void FixtureSetup()
 {
     _host = new SelenoHost();
     _host.Run("TestStack.Seleno.AcceptanceTests.Web", 12324, x =>
               x.WithRouteConfig(RouteConfig.RegisterRoutes)
               .WithEnvironmentVariable("FunctionalTest", "SomeVal"));
 }
 public void FixtureSetup()
 {
     _host = new SelenoHost();
     _host.Run("TestStack.Seleno.AcceptanceTests.Web", 12324, x => 
         x.WithRouteConfig(RouteConfig.RegisterRoutes)
          .WithEnvironmentVariable("FunctionalTest", "SomeVal"));
 }
예제 #4
0
 static BrowserHost()
 {
     //Chrome
     Instance.Run("PandaWebApp", 80, w => w.WithRemoteWebDriver(() => new ChromeDriver()));
     //FireFox
     // Instance.Run("PandaWebApp", 80);
 }
예제 #5
0
        static BrowserHost()
        {
            //  Instance.Run("Blog", 60639);
            Instance.Run("Blog", 60639, w => w.WithRemoteWebDriver(() => new ChromeDriver()));

            RootUrl = Instance.Application.Browser.Url;
        }
        protected override void Load(ContainerBuilder builder)
        {
            var selenoHost = new SelenoHost();

            selenoHost.Run("ContosoUniversity", 12365,
                           c => c.WithRouteConfig(RouteConfig.RegisterRoutes));
            builder.RegisterInstance(selenoHost).AsSelf().SingleInstance();
            builder.RegisterType <WebUiDriver>().AsSelf();

            DependenciesConfig.ConfigureDependencies(builder);
            //builder.RegisterGeneric(typeof(ViewStudentDetailsScenario))
            //    .AsSelf()
            //    .PropertiesAutowired()
            //    .InstancePerLifetimeScope();

            builder.RegisterSource(new ContravariantRegistrationSource());
            builder.RegisterAssemblyTypes(typeof(IMediator).Assembly).AsImplementedInterfaces();
            builder.RegisterAssemblyTypes(typeof(FunctionalTestsAutofacModule).Assembly).AsImplementedInterfaces();
            builder.Register <SingleInstanceFactory>(ctx =>
            {
                var c = ctx.Resolve <IComponentContext>();
                return(t => c.Resolve(t));
            });
            builder.Register <MultiInstanceFactory>(ctx =>
            {
                var c = ctx.Resolve <IComponentContext>();
                return(t => (IEnumerable <object>)c.Resolve(typeof(IEnumerable <>).MakeGenericType(t)));
            });

            builder.RegisterType <StudentDetailsPage>().As(typeof(IPage <Student>));
        }
예제 #7
0
        static BrowserHost()
        {
            //Instance.Run("Blog", 60634, w => w.WithRemoteWebDriver(() => new FirefoxDriver()));

            Instance.Run("Blog", 60634, config => config.WithRemoteWebDriver(() => new FirefoxDriver()));
            RootUrl = Instance.Application.Browser.Url;
        }
예제 #8
0
        public void Closing_SelenoHost_should_close_child_browser(string driverName)
        {
            // ARRANGE
            Process.GetProcessesByName(driverName).ForEach(StopProcess);
            var selenoHost = new SelenoHost();
            Func <RemoteWebDriver> driver = GetBrowserFactory(driverName);

            selenoHost.Run("TestStack.Seleno.AcceptanceTests.Web", 12346,
                           c => c.WithRemoteWebDriver(driver));
            // Somehow, Firefox spawns 6 processes
            const int NumberOfFirefoxProcesses = 6;
            int       NumberOfExpectedProcesses;

            switch (driverName)
            {
            case Firefox:
                NumberOfExpectedProcesses = NumberOfFirefoxProcesses;
                break;

            default:
                NumberOfExpectedProcesses = 1;
                break;
            }

            Process.GetProcessesByName(driverName).Length.Should().Be(NumberOfExpectedProcesses);

            // ACT
            selenoHost.Dispose();

            // ASSERT
            Process.GetProcessesByName(driverName).Should().BeEmpty();
        }
예제 #9
0
 static BrowserHost()
 {
     //Chrome
     Instance.Run("Blog", 60634, w => w.WithRemoteWebDriver(() => new ChromeDriver()));
     //FireFox
     // Instance.Run("Blog", 60634);
 }
예제 #10
0
 static Host()
 {
     Instance.Run("TestStack.Seleno.AcceptanceTests.Web", 12346, c => c
                  .UsingLoggerFactory(new ConsoleFactory())
                  .WithMinimumWaitTimeoutOf(TimeSpan.FromSeconds(1))
                  .WithRouteConfig(RouteConfig.RegisterRoutes));
 }
 public void FixtureSetup()
 {
     _host = new SelenoHost();
     _host.Run(x => x
         .WithWebServer(new InternetWebServer("http://www.google.com/"))
     );
     _host.Application.Browser.Manage().Window.Size = new Size(750,750);
 }
예제 #12
0
 static Host()
 {
     Instance.Run("ChameleonForms.Example", 12345, c => c
                  .WithMinimumWaitTimeoutOf(TimeSpan.FromSeconds(1))
                  .UsingCamera(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase.Replace("file:///", "")), "screenshots"))
                  .WithRemoteWebDriver(() => Browser)
                  );
 }
예제 #13
0
파일: BrowserHost.cs 프로젝트: xsaraPN/Blog
        //public static readonly string RootUrl;

        static BrowserHost()
        {
            // Instance.Run("Blog", 60638);
            Instance.Run("Blog", 60638, w => w.WithRemoteWebDriver(() => new ChromeDriver()));
            //Instance.Run("Blog", 60634, w => w.WithRemoteWebDriver(BrowserFactory.Chrome));

            // RootUrl = Instance.Application.Browser.Url;
        }
예제 #14
0
 public void FixtureSetup()
 {
     _host = new SelenoHost();
     _host.Run(x => x
               .WithWebServer(new InternetWebServer("http://www.google.com/"))
               );
     _host.Application.Browser.Manage().Window.Size = new Size(750, 750);
 }
예제 #15
0
 public static void Start()
 {
     SelenoHost.Run(@"SelenoTest.App", 12346, c => c
                    .UsingLoggerFactory(new ConsoleFactory())
                    .WithRouteConfig(RouteConfig.RegisterRoutes)
                    .WithRemoteWebDriver(GetChromeDriver)
                    );
 }
        protected override void Load(ContainerBuilder builder)
        {
            var selenoHost = new SelenoHost();

            selenoHost.Run("ContosoUniversity", 12365,
                           c => c.WithRouteConfig(RouteConfig.RegisterRoutes));
            builder.RegisterInstance(selenoHost).AsSelf().SingleInstance();
            builder.RegisterType <BrowserHost>().AsSelf();
        }
예제 #17
0
 static Host()
 {
     Instance.Run("Name.Of.Your.Web.Project", 12346, c => c
                  .UsingLoggerFactory(new ConsoleFactory())
                  // If you are using MVC then do this where RouteConfig is the class that registers your routes in the "Name.Of.Your.Web.Project" project
                  // If you aren't using MVC then don't include this line
                  .WithRouteConfig(RouteConfig.RegisterRoutes)
                  );
 }
예제 #18
0
 static Host()
 {
     Instance.Run(x => x.WithWebServer(new InternetWebServer(HostUrl)));
     //Instance.Run(x => x.WithWebServer(new InternetWebServer(HostUrl + AppConfigHandler.GetValue("LoginPage")))
     //    // comment out this line if you want to run the tests locally
     //    //.WithRemoteWebDriver(RemoteDriver)
     //    );
     Driver.Manage().Window.Size = new Size(1280, 768);
 }
예제 #19
0
 public void FixtureSetup()
 {
     _host = new SelenoHost();
     _host.Run(x => x
               .UsingCamera(@"c:\screenshots")
               .WithWebServer(new InternetWebServer("http://www.google.com/"))
               .WithMinimumWaitTimeoutOf(TimeSpan.FromMilliseconds(100))
               .UsingLoggerFactory(new ConsoleFactory(LoggerLevel.Debug))
               );
 }
예제 #20
0
        static BrowserHost()
        {
            Instance.Run("UnitTesting", 4223,
                         configure => configure
                         .WithRemoteWebDriver(BrowserFactory.Chrome)
                         .WithRouteConfig(RouteConfig.RegisterRoutes)    // To allow us to navigate by selecting a controller and action rather than a url string
                         );

            RootUrl = Instance.Application.Browser.Url;
        }
예제 #21
0
        static Host()
        {
            Instance = new SelenoHost();
            Instance.Run("WebApplication", 7055);
            Instance.Application.Browser.Manage().Window.Maximize();
            Thread.Sleep(5000);
            //new code changes

            //Instance.Run("WebApplication", 54881, configure => configure.WithRouteConfig(WebApplication.RouteConfig.RegisterRoutes).WithMinimumWaitTimeoutOf(System.TimeSpan.FromSeconds(3)));
        }
예제 #22
0
 public void FixtureSetup()
 {
     _host = new SelenoHost();
     _host.Run(x => x
               .UsingDomCapture(DomCaptureFolderPath)
               .WithWebServer(new InternetWebServer("https://www.google.com/"))
               .WithMinimumWaitTimeoutOf(TimeSpan.FromMilliseconds(100))
               .UsingLoggerFactory(new ConsoleFactory(LoggerLevel.Debug))
               );
 }
예제 #23
0
 public void FixtureSetup()
 {
     _host = new SelenoHost();
     _host.Run(x => x
         .UsingCamera(@"c:\screenshots")
         .WithWebServer(new InternetWebServer("http://www.google.com/"))
         .WithMinimumWaitTimeoutOf(TimeSpan.FromMilliseconds(100))
         .UsingLoggerFactory(new ConsoleFactory(LoggerLevel.Debug))
     );
 }
예제 #24
0
        private static void RunIisExpress()
        {
            var filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SelenoScreenShots");

            _instance = new SelenoHost();
            _instance.Run("NGL.Web", 12345, c =>
                c.WithRouteConfig(RouteConfig.RegisterRoutes)
                    .UsingControlIdGenerator(new MvcControlIdGenerator())
                    .WithEnvironmentVariable("ConnectionString", DatabaseManager.ConnectionString)
                    .UsingCamera(filePath));
        }
예제 #25
0
파일: Host.cs 프로젝트: innovateedu2/NGL
        private static void RunIisExpress()
        {
            var filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SelenoScreenShots");

            _instance = new SelenoHost();
            _instance.Run("NGL.Web", 12345, c =>
                          c.WithRouteConfig(RouteConfig.RegisterRoutes)
                          .UsingControlIdGenerator(new MvcControlIdGenerator())
                          .WithEnvironmentVariable("ConnectionString", DatabaseManager.ConnectionString)
                          .UsingCamera(filePath));
        }
예제 #26
0
파일: Host.cs 프로젝트: pelteur/miam
        static Host()
        {
            Instance.Run(configure => configure
                         .WithWebServer(new InternetWebServer("http://miam.local"))
                         .WithRouteConfig(RouteConfig.RegisterRoutes)
                         .WithMinimumWaitTimeoutOf(TimeSpan.FromSeconds(5))
                         .WithRemoteWebDriver(fireFoxWebDriver)
                         );

            Instance.Application.Browser.Manage().Window.Maximize();
        }
예제 #27
0
        static BrowserHost()
        {
            //var t =
            //    @"C:\_dev\mvcTesting\5-automated-aspdotnet-mvc-m5-exercise-files\after\StronglyTypedPageObjectModels\BankingSite\BankingSite.FunctionalUITests\bin\Debug\";
            RemoteWebDriver y = new ChromeDriver();

            // y.Navigate().GoToUrl("https://www.google.co.uk/");
            Instance.Run("BankingSite", 4223, config => config.WithRouteConfig(RouteConfig.RegisterRoutes)
                         .WithRemoteWebDriver(() => y));

            RootUrl = Instance.Application.Browser.Url;
        }
예제 #28
0
        public void RunTest()
        {
            using (var host = new SelenoHost())
            {
                host.Run(
                    x =>
                    x.WithRemoteWebDriver(() => WebDriver)
                     .WithWebServer(new InternetWebServer("http://www.google.com/")));
                var title = host.NavigateToInitialPage<Page>().Title;

                Assert.That(title, Is.EqualTo("Google"));
            }
        }
        public void Closing_SelenoHost_should_close_child_browser(string driverName)
        {
            Process.GetProcessesByName(driverName).ForEach(StopProcess);
            var selenoHost = new SelenoHost();
            Func<RemoteWebDriver> driver = GetBrowserFactory(driverName);
            selenoHost.Run("TestStack.Seleno.AcceptanceTests.Web", 12346,
                c => c.WithRemoteWebDriver(driver));
            Process.GetProcessesByName(driverName).Length.Should().Be(1);

            selenoHost.Dispose();

            Process.GetProcessesByName(driverName).Should().BeEmpty();
        }
예제 #30
0
        public void RunTest()
        {
            using (var host = new SelenoHost())
            {
                host.Run(
                    x =>
                    x.WithRemoteWebDriver(() => WebDriver)
                    .WithWebServer(new InternetWebServer("http://www.google.com/")));
                var title = host.NavigateToInitialPage <Page>().Title;

                Assert.That(title, Is.EqualTo("Google"));
            }
        }
        public void Closing_SelenoHost_should_close_child_browser(string driverName)
        {
            Process.GetProcessesByName(driverName).ForEach(StopProcess);
            var selenoHost = new SelenoHost();
            Func <RemoteWebDriver> driver = GetBrowserFactory(driverName);

            selenoHost.Run("TestStack.Seleno.AcceptanceTests.Web", 12346,
                           c => c.WithRemoteWebDriver(driver));
            Process.GetProcessesByName(driverName).Length.Should().Be(1);

            selenoHost.Dispose();

            Process.GetProcessesByName(driverName).Should().BeEmpty();
        }
        public void Closing_SelenoHost_should_close_Iis_Express()
        {
            PatientlyStopProcess(IisExpress);
            Process.GetProcessesByName("chromedriver").ForEach(StopProcess);

            var selenoHost = new SelenoHost();
            selenoHost.Run("TestStack.Seleno.AcceptanceTests.Web", 12346,
                c => c.WithRemoteWebDriver(BrowserFactory.Chrome));
            Process.GetProcessesByName(IisExpress).Length.Should().Be(1);

            selenoHost.Dispose();

            Process.GetProcessesByName("chromedriver").Should().BeEmpty();
            Process.GetProcessesByName(IisExpress).Should().BeEmpty();
        }
예제 #33
0
        public void Closing_SelenoHost_should_close_Iis_Express()
        {
            PatientlyStopProcess(IisExpress);
            Process.GetProcessesByName("chromedriver").ForEach(StopProcess);

            var selenoHost = new SelenoHost();

            selenoHost.Run("TestStack.Seleno.AcceptanceTests.Web", 12346,
                           c => c.WithRemoteWebDriver(BrowserFactory.Chrome));
            Process.GetProcessesByName(IisExpress).Length.Should().Be(1);

            selenoHost.Dispose();

            Process.GetProcessesByName("chromedriver").Should().BeEmpty();
            Process.GetProcessesByName(IisExpress).Should().BeEmpty();
        }
예제 #34
0
        internal void Initalise()
        {
            switch (RunProfile)
            {
            case RunProfile.Remote:
                DesiredCapabilities capability = PopulateCapabilities();
                SetBrowserStackCredentials(capability);
                Browser = new RemoteWebDriver(new Uri(browserStackBrowserUri), capability);
                var selenoHost = new SelenoHost();
                selenoHost.Run(config =>
                {
                    config
                    .WithRemoteWebDriver(() => Browser)
                    .WithWebServer(new InternetWebServer(RootUrl));
                });

                Seleno = selenoHost;
                Seleno.Application.Browser.Manage().Window.Maximize();
                break;

            case RunProfile.Owasp:
                var   zapHost = ConfigurationManager.AppSettings["zapHost"];
                var   zapPort = ConfigurationManager.AppSettings["zapPort"];
                Proxy proxy   = new Proxy
                {
                    SslProxy  = $"{zapHost}:{zapPort}",
                    HttpProxy = $"{zapHost}:{zapPort}",
                    FtpProxy  = $"{zapHost}:{zapPort}",
                };

                Seleno  = LocalBrowserHost.GetInstanceFor(BrowserName, RootUrl, proxy);
                RootUrl = Seleno.Application.WebServer.BaseUrl;
                break;

            case RunProfile.Local:
            default:
                Seleno  = LocalBrowserHost.GetInstanceFor(BrowserName, RootUrl);
                RootUrl = Seleno.Application.WebServer.BaseUrl;
                Seleno.Application.Browser.Manage().Window.Maximize();
                break;
            }
        }
예제 #35
0
 static Host()
 {
     Instance.Run("Blog", 60639);
     //About Chrome Browser : Instance.Run("Blog", 60634, w => w.WithRemoteWebDriver(BrowserFactory.Chrome));
     //RootUrl = Instance.Application.Browser.Url;
 }
예제 #36
0
 static BrowserHost()
 {
     Instance.Run("Blog", 60639);
 }
예제 #37
0
 static BrowserHost()
 {
     Instance.Run("Blog", 60634, w => w.WithRemoteWebDriver(() => new ChromeDriver()));
 }