Beispiel #1
0
        private Program()
        {
            configRepo = new ConfigRepository();

            var config = configRepo.LoadConfig();

            if ("FIREFOX".Equals(config.Browser, StringComparison.OrdinalIgnoreCase))
            {
                InitializeFirefoxDrivers();
            }
            else
            {
                if (string.IsNullOrEmpty(config.Browser))
                {
                    Console.WriteLine($"No existing browser setting. Using default: 'CHROME'.");
                }
                else if (!"CHROME".Equals(config.Browser, StringComparison.OrdinalIgnoreCase))
                {
                    Console.WriteLine($"Invalid browser setting: '{config.Browser}'. Falling back to default: 'CHROME'.");
                }
                InitializeChromeDrivers();
            }

            var screenSize = FindScreenSize();

            if (null != screenSize)
            {
                const int configHeight = 250;
                var(top, bottom) = screenSize.Value.SliceBottom(configHeight);
                var(left, right) = top.SplitVertical();

                timeworksDriver.SetScreenSize(left.Position, left.Size);
                dynamicsDriver.SetScreenSize(right.Position, right.Size);
                configDriver.SetScreenSize(bottom.Position, bottom.Size);
            }
        }
 public ConfigDriver(T driver, ConfigRepository configRepo) : base(driver)
 {
     this.configRepo = configRepo;
 }