selenium-framework 1.0.16 → 1.0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/copyfiles/include.rb +5 -0
  2. data/bin/testframe +10 -21
  3. metadata +2 -2
@@ -13,3 +13,8 @@ require 'fileutils'
13
13
  require 'xmlsimple'
14
14
  require 'ostruct'
15
15
  require 'random-word'
16
+ Dir.chdir('testcases')
17
+ Dir['**/*'].reject { |fn| File.directory?(fn) }.each do |r|
18
+ require '../testcases/'+r
19
+ end
20
+ Dir.chdir('..')
@@ -2,10 +2,8 @@
2
2
  require 'fileutils'
3
3
  require 'readline'
4
4
 
5
-
6
5
  def print_path(filename, filepath, project_directory_path)
7
- path = filepath +'/'+ filename
8
- path = path.to_s
6
+ path = filepath +'/'+ filename.to_s
9
7
  puts 'create ' + path.split(project_directory_path.to_s)[1].to_s
10
8
  end
11
9
 
@@ -52,7 +50,6 @@ if ARGV[0] == 'update'
52
50
  end
53
51
  end
54
52
 
55
-
56
53
  project_name = ARGV[1]
57
54
  project_directory_path = Dir.pwd
58
55
  puts "\n"
@@ -100,8 +97,6 @@ if exist_flag == 1 && update_flag == 0
100
97
  print_path("Gemfile", project_directory_path + "/" + project_name, project_directory_path)
101
98
 
102
99
  Dir.chdir(project_directory_path)
103
- # internal_dir -- array for storing framework directory names
104
- # internal_dir = ['libraries', 'testcases','config','builds']
105
100
  directory_path = project_directory_path + "/" + project_name
106
101
  # dir_counter -- iterator for the loop
107
102
  for dir_counter in 0..internal_dir.length-1
@@ -169,8 +164,6 @@ if exist_flag == 2
169
164
  print_path("Gemfile", project_directory_path + "/" + project_name, project_directory_path)
170
165
 
171
166
  Dir.chdir(project_directory_path)
172
- # internal_dir -- array for storing framework directory names
173
- # internal_dir = ['libraries', 'testcases','config','builds']
174
167
  directory_path = project_directory_path + "/" + project_name
175
168
  # dir_counter -- iterator for the loop
176
169
  for dir_counter in 0..internal_dir.length-1
@@ -237,8 +230,6 @@ if exist_flag == 3
237
230
  end
238
231
 
239
232
  Dir.chdir(project_directory_path)
240
- # internal_dir -- array for storing framework directory names
241
- # internal_dir = ['libraries', 'testcases','config','builds']
242
233
  directory_path = project_directory_path + "/" + project_name
243
234
  # dir_counter -- iterator for the loop
244
235
  for dir_counter in 0..internal_dir.length-1
@@ -328,7 +319,6 @@ if update_flag ==1
328
319
  present_flag = destination_data.include? thing
329
320
  present_flag = present_flag.to_s
330
321
  if ("false".casecmp present_flag) == 0
331
- #File.open(destination, 'a+') { |file| file.write(thing.to_s) }
332
322
  f = File.open(destination, "r+")
333
323
  lines = f.readlines
334
324
  f.close
@@ -338,10 +328,10 @@ if update_flag ==1
338
328
  output.close
339
329
  end
340
330
  end
341
- print_path("Gemfile", project_directory_path + "/" + project_name, project_directory_path)
331
+ print_path('Gemfile', project_directory_path + '/' + project_name, project_directory_path)
342
332
 
343
- source = File.expand_path File.dirname(__FILE__).to_s + "/copyfiles/selenium-framework.yml"
344
- destination = "/config/selenium-framework.yml"
333
+ source = File.expand_path File.dirname(__FILE__).to_s + '/copyfiles/selenium-framework.yml'
334
+ destination = '/config/selenium-framework.yml'
345
335
  source_data = Array.new
346
336
  source_data = IO.readlines(source)
347
337
  destination_data = Array.new
@@ -349,23 +339,22 @@ if update_flag ==1
349
339
  source_data.each do |thing|
350
340
  present_flag = destination_data.include? thing
351
341
  present_flag = present_flag.to_s
352
- if ("false".casecmp present_flag) == 0
353
- #File.open(destination, 'a+') { |file| file.write(thing.to_s) }
354
- f = File.open(destination, "r+")
342
+ if ('false'.casecmp present_flag) == 0
343
+ f = File.open(destination, 'r+')
355
344
  lines = f.readlines
356
345
  f.close
357
346
  lines = [thing] + lines
358
- output = File.new(destination, "w")
347
+ output = File.new(destination, 'w')
359
348
  lines.each { |line| output.write line }
360
349
  output.close
361
350
  end
362
351
  end
363
- print_path("/config/selenium-framework.yml", project_directory_path + "/" + project_name, project_directory_path)
352
+ print_path('/config/selenium-framework.yml', project_directory_path + '/' + project_name, project_directory_path)
364
353
 
365
354
  puts "\nFramework for #{project_name} is updated..."
366
355
  puts "\nbundle install"
367
- Dir.chdir(project_directory_path + "/" + project_name)
368
- system("bundle install")
356
+ Dir.chdir(project_directory_path + '/' + project_name)
357
+ system('bundle install')
369
358
  Dir.chdir(project_directory_path)
370
359
  end
371
360
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium-framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.16
4
+ version: 1.0.17
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-27 00:00:00.000000000 Z
12
+ date: 2013-06-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler