示例#1
0
        public WebDriverConfigAttribute(WebDriverType type, WebDriverScope scope = default(WebDriverScope), string preset = null)
        {
            if (type == default(WebDriverType))
            {
                throw new ArgumentException(nameof(type));
            }

            Type   = type;
            Scope  = scope;
            Preset = preset;
        }
示例#2
0
        protected WbTstrFixtureBase()
        {
            if (Attribute.GetCustomAttribute(GetType(), typeof(WebDriverConfigAttribute)) is WebDriverConfigAttribute attribute)
            {
                _webDriverScope = attribute.Scope;

                bool usePreset = !string.IsNullOrEmpty(attribute.Preset);
                _webDriverConfig = usePreset ? WebDriverConfigs.GetFromPreset(attribute.Type, attribute.Preset)
                                             : WebDriverConfigs.GetDefault(attribute.Type);
            }
            else
            {
                throw new MissingWebDriverConfigException("WebDriverConfig attribute is not present.");
            }
        }