Exemple #1
0
        public void TeardownFixture()
        {
            string pathsToCleanAfter = "Customers.ftpconfigs,Customers.webftpoutsiders,billing.payerclients,Customers.Clients";

            SessionForQuery(pathsToCleanAfter);
            SeleniumFixture.GlobalTearDown();
            _webServer.ShutDown();
        }
Exemple #2
0
        public ImageGalleryClientTest(ConfigFixture config, ITestOutputHelper output)
        {
            SeleniumFixture fixture = new SeleniumFixture();

            _artifactsDirectory = config.ArtifactsDirectory;
            _applicationUrl     = config.ApplicationUrl;
            _driver             = fixture.Driver;
            _output             = output;
        }
        public void GetUrl_Success()
        {
            // Arrange
            const string path = "/test";

            // Act
            var fixture = new SeleniumFixture();

            // Assert
            Assert.Equal(fixture.Configuration["Domain"] + path, fixture.GetUrl(path));
        }
 public void SetupFixture()
 {
     Environment.CurrentDirectory = TestContext.CurrentContext.TestDirectory;
     ForTest.InitialzeAR();
     IntegrationFixture2.Factory = ActiveRecordMediator.GetSessionFactoryHolder()
                                   .GetSessionFactory(typeof(ActiveRecordBase));
     _webServer              = WatinSetup.StartServer();
     SeleniumFixture.WebDir  = WatinSetup.WebDir;
     SeleniumFixture.WebRoot = WatinSetup.WebRoot;
     SeleniumFixture.WebPort = WatinSetup.WebPort;
     SeleniumFixture.GlobalSetup();
 }
        public void SetupFixture()
        {
            Environment.CurrentDirectory = TestContext.CurrentContext.TestDirectory;
            SeleniumFixture.GlobalSetup();
            server = SeleniumFixture.StartServer("../../../app/");

            Environment.CurrentDirectory = TestContext.CurrentContext.TestDirectory;
            Test.Support.Setup.BuildConfiguration("db");
            var holder = ActiveRecordMediator.GetSessionFactoryHolder();
            var cfg    = holder.GetConfiguration(typeof(ActiveRecordBase));
            var init   = new ProducerInterfaceCommon.ContextModels.NHibernate();

            init.Configuration = cfg;
            init.Init();
            var factory = holder.GetSessionFactory(typeof(ActiveRecordBase));

            IntegrationFixture2.Factory = factory;
        }
Exemple #6
0
        public void SetupFixture()
        {
            Environment.CurrentDirectory = TestContext.CurrentContext.TestDirectory;
            SeleniumFixture.GlobalSetup();

            _webServer = SeleniumFixture.StartServer("../../../app/");
            SeleniumFixture.GlobalDriver.Manage().Window.Size = new Size(1920, 1080);
            Environment.CurrentDirectory = TestContext.CurrentContext.TestDirectory;
            Test.Support.Setup.BuildConfiguration("db");
            var holder = ActiveRecordMediator.GetSessionFactoryHolder();
            var cfg    = holder.GetConfiguration(typeof(ActiveRecordBase));
            var init   = new web_app.NHibernate();

            init.Configuration = cfg;
            init.Init();
            var factory = holder.GetSessionFactory(typeof(ActiveRecordBase));

            Test.Support.IntegrationFixture2.Factory = factory;
        }
        public void SetupFixture()
        {
            Environment.CurrentDirectory = TestContext.CurrentContext.TestDirectory;
            var connectionStringName = ConnectionHelper.GetConnectionName();

            ConnectionString = ConnectionHelper.GetConnectionString();
            if (!ActiveRecordStarter.IsInitialized)
            {
                var config = new InPlaceConfigurationSource();
                config.PluralizeTableNames = true;
                config.Add(typeof(ActiveRecordBase),
                           new Dictionary <string, string> {
                    { NHibernate.Cfg.Environment.Dialect, "NHibernate.Dialect.MySQLDialect" },
                    { NHibernate.Cfg.Environment.ConnectionDriver, "NHibernate.Driver.MySqlDataDriver" },
                    { NHibernate.Cfg.Environment.ConnectionProvider, "NHibernate.Connection.DriverConnectionProvider" },
                    { NHibernate.Cfg.Environment.ConnectionStringName, connectionStringName },
                    { NHibernate.Cfg.Environment.Hbm2ddlKeyWords, "none" },
                    { NHibernate.Cfg.Environment.FormatSql, "true" },
                    { NHibernate.Cfg.Environment.UseSqlComments, "true" }
                });
                ActiveRecordStarter.Initialize(new[] { Assembly.Load("Test.Support"), Assembly.Load("ReportTuner"), Assembly.Load("Common.Web.Ui") }, config);
            }

            var holder  = ActiveRecordMediator.GetSessionFactoryHolder();
            var session = holder.CreateSession(typeof(ActiveRecordBase));
            var ownerId = uint.Parse(ConfigurationManager.AppSettings["ReportsContactGroupOwnerId"]);

            if (session.Get <ContactGroupOwner>(ownerId) == null)
            {
                session.CreateSQLQuery($"Insert into contacts.contact_group_owners (Id) VALUES({ownerId})").UniqueResult();
            }
            holder = ActiveRecordMediator.GetSessionFactoryHolder();
            holder.ReleaseSession(session);
            IntegrationFixture2.Factory = holder.GetSessionFactory(typeof(ActiveRecordBase));

            _webServer = SeleniumFixture.StartServer();
            SeleniumFixture.GlobalSetup();

            using (var taskService = ScheduleHelper.GetService()) {
                ScheduleHelper.CreateFolderIfNeeded(taskService);
            }
        }
 public void TeardownFixture()
 {
     _webServer.ShutDown();
     SeleniumFixture.GlobalTearDown();
     WatinFixture2.GlobalCleanup();
 }
 public void TeardownFixture()
 {
     _webServer.ShutDown();
     SeleniumFixture.GlobalTearDown();
 }
 public void TeardownFixture()
 {
     SeleniumFixture.GlobalTearDown();
     server?.Dispose();
 }
 /// <summary>
 /// Initialise the class with the shared fixture from the base
 /// </summary>
 /// <param name="fixture"></param>
  public TestExample(SeleniumFixture fixture)
 {
     this.fixture = fixture;
     this.driver = fixture.driver;
 }