Skip to content

Commit

Permalink
ISSUE-1: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
testableapple committed Aug 6, 2018
1 parent 286d66e commit a8c7c72
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 2 additions & 5 deletions lib/skeleton.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,17 @@ def platform=(platform)
end

def run
@driver.clear
@driver.precondition
@driver.skeletoner
fill_html
open_url
end

def fill_html
language = Language.new
languages = %w[ruby java python javascript]
languages += %w[swift] if ios?
languages = ios? ? Language.all : Language.all - ['swift']
languages.each do |lang|
attach_image
type = language.type(lang)
type = Language.domain(lang)
folder = Base::PAGE_OBJECTS_FOLDER
@screen_objects = File.read(Dir["#{folder}/*.#{type}"].first)
@elements_tree = File.read(Dir["#{folder}/*.xml"].first)
Expand Down
6 changes: 5 additions & 1 deletion lib/skeleton/languages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def swift(camel_method_name:, element_type:, locator_value:, accessibility_id:)
end
end

def type(format)
def self.domain(format)
case format
when 'ruby', 'rb'
RUBY
Expand All @@ -65,6 +65,10 @@ def type(format)
"I haven't this language format"
end
end

def self.all
%w[ruby java python javascript swift]
end
end

class XCUIElement
Expand Down
2 changes: 1 addition & 1 deletion lib/skeleton/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Skeleton
VERSION ||= '0.1.12'.freeze
VERSION ||= '0.1.13'.freeze
GEM_NAME ||= 'skeleton-ui'.freeze
end

0 comments on commit a8c7c72

Please sign in to comment.