cs-bdd 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +19 -1
- data/bin/cs-bdd +84 -0
- data/bin/cs-bdd-helpers.rb +20 -2
- data/cs-bdd.gemspec +14 -2
- data/lib/aws/android/app_installation_hooks.rb +30 -0
- data/lib/aws/android/app_life_cycle_hooks.rb +13 -0
- data/lib/aws/ios/01_launch.rb +43 -0
- data/lib/cs/bdd/locales/pt.yml +10 -10
- data/lib/cs/bdd/version.rb +1 -1
- data/lib/cs/bdd/zip.rb +49 -0
- data/lib/templates/android_screen_base.tt +7 -2
- data/lib/templates/ios_screen_base.tt +15 -4
- metadata +26 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7067e6f033313a2ae4190169efd0bcf9a1b1bf56
|
4
|
+
data.tar.gz: 9f3bed0674dcba7704ee1b5dbfca2fc2e450e985
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e12d9d446babc82bf1feb83147684bd1b38121abf771e0277ab94fc455a71f729359e914111f844d4fd47bbe6898feead8c6d3b8fa322f41658445a5b12e77c
|
7
|
+
data.tar.gz: cafbad20146fffa9963b325a8ebe2f17e393284a6d50025f5c58e4b87cfa73e09f9e0e459eefb0dd096bc5034a2300cd57df9d3c50cfe65d101de4849a5dc2de
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,15 @@
|
|
1
|
+
|
2
|
+
##[DEPRECATION]
|
3
|
+
|
4
|
+
This gem has been renamed to sunomono and will no longer be supported. Please switch to sunomono as soon as possible.
|
5
|
+
|
6
|
+
> See: https://rubygems.org/gems/sunomono
|
7
|
+
|
8
|
+
> And: https://github.com/concretesolutions/sunomono
|
9
|
+
|
1
10
|
# CS::BDD
|
11
|
+
|
12
|
+
|
2
13
|
[![cs-bdd API Documentation](https://www.omniref.com/ruby/gems/cs-bdd.png)](https://www.omniref.com/ruby/gems/cs-bdd)
|
3
14
|
|
4
15
|
A simple gem to generate all files needed in a project that will support calabash for both Android and iOS.
|
@@ -54,6 +65,13 @@ This command will create a folder named ProjectName in the current directory and
|
|
54
65
|
cs-bdd new ProjectName --lang=pt
|
55
66
|
```
|
56
67
|
|
68
|
+
If you use Windows, to avoid encoding problems, run the following command in cmd:
|
69
|
+
|
70
|
+
```
|
71
|
+
[HKEY_CURRENT_USER\Software\Microsoft\Command Processor] "AutoRun"="chcp 65001"
|
72
|
+
```
|
73
|
+
|
74
|
+
|
57
75
|
> The default language is English ('en'). The elements of Gherkin such as Given, When, Then, And, Scenario will be translated to all Gherkin supported languages, but this gem has just a few translation files (see that in folder: `lib/cs/bdd/locales`).
|
58
76
|
|
59
77
|
> **CS-BDD doesn't support your mother language?** No problem. Fork it, create your yml translation file, uses the en.yml file as a template. Translate it and make a pull request. There are only 15 lines to be translated, this will take no time.
|
@@ -131,7 +149,7 @@ The project contains a lot of scripts that will help you to configure you CI ser
|
|
131
149
|
|
132
150
|
## Contributing
|
133
151
|
|
134
|
-
1. Fork it ( https://github.com/
|
152
|
+
1. Fork it ( https://github.com/concretesolutions/cs-bdd/fork )
|
135
153
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
136
154
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
137
155
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/bin/cs-bdd
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# -*- coding: utf-8 -*-
|
2
3
|
|
3
4
|
require 'thor'
|
4
5
|
require 'thor/group'
|
@@ -21,6 +22,8 @@ module CS
|
|
21
22
|
banner: 'any of the gherkin supported languages',
|
22
23
|
default: :en
|
23
24
|
def feature(name)
|
25
|
+
deprecated_warnings
|
26
|
+
|
24
27
|
I18n.config.default_locale = options[:lang]
|
25
28
|
in_root_project_folder?
|
26
29
|
|
@@ -35,6 +38,8 @@ module CS
|
|
35
38
|
banner: 'any of the gherkin supported languages',
|
36
39
|
default: :en
|
37
40
|
def aFeature(name)
|
41
|
+
deprecated_warnings
|
42
|
+
|
38
43
|
I18n.config.default_locale = options[:lang]
|
39
44
|
in_root_project_folder?
|
40
45
|
|
@@ -48,6 +53,8 @@ module CS
|
|
48
53
|
banner: 'any of the gherkin supported languages',
|
49
54
|
default: :en
|
50
55
|
def iFeature(name)
|
56
|
+
deprecated_warnings
|
57
|
+
|
51
58
|
I18n.config.default_locale = options[:lang]
|
52
59
|
in_root_project_folder?
|
53
60
|
|
@@ -61,6 +68,8 @@ module CS
|
|
61
68
|
banner: 'any of the gherkin supported languages',
|
62
69
|
default: :en
|
63
70
|
def step(name)
|
71
|
+
deprecated_warnings
|
72
|
+
|
64
73
|
I18n.config.default_locale = options[:lang]
|
65
74
|
in_root_project_folder?
|
66
75
|
create_steps_file name
|
@@ -71,6 +80,8 @@ module CS
|
|
71
80
|
banner: 'any of the gherkin supported languages',
|
72
81
|
default: :en
|
73
82
|
def aStep(name)
|
83
|
+
deprecated_warnings
|
84
|
+
|
74
85
|
I18n.config.default_locale = options[:lang]
|
75
86
|
in_root_project_folder?
|
76
87
|
create_steps_file name, 'Android'
|
@@ -81,6 +92,8 @@ module CS
|
|
81
92
|
banner: 'any of the gherkin supported languages',
|
82
93
|
default: :en
|
83
94
|
def iStep(name)
|
95
|
+
deprecated_warnings
|
96
|
+
|
84
97
|
I18n.config.default_locale = options[:lang]
|
85
98
|
in_root_project_folder?
|
86
99
|
create_steps_file name, 'IOS'
|
@@ -92,6 +105,8 @@ module CS
|
|
92
105
|
banner: 'any of the gherkin supported languages',
|
93
106
|
default: :en
|
94
107
|
def screen(name)
|
108
|
+
deprecated_warnings
|
109
|
+
|
95
110
|
I18n.config.default_locale = options[:lang]
|
96
111
|
in_root_project_folder?
|
97
112
|
create_screen_file name, 'Android'
|
@@ -103,6 +118,8 @@ module CS
|
|
103
118
|
banner: 'any of the gherkin supported languages',
|
104
119
|
default: :en
|
105
120
|
def aScreen(name)
|
121
|
+
deprecated_warnings
|
122
|
+
|
106
123
|
I18n.config.default_locale = options[:lang]
|
107
124
|
in_root_project_folder?
|
108
125
|
create_screen_file name, 'Android'
|
@@ -113,11 +130,74 @@ module CS
|
|
113
130
|
banner: 'any of the gherkin supported languages',
|
114
131
|
default: :en
|
115
132
|
def iScreen(name)
|
133
|
+
deprecated_warnings
|
134
|
+
|
116
135
|
I18n.config.default_locale = options[:lang]
|
117
136
|
in_root_project_folder?
|
118
137
|
create_screen_file name, 'IOS'
|
119
138
|
end
|
120
139
|
|
140
|
+
desc 'aws_zip', 'Prepare a zip file for AWS Device Farm execution'
|
141
|
+
option 'skip-char-validation',
|
142
|
+
banner: 'skips the special chars validation that can cancel the zip creation',
|
143
|
+
type: :boolean,
|
144
|
+
lazy_default: true
|
145
|
+
def aws_zip
|
146
|
+
deprecated_warnings
|
147
|
+
|
148
|
+
in_root_project_folder?
|
149
|
+
|
150
|
+
# Looking for special chars in the specs folder
|
151
|
+
unless options['skip-char-validation']
|
152
|
+
entries = `grep -inrE 'á|â|ã|é|ê|í|ó|õ|ô|ú|ç' . --exclude-dir={.git,screenshots,config,support,test_servers} --exclude='*.zip'`
|
153
|
+
if entries.count("\n") > 0
|
154
|
+
puts <<-END
|
155
|
+
|
156
|
+
There are special chars in your specs.
|
157
|
+
This can block AWS Device Farm execution.'
|
158
|
+
Entries found:
|
159
|
+
#{entries}
|
160
|
+
|
161
|
+
To skip this validation use: '--skip-char-validation'
|
162
|
+
Exiting...
|
163
|
+
END
|
164
|
+
exit 1
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
168
|
+
# Temp folder that will hold the project files to be zipped
|
169
|
+
dir = Dir.mktmpdir
|
170
|
+
begin
|
171
|
+
# Copying all folders from specs that are valid in AWS context
|
172
|
+
directory FileUtils.pwd,
|
173
|
+
dir,
|
174
|
+
exclude_pattern: /(.git|.DS_Store|.irb-history|.gitignore|.gitkeep|screenshot|.apk|.zip)/
|
175
|
+
# Replacing launcher files to avoid problems with AWS Device Farm
|
176
|
+
copy_file File.join(File.dirname(__FILE__), '..', 'lib',
|
177
|
+
'aws', 'android', 'app_installation_hooks.rb'),
|
178
|
+
File.join(dir, 'features', 'android',
|
179
|
+
'support', 'app_installation_hooks.rb'),
|
180
|
+
force: true
|
181
|
+
copy_file File.join(File.dirname(__FILE__), '..', 'lib',
|
182
|
+
'aws', 'android', 'app_life_cycle_hooks.rb'),
|
183
|
+
File.join(dir, 'features', 'android',
|
184
|
+
'support', 'app_life_cycle_hooks.rb'),
|
185
|
+
force: true
|
186
|
+
copy_file File.join(File.dirname(__FILE__), '..', 'lib',
|
187
|
+
'aws', 'ios', '01_launch.rb'),
|
188
|
+
File.join(dir, 'features', 'ios',
|
189
|
+
'support', '01_launch.rb'),
|
190
|
+
force: true
|
191
|
+
|
192
|
+
# Creating zip file
|
193
|
+
zip_file_name = zip_folder(dir)
|
194
|
+
say_status(:create, zip_file_name)
|
195
|
+
ensure
|
196
|
+
# remove the directory.
|
197
|
+
FileUtils.remove_entry_secure dir
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
121
201
|
def self.source_root
|
122
202
|
File.join(File.dirname(__FILE__), '..', 'lib', 'templates')
|
123
203
|
end
|
@@ -150,6 +230,8 @@ module CS
|
|
150
230
|
banner: 'any of the gherkin supported languages',
|
151
231
|
default: :en
|
152
232
|
def new(name)
|
233
|
+
deprecated_warnings
|
234
|
+
|
153
235
|
I18n.config.default_locale = options[:lang]
|
154
236
|
# Thor will be responsible to look for identical
|
155
237
|
# files and possibles conflicts
|
@@ -171,6 +253,8 @@ module CS
|
|
171
253
|
|
172
254
|
desc 'version', 'Shows the gem version'
|
173
255
|
def version
|
256
|
+
deprecated_warnings
|
257
|
+
|
174
258
|
puts "cs-bdd Version #{CS::BDD::VERSION}"
|
175
259
|
end
|
176
260
|
|
data/bin/cs-bdd-helpers.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require_relative '../lib/cs/bdd/zip'
|
2
|
+
|
1
3
|
def create_feature_file(name, platform = nil)
|
2
4
|
# options used to generate the file in the template function
|
3
5
|
opts = { name: camelize(name) }
|
@@ -51,8 +53,8 @@ def create_screen_file(name, platform)
|
|
51
53
|
template('screen',
|
52
54
|
File.join(
|
53
55
|
FileUtils.pwd, 'features', platform.downcase, 'screens',
|
54
|
-
"#{name.downcase}_screen.rb"
|
55
|
-
opts)
|
56
|
+
"#{name.downcase}_screen.rb"
|
57
|
+
), opts)
|
56
58
|
end
|
57
59
|
|
58
60
|
def camelize(string)
|
@@ -75,3 +77,19 @@ def in_root_project_folder?
|
|
75
77
|
|
76
78
|
true
|
77
79
|
end
|
80
|
+
|
81
|
+
def zip_folder(dir)
|
82
|
+
file_name = "#{Time.now.strftime('%Y%m%d%H%M%S')}_specs.zip"
|
83
|
+
zf = ZipFileGenerator.new(dir, file_name)
|
84
|
+
zf.write
|
85
|
+
file_name
|
86
|
+
end
|
87
|
+
|
88
|
+
def deprecated_warnings
|
89
|
+
puts "
|
90
|
+
========================================= WARNING:[DEPRECATION] ===================================================================\n
|
91
|
+
This gem has been renamed to sunomono and will no longer be supported. Please switch to sunomono as soon as possible.\n
|
92
|
+
See: See: https://rubygems.org/gems/sunomono \n And: https://github.com/concretesolutions/sunomono\n
|
93
|
+
====================================================================================================================================
|
94
|
+
"
|
95
|
+
end
|
data/cs-bdd.gemspec
CHANGED
@@ -7,10 +7,10 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = 'cs-bdd'
|
8
8
|
spec.version = CS::BDD::VERSION
|
9
9
|
spec.authors = ['Oscar Tanner']
|
10
|
-
spec.email = ['
|
10
|
+
spec.email = ['oscarpanda@gmail.com']
|
11
11
|
spec.summary = 'Generates an android and iOS calabash project.'
|
12
12
|
spec.description = %q{A simple gem to generate all files needed in a project that will support Calabash for both Android and iOS.}
|
13
|
-
spec.homepage = 'https://github.com/
|
13
|
+
spec.homepage = 'https://github.com/concretesolutions/cs-bdd'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -23,4 +23,16 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_runtime_dependency 'thor', '>= 0.19.1'
|
24
24
|
spec.add_runtime_dependency 'i18n', '>= 0.6.11'
|
25
25
|
spec.add_runtime_dependency 'gherkin', '2.12.2'
|
26
|
+
spec.add_runtime_dependency 'rubyzip', '~>1.1'
|
27
|
+
|
28
|
+
spec.post_install_message = <<-MESSAGE
|
29
|
+
|
30
|
+
|
31
|
+
========================================= WARNING:[DEPRECATION] ===================================================================\n
|
32
|
+
This gem has been renamed to sunomono and will no longer be supported. Please switch to sunomono as soon as possible.\n
|
33
|
+
See: See: https://rubygems.org/gems/sunomono \n And: https://github.com/concretesolutions/sunomono\n
|
34
|
+
====================================================================================================================================
|
35
|
+
|
36
|
+
|
37
|
+
MESSAGE
|
26
38
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'calabash-android/management/app_installation'
|
2
|
+
|
3
|
+
AfterConfiguration do |config|
|
4
|
+
FeatureMemory.feature = nil
|
5
|
+
end
|
6
|
+
|
7
|
+
Before do |scenario|
|
8
|
+
@scenario_is_outline = (scenario.class ==
|
9
|
+
Cucumber::Ast::OutlineTable::ExampleRow)
|
10
|
+
scenario = scenario.scenario_outline if @scenario_is_outlinel
|
11
|
+
|
12
|
+
feature = scenario.feature
|
13
|
+
if FeatureMemory.feature != feature || ENV['RESET_BETWEEN_SCENARIOS'] == '1'
|
14
|
+
if ENV['RESET_BETWEEN_SCENARIOS'] == '1'
|
15
|
+
log 'New scenario - reinstalling apps'
|
16
|
+
else
|
17
|
+
log 'First scenario in feature - reinstalling apps'
|
18
|
+
end
|
19
|
+
|
20
|
+
uninstall_apps
|
21
|
+
install_app(ENV['TEST_APP_PATH'])
|
22
|
+
install_app(ENV['APP_PATH'])
|
23
|
+
FeatureMemory.feature = feature
|
24
|
+
FeatureMemory.invocation = 1
|
25
|
+
else
|
26
|
+
FeatureMemory.invocation += 1
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
FeatureMemory = Struct.new(:feature, :invocation).new
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'calabash-cucumber/launcher'
|
2
|
+
|
3
|
+
# You can find examples of more complicated launch hooks in these
|
4
|
+
# two repositories:
|
5
|
+
#
|
6
|
+
# https://github.com/calabash/ios-smoke-test-app/blob/master/CalSmokeApp/features/support/01_launch.rb
|
7
|
+
# https://github.com/calabash/ios-webview-test-app/blob/master/CalWebViewApp/features/support/01_launch.rb
|
8
|
+
|
9
|
+
module Calabash::Launcher
|
10
|
+
@@launcher = nil
|
11
|
+
|
12
|
+
def self.launcher
|
13
|
+
@@launcher ||= Calabash::Cucumber::Launcher.new
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.launcher=(launcher)
|
17
|
+
@@launcher = launcher
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
Before do
|
22
|
+
launcher = Calabash::Launcher.launcher
|
23
|
+
options = {
|
24
|
+
timeout: 3000
|
25
|
+
}
|
26
|
+
|
27
|
+
launcher.relaunch(options)
|
28
|
+
end
|
29
|
+
|
30
|
+
After do |scenario|
|
31
|
+
# Calabash can shutdown the app cleanly by calling the app life cycle methods
|
32
|
+
# in the UIApplicationDelegate. This is really nice for CI environments, but
|
33
|
+
# not so good for local development.
|
34
|
+
#
|
35
|
+
# See the documentation for QUIT_APP_AFTER_SCENARIO for a nice debugging workflow
|
36
|
+
#
|
37
|
+
# http://calabashapi.xamarin.com/ios/file.ENVIRONMENT_VARIABLES.html#label-QUIT_APP_AFTER_SCENARIO
|
38
|
+
# http://calabashapi.xamarin.com/ios/Calabash/Cucumber/Core.html#console_attach-instance_method
|
39
|
+
if launcher.quit_app_after_scenario?
|
40
|
+
calabash_exit
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
data/lib/cs/bdd/locales/pt.yml
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
pt:
|
2
2
|
android_only: "(Somente Android)"
|
3
3
|
ios_only: "(Somente iOS)"
|
4
|
-
first_scenario: "Primeiro
|
4
|
+
first_scenario: "Primeiro Cenario"
|
5
5
|
comments:
|
6
6
|
trait: "Identificador da tela"
|
7
7
|
insert_steps: "Insira os passos"
|
8
8
|
elements: "Declare todos os elementos da tela"
|
9
9
|
actions: "Declare todas as acoes da tela"
|
10
10
|
steps:
|
11
|
-
drag_until: 'que Eu (?:arrastei|arrasto) a tela para (baixo|cima|esquerda|direita)
|
12
|
-
page_contains: "que Eu estou em uma
|
11
|
+
drag_until: 'que Eu (?:arrastei|arrasto) a tela para (baixo|cima|esquerda|direita) ate ver o elemento "(.*?)"'
|
12
|
+
page_contains: "que Eu estou em uma pagina que contem '(.*?)'"
|
13
13
|
drag_number_of_times: 'Eu arrasto a tela para (esquerda|direita|baixo|cima) (\d+) vezes'
|
14
14
|
touch_element: 'Eu (?:clico|cliquei) no elemento "(.*?)"'
|
15
15
|
drag_screen: "Eu arrasto a tela para (baixo|cima|esquerda|direita)"
|
16
|
-
wait_progress_bar: "Eu (?:espero|esperei)
|
17
|
-
should_see_page: "Eu deveria ver a
|
18
|
-
should_see_page_that_contains: "Eu deveria ver uma
|
19
|
-
take_print: "
|
20
|
-
been_in_page: "que eu (?:estou|estava) na (?:
|
21
|
-
move_to_page: "eu (?:devo|deveria) estar na (?:
|
22
|
-
restart_app: "(Eu |)reiniciar o aplicativo"
|
16
|
+
wait_progress_bar: "Eu (?:espero|esperei) ate a barra de progresso sumir"
|
17
|
+
should_see_page: "Eu deveria ver a pagina '(.*?)'"
|
18
|
+
should_see_page_that_contains: "Eu deveria ver uma pagina que contem '(.*?)'"
|
19
|
+
take_print: "faco um print"
|
20
|
+
been_in_page: "que eu (?:estou|estava) na (?:pagina|tela)(?: de|) '(.*?)'"
|
21
|
+
move_to_page: "eu (?:devo|deveria) estar na (?:pagina|tela)(?: de|) '(.*?)'"
|
22
|
+
restart_app: "(?:Eu |)reiniciar o aplicativo"
|
23
23
|
directions:
|
24
24
|
up: 'cima'
|
25
25
|
down: 'baixo'
|
data/lib/cs/bdd/version.rb
CHANGED
data/lib/cs/bdd/zip.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'zip'
|
2
|
+
|
3
|
+
# This is a simple example which uses rubyzip to
|
4
|
+
# recursively generate a zip file from the contents of
|
5
|
+
# a specified directory. The directory itself is not
|
6
|
+
# included in the archive, rather just its contents.
|
7
|
+
#
|
8
|
+
# Usage:
|
9
|
+
# directoryToZip = "/tmp/input"
|
10
|
+
# outputFile = "/tmp/out.zip"
|
11
|
+
# zf = ZipFileGenerator.new(directoryToZip, outputFile)
|
12
|
+
# zf.write()
|
13
|
+
class ZipFileGenerator
|
14
|
+
# Initialize with the directory to zip and the location of the output archive.
|
15
|
+
def initialize(input_dir, output_file)
|
16
|
+
@input_dir = input_dir
|
17
|
+
@output_file = output_file
|
18
|
+
end
|
19
|
+
|
20
|
+
# Zip the input directory.
|
21
|
+
def write
|
22
|
+
entries = Dir.entries(@input_dir)
|
23
|
+
entries.delete('.')
|
24
|
+
entries.delete('..')
|
25
|
+
io = Zip::File.open(@output_file, Zip::File::CREATE)
|
26
|
+
|
27
|
+
write_entries(entries, '', io)
|
28
|
+
io.close
|
29
|
+
end
|
30
|
+
|
31
|
+
# A helper method to make the recursion work.
|
32
|
+
private
|
33
|
+
|
34
|
+
def write_entries(entries, path, io)
|
35
|
+
entries.each do |e|
|
36
|
+
zip_file_path = path == '' ? e : File.join(path, e)
|
37
|
+
disk_file_path = File.join(@input_dir, zip_file_path)
|
38
|
+
if File.directory?(disk_file_path)
|
39
|
+
io.mkdir(zip_file_path)
|
40
|
+
subdir = Dir.entries(disk_file_path)
|
41
|
+
subdir.delete('.')
|
42
|
+
subdir.delete('..')
|
43
|
+
write_entries(subdir, zip_file_path, io)
|
44
|
+
else
|
45
|
+
io.get_output_stream(zip_file_path) { |f| f.puts(File.open(disk_file_path, 'rb').read) }
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -77,6 +77,8 @@ class AndroidScreenBase < Calabash::ABase
|
|
77
77
|
positions = [90,20,80,80]
|
78
78
|
when :<%= (I18n.translate "directions.right").to_sym %>
|
79
79
|
positions = [20,90,80,80]
|
80
|
+
else
|
81
|
+
raise 'Direction not known!'
|
80
82
|
end
|
81
83
|
|
82
84
|
# perform_action( 'action', 'from_x', 'to_x', 'from_y', 'to_y',
|
@@ -121,6 +123,9 @@ class AndroidScreenBase < Calabash::ABase
|
|
121
123
|
# Negation indicates that we want a page that doesn't
|
122
124
|
# has the message passed as parameter
|
123
125
|
def is_on_page?(page_text, negation = '')
|
126
|
+
fail 'Error! Invalid query string!' if
|
127
|
+
page_text.to_s == ''
|
128
|
+
|
124
129
|
should_not_have_exception = false
|
125
130
|
should_have_exception = false
|
126
131
|
begin
|
@@ -143,9 +148,9 @@ class AndroidScreenBase < Calabash::ABase
|
|
143
148
|
|
144
149
|
def enter(text, element, query = nil)
|
145
150
|
if query.nil?
|
146
|
-
query("* marked:'#{element}'", setText: text)
|
151
|
+
query("* marked:'#{element}'", setText: text.to_s)
|
147
152
|
else
|
148
|
-
query(query, setText: text)
|
153
|
+
query(query, setText: text.to_s)
|
149
154
|
end
|
150
155
|
end
|
151
156
|
|
@@ -76,10 +76,18 @@ class IOSScreenBase < Calabash::IBase
|
|
76
76
|
def drag_to(direction, element = nil)
|
77
77
|
element = 'scrollView' if element.nil?
|
78
78
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
79
|
+
case direction
|
80
|
+
when :<%= (I18n.translate "directions.down").to_sym %>
|
81
|
+
direction = { x: 0, y: -100 }
|
82
|
+
when :<%= (I18n.translate "directions.up").to_sym %>
|
83
|
+
direction = { x: 0, y: 100 }
|
84
|
+
when :<%= (I18n.translate "directions.left").to_sym %>
|
85
|
+
direction = { x: 100, y: 0 }
|
86
|
+
when :<%= (I18n.translate "directions.right").to_sym %>
|
87
|
+
direction = { x: -100, y: 0 }
|
88
|
+
else
|
89
|
+
raise 'Direction not known!'
|
90
|
+
end
|
83
91
|
|
84
92
|
flick(element, direction)
|
85
93
|
sleep(1)
|
@@ -137,6 +145,9 @@ class IOSScreenBase < Calabash::IBase
|
|
137
145
|
# Negation indicates that we want a page that doesn't has
|
138
146
|
# the message passed as parameter
|
139
147
|
def is_on_page?(page_text, negation = '')
|
148
|
+
fail 'Error! Invalid query string!' if
|
149
|
+
page_text.to_s == ''
|
150
|
+
|
140
151
|
should_not_have_exception = false
|
141
152
|
should_have_exception = false
|
142
153
|
begin
|
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.
|
4
|
+
version: 0.1.9
|
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-
|
11
|
+
date: 2016-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,10 +80,24 @@ dependencies:
|
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 2.12.2
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubyzip
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.1'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.1'
|
83
97
|
description: A simple gem to generate all files needed in a project that will support
|
84
98
|
Calabash for both Android and iOS.
|
85
99
|
email:
|
86
|
-
-
|
100
|
+
- oscarpanda@gmail.com
|
87
101
|
executables:
|
88
102
|
- cs-bdd
|
89
103
|
extensions: []
|
@@ -97,10 +111,14 @@ files:
|
|
97
111
|
- bin/cs-bdd
|
98
112
|
- bin/cs-bdd-helpers.rb
|
99
113
|
- cs-bdd.gemspec
|
114
|
+
- lib/aws/android/app_installation_hooks.rb
|
115
|
+
- lib/aws/android/app_life_cycle_hooks.rb
|
116
|
+
- lib/aws/ios/01_launch.rb
|
100
117
|
- lib/cs/bdd.rb
|
101
118
|
- lib/cs/bdd/locales/en.yml
|
102
119
|
- lib/cs/bdd/locales/pt.yml
|
103
120
|
- lib/cs/bdd/version.rb
|
121
|
+
- lib/cs/bdd/zip.rb
|
104
122
|
- lib/skeleton/.gitignore
|
105
123
|
- lib/skeleton/Gemfile
|
106
124
|
- lib/skeleton/README.md
|
@@ -137,11 +155,14 @@ files:
|
|
137
155
|
- lib/templates/ios_screen_base.tt
|
138
156
|
- lib/templates/screen.tt
|
139
157
|
- lib/templates/steps.tt
|
140
|
-
homepage: https://github.com/
|
158
|
+
homepage: https://github.com/concretesolutions/cs-bdd
|
141
159
|
licenses:
|
142
160
|
- MIT
|
143
161
|
metadata: {}
|
144
|
-
post_install_message:
|
162
|
+
post_install_message: "\n\n========================================= WARNING:[DEPRECATION]
|
163
|
+
===================================================================\n\n This gem
|
164
|
+
has been renamed to sunomono and will no longer be supported. Please switch to sunomono
|
165
|
+
as soon as possible.\n\n See: See: https://rubygems.org/gems/sunomono \n And: https://github.com/concretesolutions/sunomono\n\n====================================================================================================================================\n\n\n"
|
145
166
|
rdoc_options: []
|
146
167
|
require_paths:
|
147
168
|
- lib
|