Пример #1
0
 public RemoteWebDriver(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
 {
     this.executor = commandExecutor;
     this.StartClient();
     this.StartSession(desiredCapabilities);
     this.mouse    = new RemoteMouse(this);
     this.keyboard = new RemoteKeyboard(this);
     if (this.capabilities.HasCapability(CapabilityType.SupportsApplicationCache))
     {
         object capability = this.capabilities.GetCapability(CapabilityType.SupportsApplicationCache);
         if (capability is bool && (bool)capability)
         {
             this.appCache = new RemoteApplicationCache(this);
         }
     }
     if (this.capabilities.HasCapability(CapabilityType.SupportsLocationContext))
     {
         object capability2 = this.capabilities.GetCapability(CapabilityType.SupportsLocationContext);
         if (capability2 is bool && (bool)capability2)
         {
             this.locationContext = new RemoteLocationContext(this);
         }
     }
     if (this.capabilities.HasCapability(CapabilityType.SupportsWebStorage))
     {
         object capability3 = this.capabilities.GetCapability(CapabilityType.SupportsWebStorage);
         if (capability3 is bool && (bool)capability3)
         {
             this.storage = new RemoteWebStorage(this);
         }
     }
 }
Пример #2
0
 private ILocationContext CreateDataBaseIfNeeded(ILocationContext db)
 {
     if (db.DatabaseExists() == false)
     {
         db.CreateDatabase();
     }
     return(db);
 }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WebDriver"/> class.
        /// </summary>
        /// <param name="executor">The <see cref="ICommandExecutor"/> object used to execute commands.</param>
        /// <param name="capabilities">The <see cref="ICapabilities"/> object used to configuer the driver session.</param>
        protected WebDriver(ICommandExecutor executor, ICapabilities capabilities)
        {
            this.executor = executor;
            this.StartSession(capabilities);
            this.elementFactory = new WebElementFactory(this);
            this.network        = new NetworkManager(this);
            this.registeredCommands.AddRange(DriverCommand.KnownCommands);

            if ((this as ISupportsLogs) != null)
            {
                // Only add the legacy log commands if the driver supports
                // retrieving the logs via the extension end points.
                this.RegisterDriverCommand(DriverCommand.GetAvailableLogTypes, new HttpCommandInfo(HttpCommandInfo.GetCommand, "/session/{sessionId}/se/log/types"), true);
                this.RegisterDriverCommand(DriverCommand.GetLog, new HttpCommandInfo(HttpCommandInfo.PostCommand, "/session/{sessionId}/se/log"), true);
            }

            // These below code exists solely to support obsolete protocol end points.
            // They should be removed at the earliest available opportunity.
            if (this.Capabilities.HasCapability(CapabilityType.SupportsApplicationCache))
            {
                object appCacheCapability = this.Capabilities.GetCapability(CapabilityType.SupportsApplicationCache);
                if (appCacheCapability is bool && (bool)appCacheCapability)
                {
                    this.appCache = new ApplicationCache(this);
                }
            }

            if (this.Capabilities.HasCapability(CapabilityType.SupportsLocationContext))
            {
                object locationContextCapability = this.Capabilities.GetCapability(CapabilityType.SupportsLocationContext);
                if (locationContextCapability is bool && (bool)locationContextCapability)
                {
                    this.locationContext = new LocationContext(this);
                }
            }

            if (this.Capabilities.HasCapability(CapabilityType.SupportsWebStorage))
            {
                object webContextCapability = this.Capabilities.GetCapability(CapabilityType.SupportsWebStorage);
                if (webContextCapability is bool && (bool)webContextCapability)
                {
                    this.storage = new WebStorage(this);
                }
            }
        }
Пример #4
0
 public void Register(ISubActivityContext context)
 {
     if (context is IVerticalContext)
     {
         _verticalContext = (IVerticalContext)context;
     }
     else if (context is ICommunityContext)
     {
         _communityContext = (ICommunityContext)context;
     }
     else if (context is ILocationContext)
     {
         _locationContext = (ILocationContext)context;
     }
     else if (context is IChannelContext)
     {
         _channelContext = (IChannelContext)context;
     }
 }
Пример #5
0
 public LocationObject(UserObject owner, ILocationContext context)
 {
     Owner   = owner;
     Context = context;
 }
Пример #6
0
 public LocationLogic(ILocationContext context)
 {
     _context = context;
 }
Пример #7
0
 public LocationLogic(ILocationContext context)
 {
     _context = context;
 }
Пример #8
0
 public void CopyTo(ILocationContext target)
 {
     target.Ip = Ip;
 }
 public LocationFactory(ILocationContext context)
 {
     Context = context;
 }
Пример #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LocationService"/> class.
 /// </summary>
 /// <param name="imeiService">The IMEI service this service should use.</param>
 /// <param name="context">The data context to store to.</param>
 /// <remarks>If <paramref name="imeiService"/> is null, it will be loaded from the DependencyResolver</remarks>
 public LocationService(ILocationContext context, IIMEIService imeiService)
 {
     _imeiService = imeiService;
     _dataContext = context;
 }
Пример #11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RemoteWebDriver"/> class
        /// </summary>
        /// <param name="commandExecutor">An <see cref="ICommandExecutor"/> object which executes commands for the driver.</param>
        /// <param name="desiredCapabilities">An <see cref="ICapabilities"/> object containing the desired capabilities of the browser.</param>
        public RemoteWebDriver(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
        {
            this.executor = commandExecutor;
            this.StartClient();
            this.StartSession(desiredCapabilities);
            this.mouse = new RemoteMouse(this);
            this.keyboard = new RemoteKeyboard(this);

            if (this.capabilities.HasCapability(CapabilityType.SupportsApplicationCache))
            {
                object appCacheCapability = this.capabilities.GetCapability(CapabilityType.SupportsApplicationCache);
                if (appCacheCapability is bool && (bool)appCacheCapability)
                {
                    this.appCache = new RemoteApplicationCache(this);
                }
            }

            if (this.capabilities.HasCapability(CapabilityType.SupportsLocationContext))
            {
                object locationContextCapability = this.capabilities.GetCapability(CapabilityType.SupportsLocationContext);
                if (locationContextCapability is bool && (bool)locationContextCapability)
                {
                this.locationContext = new RemoteLocationContext(this);
                }
            }

            if (this.capabilities.HasCapability(CapabilityType.SupportsWebStorage))
            {
                object webContextCapability = this.capabilities.GetCapability(CapabilityType.SupportsWebStorage);
                if (webContextCapability is bool && (bool)webContextCapability)
                {
                    this.storage = new RemoteWebStorage(this);
                }
            }
        }
Пример #12
0
 /// <summary>
 /// Initializes a new instance of the RemoteWebDriver class
 /// </summary>
 /// <param name="commandExecutor">An <see cref="ICommandExecutor"/> object which executes commands for the driver.</param>
 /// <param name="desiredCapabilities">An <see cref="ICapabilities"/> object containing the desired capabilities of the browser.</param>
 public RemoteWebDriver(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
 {
     this.executor = commandExecutor;
     this.StartClient();
     this.StartSession(desiredCapabilities);
     this.mouse = new RemoteMouse(this);
     this.keyboard = new RemoteKeyboard(this);
     this.storage = new RemoteWebStorage(this);
     this.appCache = new RemoteApplicationCache(this);
     this.locationContext = new RemoteLocationContext(this);
 }
Пример #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ReportService"/> class.
 /// </summary>
 /// <param name="context">The data context to store to.</param>
 public ReportService(ILocationContext context)
 {
     _dataContext = context;
 }
Пример #14
0
 protected BaseRepository(ILocationContext store)
 {
     _locationStore = store;
 }
Пример #15
0
 public LocationRepository(ILocationContext context)
 {
     context = new LocationContext();
 }
Пример #16
0
 private void SetUp()
 {
     _factory = Substitute.For <ILocationContextFactory>();
     _context = Substitute.For <ILocationContext>();
     _factory.Create().Returns(_context);
 }
Пример #17
0
 public LocationRepo(ILocationContext context)
 {
     Context = context;
 }
Пример #18
0
 public LocationRepository(ILocationContext store)
     : base(store)
 {
 }
Пример #19
0
 public LocationService(ILocationContext context) : this(context, null)
 {
 }