actir 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +11 -0
- data/README.md +56 -0
- data/Rakefile +70 -0
- data/actir.gemspec +31 -0
- data/bin/actir +9 -0
- data/bin/ants +9 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/actir.rb +41 -0
- data/lib/actir/basic_page.rb +49 -0
- data/lib/actir/config.rb +192 -0
- data/lib/actir/initializer.rb +70 -0
- data/lib/actir/parallel_tests/cli.rb +323 -0
- data/lib/actir/parallel_tests/grouper.rb +44 -0
- data/lib/actir/parallel_tests/parallel_tests.rb +77 -0
- data/lib/actir/parallel_tests/report/html_formatter.rb +417 -0
- data/lib/actir/parallel_tests/report/html_reporter.rb +145 -0
- data/lib/actir/parallel_tests/test/logger.rb +74 -0
- data/lib/actir/parallel_tests/test/re_run.rb +153 -0
- data/lib/actir/parallel_tests/test/runner.rb +224 -0
- data/lib/actir/remote.rb +80 -0
- data/lib/actir/script/cookies_baidu.rb +143 -0
- data/lib/actir/version.rb +3 -0
- data/lib/actir/webdriver/browser.rb +201 -0
- data/lib/actir/webdriver/browser_options.rb +54 -0
- data/lib/actir/webdriver/config/devices.yaml +40 -0
- data/lib/actir/webdriver/devices.rb +31 -0
- data/lib/actir/webdriver/driver.rb +42 -0
- metadata +175 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
:iphone:
|
2
|
+
:user_agent: "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5"
|
3
|
+
:portrait:
|
4
|
+
:width: 320
|
5
|
+
:height: 356
|
6
|
+
:landscape:
|
7
|
+
:width: 480
|
8
|
+
:height: 196
|
9
|
+
:ipad_seven:
|
10
|
+
:user_agent: "Mozilla/5.0 (iPad; CPU OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B329 Safari/8536.25"
|
11
|
+
:portrait:
|
12
|
+
:width: 768
|
13
|
+
:height: 946
|
14
|
+
:landscape:
|
15
|
+
:width: 1024
|
16
|
+
:height: 690
|
17
|
+
:ipad:
|
18
|
+
:user_agent: "Mozilla/5.0(iPad; U; CPU OS 5_0 like Mac OS X; en-us) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3"
|
19
|
+
:portrait:
|
20
|
+
:width: 768
|
21
|
+
:height: 946
|
22
|
+
:landscape:
|
23
|
+
:width: 1024
|
24
|
+
:height: 690
|
25
|
+
:android_phone:
|
26
|
+
:user_agent: "Mozilla/5.0 (Linux; U; Android 4.0.1; en-us; sdk Build/ICS_MR0) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30"
|
27
|
+
:portrait:
|
28
|
+
:width: 320
|
29
|
+
:height: 356
|
30
|
+
:landscape:
|
31
|
+
:width: 480
|
32
|
+
:height: 196
|
33
|
+
:android_tablet:
|
34
|
+
:user_agent: "Mozilla/5.0 (Linux; U; Android 3.0; en-us; GT-P7100 Build/HRI83) AppleWebkit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13"
|
35
|
+
:portrait:
|
36
|
+
:width: 768
|
37
|
+
:height: 946
|
38
|
+
:landscape:
|
39
|
+
:width: 1024
|
40
|
+
:height: 690
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
module Actir
|
4
|
+
module Webdriver
|
5
|
+
module Devices
|
6
|
+
|
7
|
+
def devices
|
8
|
+
Actir::Config.get_content(config_file)
|
9
|
+
end
|
10
|
+
|
11
|
+
def resolution_for(device_name, orientation)
|
12
|
+
device = devices[device_name.downcase][orientation.downcase]
|
13
|
+
[device[:width],device[:height]]
|
14
|
+
end
|
15
|
+
|
16
|
+
def agent_string_for(device)
|
17
|
+
device = (device ? device.downcase : :iphone)
|
18
|
+
user_agent_string = devices[device][:user_agent]
|
19
|
+
raise "Unsupported user agent: '#{device}'." unless user_agent_string
|
20
|
+
user_agent_string
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def config_file
|
26
|
+
File.join(Pathname.new(File.dirname(__FILE__)).realpath, "config/devices.yaml")
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'json'
|
2
|
+
require 'selenium-webdriver'
|
3
|
+
require 'actir/webdriver/browser_options'
|
4
|
+
require 'actir/webdriver/devices'
|
5
|
+
|
6
|
+
module Actir
|
7
|
+
module Webdriver
|
8
|
+
|
9
|
+
def self.driver options={}
|
10
|
+
Driver.instance.for options
|
11
|
+
end
|
12
|
+
|
13
|
+
class Driver
|
14
|
+
include Singleton
|
15
|
+
include Devices
|
16
|
+
|
17
|
+
def for(opts)
|
18
|
+
user_agent_string = agent_string_for opts[:agent]
|
19
|
+
options = BrowserOptions.new(opts, user_agent_string)
|
20
|
+
build_driver_using options
|
21
|
+
end
|
22
|
+
|
23
|
+
def resize_inner_window(driver, width, height)
|
24
|
+
if driver.browser == :firefox or :chrome
|
25
|
+
driver.execute_script("window.open(#{driver.current_url.to_json},'_blank');")
|
26
|
+
driver.close
|
27
|
+
driver.switch_to.window driver.window_handles.first
|
28
|
+
end
|
29
|
+
driver.execute_script("window.innerWidth = #{width}; window.innerHeight = #{height};")
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def build_driver_using(options)
|
35
|
+
driver = Selenium::WebDriver.for options.browser, options.browser_options
|
36
|
+
#resize_inner_window(driver, *resolution_for(options.agent, options.orientation))
|
37
|
+
driver
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
metadata
ADDED
@@ -0,0 +1,175 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: actir
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- hub
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-06-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: test-unit
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: watir-webdriver
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.6.11
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.6.11
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: selenium-webdriver
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.45'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.45'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: parallel
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.4'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.4'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: facets
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '2.9'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '2.9'
|
111
|
+
description: Distribut automated testing framework for Web or App.
|
112
|
+
email:
|
113
|
+
- hub@qima-inc.com
|
114
|
+
executables:
|
115
|
+
- actir
|
116
|
+
- ants
|
117
|
+
extensions: []
|
118
|
+
extra_rdoc_files: []
|
119
|
+
files:
|
120
|
+
- ".gitignore"
|
121
|
+
- ".travis.yml"
|
122
|
+
- CODE_OF_CONDUCT.md
|
123
|
+
- Gemfile
|
124
|
+
- README.md
|
125
|
+
- Rakefile
|
126
|
+
- actir.gemspec
|
127
|
+
- bin/actir
|
128
|
+
- bin/ants
|
129
|
+
- bin/console
|
130
|
+
- bin/setup
|
131
|
+
- lib/actir.rb
|
132
|
+
- lib/actir/basic_page.rb
|
133
|
+
- lib/actir/config.rb
|
134
|
+
- lib/actir/initializer.rb
|
135
|
+
- lib/actir/parallel_tests/cli.rb
|
136
|
+
- lib/actir/parallel_tests/grouper.rb
|
137
|
+
- lib/actir/parallel_tests/parallel_tests.rb
|
138
|
+
- lib/actir/parallel_tests/report/html_formatter.rb
|
139
|
+
- lib/actir/parallel_tests/report/html_reporter.rb
|
140
|
+
- lib/actir/parallel_tests/test/logger.rb
|
141
|
+
- lib/actir/parallel_tests/test/re_run.rb
|
142
|
+
- lib/actir/parallel_tests/test/runner.rb
|
143
|
+
- lib/actir/remote.rb
|
144
|
+
- lib/actir/script/cookies_baidu.rb
|
145
|
+
- lib/actir/version.rb
|
146
|
+
- lib/actir/webdriver/browser.rb
|
147
|
+
- lib/actir/webdriver/browser_options.rb
|
148
|
+
- lib/actir/webdriver/config/devices.yaml
|
149
|
+
- lib/actir/webdriver/devices.rb
|
150
|
+
- lib/actir/webdriver/driver.rb
|
151
|
+
homepage: http://git.qima-inc.com/qa/ants.git
|
152
|
+
licenses:
|
153
|
+
- MIT
|
154
|
+
metadata: {}
|
155
|
+
post_install_message:
|
156
|
+
rdoc_options: []
|
157
|
+
require_paths:
|
158
|
+
- lib
|
159
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - ">="
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: '0'
|
164
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
|
+
requirements:
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: '0'
|
169
|
+
requirements: []
|
170
|
+
rubyforge_project:
|
171
|
+
rubygems_version: 2.4.3
|
172
|
+
signing_key:
|
173
|
+
specification_version: 4
|
174
|
+
summary: Application Concurrence Test in Ruby.
|
175
|
+
test_files: []
|