superbot-runner 0.1.0 → 0.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
  SHA256:
3
- metadata.gz: 9ac9c924e896373d402e03cc8e4233fba4b3d6bec40d33a57cda74f479246966
4
- data.tar.gz: d8148d8eef0f8232554f3057d8ddaabd8e8cc76d6069a190b4bf0dca771c7eef
3
+ metadata.gz: 9579694ef5490b472722a15c57d2b27ad1304aad100c1967bbc2733d134af5ec
4
+ data.tar.gz: 7c8c96153aa96dcaa64a2c251db26a60215402620f165c38800153c87e3612df
5
5
  SHA512:
6
- metadata.gz: 721a79289683a0706b62688f776101b9de8048a0bfd6a3b286348a164c4fd45f8351e45a60b06a03d851fe29514b3acff4f446000344dafdc5d2039eb30dae2a
7
- data.tar.gz: a249e0e54b823a774f9c3aa0e6b90578af6de8995742cf750860ec55a7c4251a799d1754aa503b009391c45cdd258f029bd938a1a977ef0b06a7de8e09cd26e1
6
+ metadata.gz: 3733e00247a9bcb1048ba482d551ce3b4b66abbc992d9680e928c871586f70a93a25c5a7bf6800b8475ffccb2a6912e52bf104dde2aacc97bc85242517f4fd17
7
+ data.tar.gz: 9c1a6c25f0894fe6c0209d3800a1f454c26a0539713ec8784b50cc8c0792848c534be85f3d7405e02327af35cd861754d9b9cc1eec33ae2a88c7d666fad53209
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- superbot-runner (0.1.0)
4
+ superbot-runner (0.1.1)
5
5
  superbot-runner-side
6
6
 
7
7
  GEM
@@ -5,7 +5,7 @@ module Superbot
5
5
  include Superbot::Validations
6
6
  include Superbot::Cloud::Validations
7
7
 
8
- parameter "RECORDING", "recording"
8
+ parameter "PATH", "path to test suite"
9
9
 
10
10
  option ['--browser'], 'BROWSER', "Browser type to use. Can be either local or cloud", default: 'local' do |browser|
11
11
  validates_browser_type browser
@@ -13,17 +13,13 @@ module Superbot
13
13
  browser
14
14
  end
15
15
  option ['--region'], 'REGION', 'Region for remote webdriver'
16
+ option ['--no-teleport'], :flag, 'Do not start teleport before running'
16
17
 
17
18
  def execute
18
- open_teleport
19
-
20
- file_extension = File.extname(recording)
21
- case file_extension
22
- when '.side' then Superbot::Runner::Side.run(recording)
23
- else abort "#{file_extension} scripts are not supported yet"
24
- end
19
+ open_teleport unless no_teleport?
20
+ sorted_files.each(&method(:run_test_file))
25
21
  ensure
26
- close_teleport
22
+ close_teleport unless no_teleport?
27
23
  end
28
24
 
29
25
  private
@@ -40,6 +36,26 @@ module Superbot
40
36
  end
41
37
  end
42
38
 
39
+ def sorted_files
40
+ if File.directory?(path)
41
+ Dir.glob(File.join(path, '*'))
42
+ .map! { |f| [f.gsub(path, ''), f] }
43
+ .sort
44
+ .map(&:last)
45
+ else
46
+ [path]
47
+ end
48
+ end
49
+
50
+ def run_test_file(test_file)
51
+ file_extension = File.extname(test_file)
52
+ puts "Running #{test_file}"
53
+ case file_extension
54
+ when '.side' then Superbot::Runner::Side.run(test_file)
55
+ else puts "#{file_extension} scripts are not supported yet"
56
+ end
57
+ end
58
+
43
59
  def close_teleport
44
60
  sleep 1
45
61
  @chromedriver&.kill
@@ -1,5 +1,5 @@
1
1
  module Superbot
2
2
  module Runner
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: superbot-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Superbt HQ
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-19 00:00:00.000000000 Z
11
+ date: 2018-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: superbot-runner-side