awetestlib 0.1.20-x86-mingw32 → 0.1.22-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/awetestlib.windows.gemspec +1 -1
- data/bin/awetestlib +6 -0
- data/bin/awetestlib-android-setup.rb +27 -0
- data/bin/awetestlib-cucumber-setup.rb +1 -1
- data/bin/awetestlib-driver-setup.rb +21 -0
- data/drivers/IEDriverServer.exe +0 -0
- data/drivers/chromedriver.exe +0 -0
- data/lib/awetestlib/regression/browser.rb +1 -1
- data/lib/awetestlib/regression/user_input.rb +4 -4
- data/lib/version.rb +2 -2
- data/setup_samples/sample_android/features/dk.mejer.hansen.control.FlyingColorsPlayerAidActivity.apk +0 -0
- data/setup_samples/sample_android/features/sample_android.feature +6 -0
- data/setup_samples/sample_android/features/step_definitions/calabash_steps.rb +2 -0
- data/setup_samples/sample_android/features/support/app_installation_hooks.rb +36 -0
- data/setup_samples/sample_android/features/support/app_life_cycle_hooks.rb +15 -0
- data/setup_samples/sample_android/features/support/env.rb +1 -0
- data/setup_samples/sample_android/features/test_servers/8ba795a0288381ae346b67867b586881_0.3.2.apk +0 -0
- metadata +33 -5
data/awetestlib.windows.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.add_dependency('pry')
|
33
33
|
s.add_dependency('rdoc', '~> 3.11')
|
34
34
|
s.add_dependency('cucumber')
|
35
|
-
|
35
|
+
s.add_dependency('calabash-android', '0.3.2')
|
36
36
|
s.require_paths = ["lib"]
|
37
37
|
s.files = `git ls-files`.split("\n")
|
38
38
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
data/bin/awetestlib
CHANGED
@@ -22,6 +22,12 @@ elsif cmd == 'cucumber_setup'
|
|
22
22
|
elsif cmd == 'mobile_app_setup'
|
23
23
|
require File.join(File.dirname(__FILE__),"awetestlib-mobile-app-setup")
|
24
24
|
awetestlib_mobile_app_setup
|
25
|
+
elsif cmd == 'android_setup'
|
26
|
+
require File.join(File.dirname(__FILE__),"awetestlib-android-setup")
|
27
|
+
awetestlib_android_setup
|
28
|
+
elsif cmd == 'driver_setup'
|
29
|
+
require File.join(File.dirname(__FILE__),"awetestlib-driver-setup")
|
30
|
+
awetestlib_driver_setup
|
25
31
|
else
|
26
32
|
|
27
33
|
require 'optparse'
|
@@ -0,0 +1,27 @@
|
|
1
|
+
def awetestlib_android_setup
|
2
|
+
if ARGV[1].nil?
|
3
|
+
@proj_dir = "sample_android"
|
4
|
+
else
|
5
|
+
@proj_dir = ARGV[1]
|
6
|
+
end
|
7
|
+
|
8
|
+
@cucumber_dir = File.join(FileUtils.pwd, @proj_dir)
|
9
|
+
@source_dir = File.join(File.dirname(__FILE__), '..', 'setup_samples', 'sample_android')
|
10
|
+
|
11
|
+
if File.exists?(@cucumber_dir)
|
12
|
+
puts "Android project directory already exists."
|
13
|
+
exit 1
|
14
|
+
end
|
15
|
+
|
16
|
+
msg("Question") do
|
17
|
+
puts "I'm about to create an android project named #{@proj_dir} in this directory"
|
18
|
+
puts "Please hit return to confirm that's what you want."
|
19
|
+
puts "NOTE: You may need to run this command as an administrator."
|
20
|
+
end
|
21
|
+
exit 2 unless STDIN.gets.chomp == ''
|
22
|
+
FileUtils.cp_r(@source_dir, @cucumber_dir)
|
23
|
+
msg("Info") do
|
24
|
+
puts "Configuring files and settings"
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -6,7 +6,7 @@ def awetestlib_cucumber_setup
|
|
6
6
|
end
|
7
7
|
|
8
8
|
@cucumber_dir = File.join(FileUtils.pwd, @proj_dir)
|
9
|
-
@source_dir = File.join(File.dirname(__FILE__), '..', 'setup_samples',
|
9
|
+
@source_dir = File.join(File.dirname(__FILE__), '..', 'setup_samples', 'sample_cucumber')
|
10
10
|
|
11
11
|
if File.exists?(@cucumber_dir)
|
12
12
|
puts "Cucumber project directory already exists."
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'pry'
|
2
|
+
def awetestlib_driver_setup
|
3
|
+
current_dir = Dir.pwd
|
4
|
+
drivers_dir = File.expand_path(File.join(File.dirname(__FILE__), "..", "drivers"))
|
5
|
+
# binding.pry
|
6
|
+
ie_driver = File.join(drivers_dir,"IEDriverServer.exe")
|
7
|
+
chrome_driver = File.join(drivers_dir,"chromedriver.exe")
|
8
|
+
msg("Question") do
|
9
|
+
puts "I'm about to put the chromedriver and IEDriverServer in this directory"
|
10
|
+
puts "If it already exists, we will overwrite it"
|
11
|
+
puts "Please hit return to confirm that's what you want."
|
12
|
+
puts "NOTE: You may need to run this command as an administrator."
|
13
|
+
end
|
14
|
+
exit 2 unless STDIN.gets.chomp == ''
|
15
|
+
FileUtils.cp(ie_driver, current_dir)
|
16
|
+
FileUtils.cp(chrome_driver,current_dir)
|
17
|
+
msg("Info") do
|
18
|
+
puts "Successfully copied chromedriver and IEDriverServer to #{current_dir}"
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
Binary file
|
Binary file
|
@@ -397,7 +397,7 @@ module Awetestlib
|
|
397
397
|
# @param [String] hwnd The value for the window handle for the browser process.
|
398
398
|
# @param [Fixnum] lnbr Line number in calling script.
|
399
399
|
# @param [Watir::Browser] browser A reference to the browser window or container element to be closed.
|
400
|
-
def kill_browser(hwnd, lnbr, browser = nil)
|
400
|
+
def kill_browser(hwnd, lnbr, browser = nil, doflag = false)
|
401
401
|
# TODO Firefox
|
402
402
|
logit = false
|
403
403
|
if @browserAbbrev == 'FF'
|
@@ -763,9 +763,9 @@ module Awetestlib
|
|
763
763
|
msg << " '#{desc}' " if desc.length > 0
|
764
764
|
case element
|
765
765
|
when :radio
|
766
|
-
browser.radio(how, what
|
766
|
+
browser.radio(how, what).set
|
767
767
|
when :checkbox
|
768
|
-
browser.checkbox(how, what
|
768
|
+
browser.checkbox(how, what).set
|
769
769
|
else
|
770
770
|
failed_to_log("#{__method__}: #{element} not supported")
|
771
771
|
end
|
@@ -1034,9 +1034,9 @@ module Awetestlib
|
|
1034
1034
|
msg << " '#{desc}' " if desc.length > 0
|
1035
1035
|
case element
|
1036
1036
|
when :radio
|
1037
|
-
browser.radio(how, what
|
1037
|
+
browser.radio(how, what).clear
|
1038
1038
|
when :checkbox
|
1039
|
-
browser.checkbox(how, what
|
1039
|
+
browser.checkbox(how, what).clear
|
1040
1040
|
when :text_field
|
1041
1041
|
browser.text_field(how, what).set('')
|
1042
1042
|
else
|
data/lib/version.rb
CHANGED
data/setup_samples/sample_android/features/dk.mejer.hansen.control.FlyingColorsPlayerAidActivity.apk
ADDED
Binary file
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'calabash-android/management/app_installation'
|
2
|
+
|
3
|
+
AfterConfiguration do |config|
|
4
|
+
FeatureNameMemory.feature_name = nil
|
5
|
+
end
|
6
|
+
|
7
|
+
Before do |scenario|
|
8
|
+
@scenario_is_outline = (scenario.class == Cucumber::Ast::OutlineTable::ExampleRow)
|
9
|
+
if @scenario_is_outline
|
10
|
+
scenario = scenario.scenario_outline
|
11
|
+
end
|
12
|
+
|
13
|
+
feature_name = scenario.feature.title
|
14
|
+
if FeatureNameMemory.feature_name != feature_name \
|
15
|
+
or ENV["RESET_BETWEEN_SCENARIOS"] == "1"
|
16
|
+
if ENV["RESET_BETWEEN_SCENARIOS"] == "1"
|
17
|
+
log "New scenario - reinstalling apps"
|
18
|
+
else
|
19
|
+
log "First scenario in feature - reinstalling apps"
|
20
|
+
end
|
21
|
+
|
22
|
+
uninstall_apps
|
23
|
+
install_app(ENV["TEST_APP_PATH"])
|
24
|
+
install_app(ENV["APP_PATH"])
|
25
|
+
FeatureNameMemory.feature_name = feature_name
|
26
|
+
FeatureNameMemory.invocation = 1
|
27
|
+
else
|
28
|
+
FeatureNameMemory.invocation += 1
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
FeatureNameMemory = Class.new
|
33
|
+
class << FeatureNameMemory
|
34
|
+
@feature_name = nil
|
35
|
+
attr_accessor :feature_name, :invocation
|
36
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'calabash-android/management/adb'
|
2
|
+
require 'calabash-android/operations'
|
3
|
+
include Calabash::Android::Operations
|
4
|
+
|
5
|
+
AfterConfiguration do |config|
|
6
|
+
wake_up unless config.dry_run?
|
7
|
+
end
|
8
|
+
|
9
|
+
Before do |scenario|
|
10
|
+
start_test_server_in_background
|
11
|
+
end
|
12
|
+
|
13
|
+
After do
|
14
|
+
shutdown_test_server
|
15
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'calabash-android/cucumber'
|
data/setup_samples/sample_android/features/test_servers/8ba795a0288381ae346b67867b586881_0.3.2.apk
ADDED
Binary file
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awetestlib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 55
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 22
|
10
|
+
version: 0.1.22
|
11
11
|
platform: x86-mingw32
|
12
12
|
authors:
|
13
13
|
- Anthony Woo
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-
|
19
|
+
date: 2012-11-13 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: watir-webdriver
|
@@ -273,12 +273,30 @@ dependencies:
|
|
273
273
|
version: "0"
|
274
274
|
type: :runtime
|
275
275
|
version_requirements: *id017
|
276
|
+
- !ruby/object:Gem::Dependency
|
277
|
+
name: calabash-android
|
278
|
+
prerelease: false
|
279
|
+
requirement: &id018 !ruby/object:Gem::Requirement
|
280
|
+
none: false
|
281
|
+
requirements:
|
282
|
+
- - "="
|
283
|
+
- !ruby/object:Gem::Version
|
284
|
+
hash: 23
|
285
|
+
segments:
|
286
|
+
- 0
|
287
|
+
- 3
|
288
|
+
- 2
|
289
|
+
version: 0.3.2
|
290
|
+
type: :runtime
|
291
|
+
version_requirements: *id018
|
276
292
|
description: Awetest DSL for automated testing of browser-based applications.
|
277
293
|
email: patrick@3qilabs.com
|
278
294
|
executables:
|
279
295
|
- AutoItX3.dll
|
280
296
|
- awetestlib
|
297
|
+
- awetestlib-android-setup.rb
|
281
298
|
- awetestlib-cucumber-setup.rb
|
299
|
+
- awetestlib-driver-setup.rb
|
282
300
|
- awetestlib-helpers.rb
|
283
301
|
- awetestlib-mobile-app-setup.rb
|
284
302
|
- awetestlib-netbeans-setup.rb
|
@@ -299,12 +317,16 @@ files:
|
|
299
317
|
- awetestlib_osx.gemspec
|
300
318
|
- bin/AutoItX3.dll
|
301
319
|
- bin/awetestlib
|
320
|
+
- bin/awetestlib-android-setup.rb
|
302
321
|
- bin/awetestlib-cucumber-setup.rb
|
322
|
+
- bin/awetestlib-driver-setup.rb
|
303
323
|
- bin/awetestlib-helpers.rb
|
304
324
|
- bin/awetestlib-mobile-app-setup.rb
|
305
325
|
- bin/awetestlib-netbeans-setup.rb
|
306
326
|
- bin/awetestlib-regression-setup.rb
|
307
327
|
- bin/awetestlib-rubymine-setup.rb
|
328
|
+
- drivers/IEDriverServer.exe
|
329
|
+
- drivers/chromedriver.exe
|
308
330
|
- ext/Rakefile
|
309
331
|
- ext/mkrf_conf.rb
|
310
332
|
- images/logo.png
|
@@ -331,6 +353,13 @@ files:
|
|
331
353
|
- netbeans_setup.md
|
332
354
|
- rdoc_test.bat
|
333
355
|
- rubymine_setup.md
|
356
|
+
- setup_samples/sample_android/features/dk.mejer.hansen.control.FlyingColorsPlayerAidActivity.apk
|
357
|
+
- setup_samples/sample_android/features/sample_android.feature
|
358
|
+
- setup_samples/sample_android/features/step_definitions/calabash_steps.rb
|
359
|
+
- setup_samples/sample_android/features/support/app_installation_hooks.rb
|
360
|
+
- setup_samples/sample_android/features/support/app_life_cycle_hooks.rb
|
361
|
+
- setup_samples/sample_android/features/support/env.rb
|
362
|
+
- setup_samples/sample_android/features/test_servers/8ba795a0288381ae346b67867b586881_0.3.2.apk
|
334
363
|
- setup_samples/sample_cucumber/features/step_definitions/predefined_steps.rb
|
335
364
|
- setup_samples/sample_cucumber/features/support/env.rb
|
336
365
|
- setup_samples/sample_cucumber/features/yahoo_mail.feature
|
@@ -398,4 +427,3 @@ specification_version: 3
|
|
398
427
|
summary: Awetest DSL for automated testing of browser-based applications.
|
399
428
|
test_files: []
|
400
429
|
|
401
|
-
has_rdoc:
|