Sha256: e4a0a5bdcfff1adae7b3f8467e5a20062043b5fedec5ffdd657bb4843e5ca0dc

Contents?: true

Size: 1.77 KB

Versions: 32

Compression:

Stored size: 1.77 KB

Contents

# frozen_string_literal: true

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require_relative 'command/pasteboard'
require_relative 'command/gestures'
require_relative 'command/source'
require_relative 'command/multi_app_handler'
require_relative 'command/get_context'

module Appium
  module Ios
    module Xcuitest
      module Command
        # Starts iOS syslog broadcast websocket
        #
        # @param [String] syslog_file A file path to write messages from a syslog WebSocket client
        #
        # @example
        #
        #   start_logs_broadcast 'outputfile.log' #=> #<Appium::Android::Command::WsLogcat:...>
        #
        def start_logs_broadcast(syslog_file = 'syslog.log')
          @driver.execute_script 'mobile: startLogsBroadcast'

          socket_url = "ws://#{URI.parse(server_url).host}:#{@core.port}/ws/session/#{@driver.session_id}/appium/device/syslog"
          @logcat_client = ::Appium::Common::Command::WsLogcat.new(url: socket_url, output_file: syslog_file)
        end

        # Stop iOS syslog broadcast websocket
        #
        # @example
        #
        #   stop_logs_broadcast #=> nil
        #
        def stop_logs_broadcast
          @logcat_client.close

          @driver.execute_script 'mobile: stopLogsBroadcast'
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
appium_lib-15.3.0 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-15.2.2 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-15.2.1 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-15.2.0 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-15.0.0 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-14.0.0 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-13.0.2 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-13.0.1 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-13.0.0 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-12.2.2 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-12.2.1 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-12.2.0 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-12.1.3 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-12.1.2 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-12.1.1 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-12.1.0 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-12.0.1 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-12.0.0 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-12.0.0.rc5 lib/appium_lib/ios/xcuitest/command.rb
appium_lib-12.0.0.rc4 lib/appium_lib/ios/xcuitest/command.rb