예제 #1
0
        /// <summary>
        /// Initializes a new instance of the PhantomJSDriver class using the specified <see cref="PhantomJSDriverService"/>.
        /// </summary>
        /// <param name="service">The <see cref="PhantomJSDriverService"/> to use.</param>
        /// <param name="options">The <see cref="PhantomJSOptions"/> used to initialize the driver.</param>
        /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
        public PhantomJSDriver(PhantomJSDriverService service, PhantomJSOptions options, TimeSpan commandTimeout)
            : base(new DriverServiceCommandExecutor(service, commandTimeout, false), options.ToCapabilities())
        {
            // Add the custom commandInfo of PhantomJSDriver
            CommandInfo commandInfo = new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/phantom/execute");

            this.CommandExecutor.CommandInfoRepository.TryAddCommand(CommandExecutePhantomScript, commandInfo);
        }
예제 #2
0
 private static ICapabilities ConvertOptionsToCapabilities(PhantomJSOptions options)
 {
     if (options == null)
     {
         throw new ArgumentNullException("options", "options must not be null");
     }
     return(options.ToCapabilities());
 }
 /// <summary>
 /// Initializes a new instance of the PhantomJSDriver class using the specified <see cref="PhantomJSDriverService"/>.
 /// </summary>
 /// <param name="service">The <see cref="PhantomJSDriverService"/> to use.</param>
 /// <param name="options">The <see cref="PhantomJSOptions"/> used to initialize the driver.</param>
 /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
 public PhantomJSDriver(PhantomJSDriverService service, PhantomJSOptions options, TimeSpan commandTimeout)
     : base(new DriverServiceCommandExecutor(service, commandTimeout, false), options.ToCapabilities())
 {
 }
예제 #4
0
        private static ICapabilities ConvertOptionsToCapabilities(PhantomJSOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException("options", "options must not be null");
            }

            return options.ToCapabilities();
        }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the PhantomJSDriver class using the specified <see cref="PhantomJSDriverService"/>.
 /// </summary>
 /// <param name="service">The <see cref="PhantomJSDriverService"/> to use.</param>
 /// <param name="options">The <see cref="PhantomJSOptions"/> used to initialize the driver.</param>
 /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
 public PhantomJSDriver(PhantomJSDriverService service, PhantomJSOptions options, TimeSpan commandTimeout)
     : base(new DriverServiceCommandExecutor(service, commandTimeout, false), options.ToCapabilities())
 {
 }
예제 #6
0
 /// <summary>
 /// Initializes a new instance of the PhantomJSDriver class using the specified <see cref="PhantomJSDriverService"/>.
 /// </summary>
 /// <param name="service">The <see cref="PhantomJSDriverService"/> to use.</param>
 /// <param name="options">The <see cref="PhantomJSOptions"/> used to initialize the driver.</param>
 /// <param name="commandTimeout">The maximum amount of time to wait for each command.</param>
 public PhantomJSDriver(PhantomJSDriverService service, PhantomJSOptions options, TimeSpan commandTimeout)
     : base(new DriverServiceCommandExecutor(service, commandTimeout, false), options.ToCapabilities())
 {
     // Add the custom commandInfo of PhantomJSDriver
     CommandInfo commandInfo = new CommandInfo(CommandInfo.PostCommand, "/session/{sessionId}/phantom/execute");
     CommandInfoRepository.Instance.TryAddAdditionalCommand(CommandExecutePhantomScript, commandInfo);
 }