Class: IOS

Inherits:
Base show all
Defined in:
lib/skeleton/ios.rb

Constant Summary collapse

ACC_ID =
{
  java: :AccessibilityId,
  ruby: :accessibility_id,
  javascript: :id,
  python: :find_element_by_accessibility_id
}.freeze
NSPREDICATE =
{
  java: :iOSNsPredicateString,
  ruby: :predicate,
  javascript: :predicate,
  python: :find_element_by_ios_predicate
}.freeze
IDENTIFIER =
'identifier'.freeze
LABEL =
'label'.freeze
XCRESULTS_FOLDER =
"#{ROOT_DIR}/XCResults".freeze
XCODEPROJ_FOLDER =
"#{ROOT_DIR}/xcodeproj".freeze

Constants inherited from Base

Base::ATTACHMENTS_FOLDER, Base::PAGE_OBJECTS_FOLDER, Base::ROOT_DIR, Base::TIMESTAMP

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#clear, #precondition

Constructor Details

#initialize(options) ⇒ IOS

Returns a new instance of IOS.



21
22
23
24
25
# File 'lib/skeleton/ios.rb', line 21

def initialize(options)
  self.udid = options.udid
  self.bundle_id = options.bundle
  @language = Language.new
end

Instance Attribute Details

#bundle_idObject

Returns the value of attribute bundle_id.



19
20
21
# File 'lib/skeleton/ios.rb', line 19

def bundle_id
  @bundle_id
end

#udidObject

Returns the value of attribute udid.



19
20
21
# File 'lib/skeleton/ios.rb', line 19

def udid
  @udid
end

Instance Method Details

#devicesObject



38
39
40
# File 'lib/skeleton/ios.rb', line 38

def devices
  `idevice_id -l`.split.uniq.map { |d| d }
end

#skeletonerObject



27
28
29
30
31
32
33
34
35
36
# File 'lib/skeleton/ios.rb', line 27

def skeletoner
  check_udid
  check_bundle
  Log.info('We starting to skeleton your screen 🚀')
  page_source
  create_page_objects
  save_screenshot
  save(code: page_source)
  Log.info('We successfully skeletoned your screen 👻')
end