Sha256: c6963553e82cb35e5b47b19ad6a573803ff9695e8447ecccdcdd6b8142c21229

Contents?: true

Size: 466 Bytes

Versions: 2

Compression:

Stored size: 466 Bytes

Contents

require 'HTTParty'

class AppiumServerClient
    def isSessionAlive?(session_url)
        uri = "#{session_url}/sessions"
        response = HTTParty.get(uri, headers: get_default_headers)
        sessions  = JSON.parse(response.to_s)
        session_state =  sessions["value"].empty?
        return !session_state
    end

    def get_default_headers
        headers = {
            'Content-Type': "Application/json"
        }
        return  headers
      end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
optimus-runner-1.2.0 lib/optimus-runner/clients/AppiumServerClient.rb
optimus-runner-1.1.4 lib/optimus-runner/clients/AppiumServerClient.rb