protractor-rails 0.0.11 → 0.0.12

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: 97e57f6fa5119ec8ce8ce4e21907ac81705f873a
4
- data.tar.gz: 029952ced1e06a6f43f60d0c4caeefc1e8aabf5c
3
+ metadata.gz: 22ecf4dc88d777f93fe5c056a3570c670c68230e
4
+ data.tar.gz: 71c8e69dace16a49c5f858be16b3b4ad06125fbe
5
5
  SHA512:
6
- metadata.gz: b7c45a0d5c1cf727081982aaa25f20c9eaa750924cbe9e9062ecd36d453a64713e3b027ba13308e8a6b55ab25c42c8cfd880d4a8279954d91d22ef8b266fe089
7
- data.tar.gz: 05bab3043131e48862ad480824fdfaa47c0a8491ca04ed272b5b72bb5dbed38619246a0c7da9669e1241ce6e09b5ab2946cac34ed6921ff240f7196d63cb55e7
6
+ metadata.gz: c278b0d392819f5556f54f3ca34bf43200194759202627622a10788056f19d8dd4fbadae476aa1599269091ed5a35f68f356f56cd2aebeaf63807b50890583f5
7
+ data.tar.gz: 651e8141646f1a5a06c13d44503454d973f65ce9ae2bb6564c6b974b0b4ad0f7d7680fa8317864a278eb0c26cebfa0346230347b0932af9221f1877b5710d3ab
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- protractor-rails (0.0.11)
4
+ protractor-rails (0.0.12)
5
5
  colorize
6
6
  railties
7
7
 
data/README.md CHANGED
@@ -113,12 +113,21 @@ There is also a convenience function for running cleanup after you have run your
113
113
 
114
114
  $ rake protractor:spec_and_cleanup
115
115
 
116
+ ### Task Options
117
+
118
+ #### rake protractor:spec
119
+
120
+ You can control verbosity of logging with the following ENV flags:
121
+
122
+ * `rake protractor:spec nolog=y # all quiet`
123
+ * `rake protractor:spec nolog_selenium=y # no selenium (just drivers)`
124
+ * `rake protractor:spec nolog_rails=y # no rails`
125
+
116
126
  ## Notes about integration tests
117
127
 
118
128
  Integration tests are **MUCH** faster than testing things yourself but they are MUCH slower than running unit tests or
119
129
  rspec tests. Keep your integration tests to a minimum and test as much as possible with your normal rails test suite.
120
130
 
121
-
122
131
  ## Contributing
123
132
 
124
133
  **Contributions, questions, comments, threats or suggestions are welcome.**
@@ -1,5 +1,5 @@
1
1
  module Protractor
2
2
  module Rails
3
- VERSION = "0.0.11"
3
+ VERSION = "0.0.12"
4
4
  end
5
5
  end
@@ -7,7 +7,7 @@ namespace :protractor do |args|
7
7
  webdriver_pid = fork do
8
8
  Rake::Task["protractor:webdriver"].invoke
9
9
  end
10
- puts "Waiting for test server and webdriver server to start"
10
+ write_log "Waiting for test server and webdriver server to start"
11
11
  sleep 5
12
12
  file = File.expand_path('../../../spec/protractor_example.conf.js', __FILE__)
13
13
  system "protractor #{file}"
@@ -17,6 +17,11 @@ namespace :protractor do |args|
17
17
  end
18
18
  end
19
19
 
20
+ def write_log(message)
21
+ return if ENV['nolog'].present?
22
+ puts message
23
+ end
24
+
20
25
  desc "Run specs from config file"
21
26
  task :spec do
22
27
  begin
@@ -35,21 +40,23 @@ namespace :protractor do |args|
35
40
  end.parse!
36
41
 
37
42
  webdriver_pid = fork do
43
+ [$stdout,$stderr].each { |fh| fh.reopen File.open("/dev/null","w") } if ENV['nolog'].present? || ENV['nolog_selenium'].present?
38
44
  Rake::Task['protractor:webdriver'].invoke
39
45
  end
40
46
  rails_server_pid = fork do
47
+ [$stdout,$stderr].each { |fh| fh.reopen File.open("/dev/null","w") } if ENV['nolog'].present? || ENV['nolog_rails'].present?
41
48
  Rake::Task['protractor:rails'].invoke
42
49
  end
43
- puts "webdriver PID: #{webdriver_pid}".yellow.bold
44
- puts "Rails Server PID: #{rails_server_pid}".yellow.bold
45
- puts "Waiting for servers to finish starting up...."
50
+ write_log "webdriver PID: #{webdriver_pid}"
51
+ write_log "Rails Server PID: #{rails_server_pid}".yellow.bold
52
+ write_log "Waiting for servers to finish starting up...."
46
53
  sleep Protractor.configuration.startup_timeout
47
54
  success = system "protractor #{options} #{Protractor.configuration.config_path}/#{Protractor.configuration.config_file}"
48
55
  Process.kill 'TERM', webdriver_pid
49
56
  Process.kill 'TERM', rails_server_pid
50
57
  Process.wait webdriver_pid
51
58
  Process.wait rails_server_pid
52
- puts "Waiting to shut down cleanly.........".yellow.bold
59
+ write_log "Waiting to shut down cleanly.........".yellow.bold
53
60
  sleep 5
54
61
  rescue Exception => e
55
62
  puts e
@@ -62,29 +69,29 @@ namespace :protractor do |args|
62
69
  task :spec_and_cleanup => [:spec, :cleanup]
63
70
 
64
71
  task :kill do
65
- puts "killing running protractor processes".green.bold
72
+ write_log "killing running protractor processes".green.bold
66
73
  Rake::Task["protractor:kill_rails"].invoke
67
74
  Rake::Task["protractor:kill_webdriver"].invoke
68
75
  Rake::Task["protractor:kill_selenium_processes"].invoke
69
76
  end
70
77
 
71
78
  task :kill_selenium_processes do
72
- puts "kill left over selenium processes...".yellow
79
+ write_log "kill left over selenium processes...".yellow
73
80
  system "ps aux | grep -ie 'protractor\/selenium' | awk '{print $2}' | xargs kill -9"
74
81
  end
75
82
 
76
83
  task :kill_webdriver do
77
- puts "kill webdriver server...".yellow
84
+ write_log "kill webdriver server...".yellow
78
85
  system "ps aux | grep -ie '\-Dwebdriver' | awk '{print $2}' | xargs kill -9"
79
86
  end
80
87
 
81
88
  task :kill_rails do
82
- puts "kill protractor rails tests server...".yellow
89
+ write_log "kill protractor rails tests server...".yellow
83
90
  system "ps aux | grep -ie 'rails s -e test -P tmp/pids/protractor_test_server.pid --port=#{Protractor.configuration.port}' | awk '{print $2}' | xargs kill -9"
84
91
  end
85
92
 
86
93
  task :rails do
87
- puts "Starting Rails server on port #{Protractor.configuration.port} pid file in tmp/pids/protractor_test_server.pid".green
94
+ write_log "Starting Rails server on port #{Protractor.configuration.port} pid file in tmp/pids/protractor_test_server.pid".green
88
95
  rails_command = "rails s -e test -P tmp/pids/protractor_test_server.pid --port=#{Protractor.configuration.port}"
89
96
  if ENV['rails_binding'] != nil
90
97
  rails_command << " --binding #{ ENV['rails_binding'] }"
@@ -93,14 +100,14 @@ namespace :protractor do |args|
93
100
  end
94
101
 
95
102
  task :webdriver do
96
- puts "Starting selenium server".green
103
+ write_log "Starting selenium server".green
97
104
  system "webdriver-manager start"
98
105
  end
99
106
 
100
107
  task :cleanup do
101
- puts "rake db:test:prepare to cleanup for the next test session".green
108
+ write_log "rake db:test:prepare to cleanup for the next test session".green
102
109
  system 'rake db:test:prepare --trace'
103
- puts "Seeding the test database....".green
110
+ write_log "Seeding the test database....".green
104
111
  system "rake db:test:seed --trace"
105
112
  end
106
113
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protractor-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyrone Wilson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-03 00:00:00.000000000 Z
11
+ date: 2014-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler