Sha256: d7acdcc70fb1f019d71752ccc3b8f3cc17c4b2a908e83386cc08c815b81138e1

Contents?: true

Size: 965 Bytes

Versions: 28

Compression:

Stored size: 965 Bytes

Contents

module Appium
  module Core
    class Base
      module Device
        module Context
          def within_context(context)
            existing_context = current_context
            set_context context
            if block_given?
              result = yield
              set_context existing_context
              result
            else
              set_context existing_context
            end
          end

          def switch_to_default_context
            set_context nil
          end

          def current_context
            execute :current_context
          end

          def available_contexts
            # return empty array instead of nil on failure
            execute(:available_contexts, {}) || []
          end

          def set_context(context = null)
            execute :set_context, {}, name: context
          end
        end # module ImeActions
      end # module Device
    end # class Base
  end # module Core
end # module Appium

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
appium_lib_core-3.0.2 lib/appium_lib_core/common/device/context.rb
appium_lib_core-3.0.1 lib/appium_lib_core/common/device/context.rb
appium_lib_core-3.0.0 lib/appium_lib_core/common/device/context.rb
appium_lib_core-2.3.4 lib/appium_lib_core/common/device/context.rb
appium_lib_core-2.3.3 lib/appium_lib_core/common/device/context.rb
appium_lib_core-2.3.2 lib/appium_lib_core/common/device/context.rb
appium_lib_core-2.3.1 lib/appium_lib_core/common/device/context.rb
appium_lib_core-2.3.0 lib/appium_lib_core/common/device/context.rb
appium_lib_core-2.2.2 lib/appium_lib_core/common/device/context.rb
appium_lib_core-2.2.1 lib/appium_lib_core/common/device/context.rb
appium_lib_core-2.2.0 lib/appium_lib_core/common/device/context.rb
appium_lib_core-2.1.1 lib/appium_lib_core/common/device/context.rb
appium_lib_core-2.1.0 lib/appium_lib_core/common/device/context.rb
appium_lib_core-2.0.6 lib/appium_lib_core/common/device/context.rb
appium_lib_core-2.0.5 lib/appium_lib_core/common/device/context.rb
appium_lib_core-2.0.4 lib/appium_lib_core/common/device/context.rb
appium_lib_core-2.0.3 lib/appium_lib_core/common/device/context.rb
appium_lib_core-2.0.2 lib/appium_lib_core/common/device/context.rb
appium_lib_core-2.0.1 lib/appium_lib_core/common/device/context.rb
appium_lib_core-2.0.0 lib/appium_lib_core/common/device/context.rb