cs-bdd 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b6b20897fce7c934cbacf55b1b33bc5742ab46e
4
- data.tar.gz: 4762ff8d2b22f2dd53aaa4751bc544d7485d18bf
3
+ metadata.gz: 55d2a093c6961e2c5e2a152b82fb446e9ceba512
4
+ data.tar.gz: 331d7f14a87d6adba312b72a77ce76fd9364e478
5
5
  SHA512:
6
- metadata.gz: eee698a839ea1aa8740027d7a00d0314d9f09013c3556609322e5194d3ffaaa8c925bda88f2bdb92aa7a6cda8e035d9f3956f91aade882dc1dcc5ac91cc058f5
7
- data.tar.gz: 5bd7d5e102efdb0326dc15431b10fa9e852f55620d60f7955f56a2dacd2cd7997f870c036e8fb162446d82e268f98d249c855e7d60d3dc425fb63a9ecff9f144
6
+ metadata.gz: d924cc73f99007aaa9651b535c7e9c6cefdf8efca037a6709d9a49451d0540524a9035b91e0f5690fb8b6938a97b79d3127e5dd02ffdacf0d2aef1bb99ffd994
7
+ data.tar.gz: d0e695b319f4d9d29fa5be154b600b5ccde6b928e8348d06d4b5e74a32d6debc29a70b37ba6e4d7e087b5a1023e1d60b2756f6166fe5983d4a8c190144cb24da
@@ -18,9 +18,9 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_runtime_dependency 'bundler', '>=1.7'
22
- spec.add_runtime_dependency 'rake', '>=10.0'
23
- spec.add_runtime_dependency 'thor', '>=0.19.1'
24
- spec.add_runtime_dependency 'i18n', '>=0.6.11'
25
- spec.add_runtime_dependency 'gherkin', '>=2.12.2'
21
+ spec.add_runtime_dependency 'bundler', '>= 1.7'
22
+ spec.add_runtime_dependency 'rake', '>= 10.0'
23
+ spec.add_runtime_dependency 'thor', '>= 0.19.1'
24
+ spec.add_runtime_dependency 'i18n', '>= 0.6.11'
25
+ spec.add_runtime_dependency 'gherkin', '2.12.2'
26
26
  end
@@ -1,5 +1,5 @@
1
1
  module CS
2
2
  module BDD
3
- VERSION = '0.1.7'
3
+ VERSION = '0.1.8'
4
4
  end
5
5
  end
@@ -1,12 +1,24 @@
1
- # Choosing the platform using the current context LOAD PATH
2
- # and looking for the gems of calabash
3
- platform = ''
4
- $LOAD_PATH.each do |path|
5
- platform = 'android' if path.include? 'calabash-android'
6
- platform = 'ios' if path.include? 'calabash-cucumber'
1
+ # Choosing the platform using two environment vars that are mandatory for
2
+ # calabash-ios console execution.
3
+ # If they are not set, then we are executing a calabash android console
4
+ # otherwise, if they are set, then we are execution calabash ios console
5
+ if ENV['APP_BUNDLE_PATH'].nil? && ENV['DEVICE_TARGET'].nil?
6
+ platform = 'android'
7
+ else
8
+ platform = 'ios'
7
9
  end
8
10
 
9
- platform_path = File.join(File.expand_path('.', Dir.pwd), 'features', platform)
11
+ puts "Loading #{platform} classes..."
12
+
13
+ features_path = File.join(File.expand_path('.', Dir.pwd), 'features')
14
+
15
+ # Loading the support ruby files
16
+ Dir[File.join(features_path, 'support', '*.rb')].each do |file|
17
+ # We can't load hook files in calabash console context
18
+ load file unless file.include? 'hooks.rb'
19
+ end
20
+
21
+ platform_path = File.join(features_path, platform)
10
22
 
11
23
  # Loading all ruby files in the base screen path
12
24
  Dir[File.join(platform_path, '*.rb')].each do |file|
@@ -42,7 +42,7 @@ class AndroidScreenBase < Calabash::ABase
42
42
  raise ElementNotFoundError, "ID: #{field_name}" unless
43
43
  visible? public_send(method.to_s.sub('_visible!', ''))
44
44
  else
45
- super
45
+ super(method, args)
46
46
  end
47
47
  end
48
48
 
@@ -45,7 +45,7 @@ class IOSScreenBase < Calabash::IBase
45
45
  raise ElementNotFoundError, "ID: #{field_name}" unless
46
46
  visible? public_send(method.to_s.sub('_visible!', ''))
47
47
  else
48
- super
48
+ super(method, args)
49
49
  end
50
50
  end
51
51
 
@@ -74,20 +74,14 @@ class IOSScreenBase < Calabash::IBase
74
74
  end
75
75
 
76
76
  def drag_to(direction, element = nil)
77
- element = 'tableView' if element.nil?
78
-
79
- case(direction)
80
- when :<%= (I18n.translate "directions.down").to_sym %>
81
- direction = :down
82
- when :<%= (I18n.translate "directions.up").to_sym %>
83
- direction = :up
84
- when :<%= (I18n.translate "directions.left").to_sym %>
85
- positions = :left
86
- when :<%= (I18n.translate "directions.right").to_sym %>
87
- positions = :right
88
- end
77
+ element = 'scrollView' if element.nil?
78
+
79
+ direction = { x: 0, y: 100 } if direction == <%= (I18n.translate "directions.up").to_sym %>
80
+ direction = { x: 0, y: -100 } if direction == <%= (I18n.translate "directions.down").to_sym %>
81
+ direction = { x: 100, y: 0 } if direction == <%= (I18n.translate "directions.left").to_sym %>
82
+ direction = { x: -100, y: 0 } if direction == <%= (I18n.translate "directions.right").to_sym %>
89
83
 
90
- scroll(element, direction)
84
+ flick(element, direction)
91
85
  sleep(1)
92
86
  end
93
87
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cs-bdd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Tanner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-14 00:00:00.000000000 Z
11
+ date: 2016-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -70,14 +70,14 @@ dependencies:
70
70
  name: gherkin
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - '='
74
74
  - !ruby/object:Gem::Version
75
75
  version: 2.12.2
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - '='
81
81
  - !ruby/object:Gem::Version
82
82
  version: 2.12.2
83
83
  description: A simple gem to generate all files needed in a project that will support