actir 1.4.1 → 1.4.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69363dbceeb2bc9e367b6608093693bc2989b6b8
4
- data.tar.gz: 35c30e7d8621858453b9e0e6a0788b5fb48ce96b
3
+ metadata.gz: ae54b7de1a72de6f6257261eec1cf8506636fa5c
4
+ data.tar.gz: 97e0942beca3d46c156ab9d374b5385bfc0ee728
5
5
  SHA512:
6
- metadata.gz: 75f39e38ffc1c86bf980810d0efabd19bff50f20a9a989e3d0f2c3bf870717eecbc146fef105979e49b544e80a6fef12e54c62ef12d4bdbd9b4e486985382ced
7
- data.tar.gz: 80170ddaa345fb3beb0fec988020b8eca12f0af073a2e6e198e8de87d140877a53b47c118bd3222dac92ef413ef42393ac1f5a91ea26d37910fc7de849716cea
6
+ metadata.gz: 98811afbebabb6778a644cc436b25d67b5423945b165844623dab8c86779fd3b91f7910078768197d8a3bc1e57152608fb02f6711751be77d33c765f362b05a4
7
+ data.tar.gz: 3936f3bff3d132c170c7d41b1730442a5fafaea196db640ea0937eaa23f130d51bb8afa2ea0b47cd8b42f5962bbe55bb5b261433fc41e33f93c92f9fcf435432
@@ -35,16 +35,16 @@ module Actir
35
35
  test_results = nil
36
36
 
37
37
  #修改全局变量$env至对应的预发布环境的名字
38
- if options[:pre_name]
39
- # 不等于当前的预发环境
40
- if options[:pre_name] != $env
41
- $env = options[:pre_name]
42
- end
43
- else
44
- if options[:pre_name] != $env
45
- $env = "online"
46
- end
47
- end
38
+ # if options[:pre_name]
39
+ # # 不等于当前的预发环境
40
+ # if options[:pre_name] != $env
41
+ # $env = options[:pre_name]
42
+ # end
43
+ # else
44
+ # if options[:pre_name] != $env
45
+ # $env = "online"
46
+ # end
47
+ # end
48
48
 
49
49
  report_time_taken do
50
50
  groups = @runner.tests_in_groups(options[:files], num_processes, options)
@@ -180,65 +180,65 @@ module Actir
180
180
  OptionParser.new do |opts|
181
181
  opts.banner = <<-BANNER.gsub(/^ /, '')
182
182
  Run all tests in parallel
183
- Usage: ruby [switches] [--] [files & folders]
183
+ Usage: actir [switches] [--] [files & folders] [-] [testcase_name]
184
184
  Options are:
185
185
  BANNER
186
- # opts.on("-n [PROCESSES]", Integer, "How many processes to use, default: 1") { |n| options[:count] = n }
187
186
  opts.on("-n [TESTCASE]", String, "Run this testcase") { |casename| options[:testcase] = casename }
188
- opts.on("--group-by [TYPE]", <<-TEXT.gsub(/^ /, '')
189
- group tests by:
190
- found - order of finding files
191
- filesize - by size of the file
192
- default - filesize
193
- TEXT
194
- ) { |type| options[:group_by] = type.to_sym }
187
+ opts.on("-p [PROCESSES]", Integer, "How many processes to use, default: 1") { |p| options[:count] = p }
188
+ # opts.on("--group-by [TYPE]", <<-TEXT.gsub(/^ /, '')
189
+ # group tests by:
190
+ # found - order of finding files
191
+ # filesize - by size of the file
192
+ # default - filesize
193
+ # TEXT
194
+ # ) { |type| options[:group_by] = type.to_sym }
195
195
  opts.on("-r [TIMES]", "--rerun [TIMES]", Integer, "rerun times for failure&error testcase, default: 0") { |n| options[:rerun] = n }
196
196
  #opts.on("-m [FLOAT]", "--multiply-processes [FLOAT]", Float, "use given number as a multiplier of processes to run") { |multiply| options[:multiply] = multiply }
197
- opts.on("-i", "--isolate",
198
- "Do not run any other tests in the group used by --single(-s)") do |pattern|
199
- options[:isolate] = true
200
- end
197
+ # opts.on("-i", "--isolate",
198
+ # "Do not run any other tests in the group used by --single(-s)") do |pattern|
199
+ # options[:isolate] = true
200
+ # end
201
201
  opts.on("-e", "--exec [COMMAND]", "execute this code parallel") { |path| options[:execute] = path }
202
- opts.on("--serialize-stdout", "Serialize stdout output, nothing will be written until everything is done") { options[:serialize_stdout] = true }
203
- opts.on("--combine-stderr", "Combine stderr into stdout, useful in conjunction with --serialize-stdout") { options[:combine_stderr] = true }
204
- opts.on("--non-parallel", "execute same commands but do not in parallel, needs --exec") { options[:non_parallel] = true }
205
- opts.on("--nice", "execute test commands with low priority") { options[:nice] = true }
202
+ # opts.on("--serialize-stdout", "Serialize stdout output, nothing will be written until everything is done") { options[:serialize_stdout] = true }
203
+ # opts.on("--combine-stderr", "Combine stderr into stdout, useful in conjunction with --serialize-stdout") { options[:combine_stderr] = true }
204
+ # opts.on("--non-parallel", "execute same commands but do not in parallel, needs --exec") { options[:non_parallel] = true }
205
+ # opts.on("--nice", "execute test commands with low priority") { options[:nice] = true }
206
206
  opts.on("--verbose", "Print more output") { options[:verbose] = true }
207
207
  opts.on("--log", "record exec result to logfile") { options[:log] = true}
208
208
  opts.on("--report", "make a report to show the test result") { options[:report] = true}
209
- opts.on("--remote", "run testcase in remote environment") { options[:mode] = :remote }
210
- opts.on("--local", "run testcase in local environment") { options[:mode] = :local }
211
- # 填写预发环境,目前只支持bjpre2-4,别的后续再添加
212
- opts.on("-p", "--pre [PRE]", <<-TEXT.gsub(/^ /, '')
213
- set pre environment to run testcase:
214
- bjpre2
215
- bjpre3
216
- bjpre4
217
- TEXT
218
- ) { |pre| pre = "online" if ( pre != "bjpre2" && pre != "bjpre3" && pre != "bjpre4"); options[:pre_name] = pre }
209
+ # opts.on("--remote", "run testcase in remote environment") { options[:mode] = :remote }
210
+ # opts.on("--local", "run testcase in local environment") { options[:mode] = :local }
211
+ # # 填写预发环境,目前只支持bjpre2-4,别的后续再添加
212
+ # opts.on("-p", "--pre [PRE]", <<-TEXT.gsub(/^ /, '')
213
+ # set pre environment to run testcase:
214
+ # bjpre2
215
+ # bjpre3
216
+ # bjpre4
217
+ # TEXT
218
+ # ) { |pre| pre = "online" if ( pre != "bjpre2" && pre != "bjpre3" && pre != "bjpre4"); options[:pre_name] = pre }
219
219
  #add by Hub
220
220
  #-u commnd, update baifubao's cookies
221
221
  opts.on("-u", "--update", "Update Baifubao's cookies") { options[:update] = true }
222
222
  #add by Hub
223
223
  #-s commnd, show test mode,and remote env ipaddress
224
- opts.on("-s", "--show [PATH]", "Show Test Mode") do |path|
225
- abort "Please input project directory path!" if path == nil
226
- $project_path = File.join(Dir.pwd, path)
227
- puts division_str
228
- if Actir::Config.get("config.test_mode.env") == :local
229
- puts "mode : Local"
230
- else
231
- puts "mode : Remote"
232
- node_name = Actir::Config.get("config.test_mode.docker.name")
233
- address = Actir::Remote.get_remote_address
234
- puts "node_num : " + address.size.to_s
235
- address.each_with_index do |address, i|
236
- puts $env + node_name + (i+1).to_s + " : " + address
237
- end
238
- end
239
- puts division_str
240
- exit
241
- end
224
+ # opts.on("-s", "--show [PATH]", "Show Test Mode") do |path|
225
+ # abort "Please input project directory path!" if path == nil
226
+ # $project_path = File.join(Dir.pwd, path)
227
+ # puts division_str
228
+ # if Actir::Config.get("config.test_mode.env") == :local
229
+ # puts "mode : Local"
230
+ # else
231
+ # puts "mode : Remote"
232
+ # node_name = Actir::Config.get("config.test_mode.docker.name")
233
+ # address = Actir::Remote.get_remote_address
234
+ # puts "node_num : " + address.size.to_s
235
+ # address.each_with_index do |address, i|
236
+ # puts $env + node_name + (i+1).to_s + " : " + address
237
+ # end
238
+ # end
239
+ # puts division_str
240
+ # exit
241
+ # end
242
242
  opts.on("-h", "--help", "Show this.") { puts opts; exit }
243
243
  end.parse!(argv)
244
244
 
@@ -0,0 +1,25 @@
1
+ module Actir
2
+ class CookiesFile
3
+ class << self
4
+
5
+ # 获取cookies文件的路径
6
+ # 因为涉及到权限问题,路径需要放在个人账号目录下
7
+ # 通过whoami命令获取当前账户名称
8
+ # 暂时存放在/User/xx/目录下
9
+ def path
10
+ user_name = `whoami`
11
+ return "/Users/" + user_name + "/"
12
+ end
13
+
14
+ def name
15
+ return "cookies.yaml"
16
+ end
17
+
18
+ def exists?
19
+ File::exists?(path + name)
20
+ end
21
+
22
+ end
23
+
24
+ end
25
+ end
@@ -1,3 +1,3 @@
1
1
  module Actir
2
- VERSION = "1.4.1"
2
+ VERSION = "1.4.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actir
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - hub
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-18 00:00:00.000000000 Z
11
+ date: 2016-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-unit
@@ -145,6 +145,7 @@ files:
145
145
  - lib/actir/remote.rb
146
146
  - lib/actir/script/cookies/cookies.yaml
147
147
  - lib/actir/script/cookies_baidu.rb
148
+ - lib/actir/script/cookies_file.rb
148
149
  - lib/actir/version.rb
149
150
  - lib/actir/webdriver/browser.rb
150
151
  - lib/actir/webdriver/browser_options.rb