protractor-rails 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +9 -3
- data/lib/protractor/rails/version.rb +1 -1
- data/lib/tasks/protractor.rake +18 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fd62769107f64872318aeb898dc560f3f03ada6
|
4
|
+
data.tar.gz: 60a4e36af9c4e21c41d4af92baa9d25571e086d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c29977fed8f5157f1c210ab5c97a3c607a9391cae9532ee448f18c8267a2cb660c159cc62191fe4b0e607a1d97b179e968ef9a7d395ba50e08dcf898679574e
|
7
|
+
data.tar.gz: 65afd32e77cb103e4f3b790f707ee65fc097ae847036daee0b7de78d75f77b9ff250bca4fadcd6efe6affb34280e2fefb45fcc58c332861aff3fc36ef3df4c5b
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -45,7 +45,7 @@ If everything starts up and runs cleanly you should see the test summary of 1 te
|
|
45
45
|
### Running your tests
|
46
46
|
|
47
47
|
When the `rake protractor:init` script is run it will create a file `spec/javascripts/protractor.conf.js`. This file is where you
|
48
|
-
can configure the tests that should be run. [See Protractor Documentation for more details]
|
48
|
+
can configure the tests that should be run. [See Protractor Documentation for more details] (https://github.com/angular/protractor/blob/master/docs/getting-started.md).
|
49
49
|
|
50
50
|
In this file you can provide patterns for matching your protractor specs. **NB: It is recommended that you use a subdirectory such as spec/javascripts/protractor_specs for easy matching and organization**
|
51
51
|
|
@@ -78,7 +78,13 @@ If I have a directory set up for protractor specs in `spec/javascripts/protracto
|
|
78
78
|
|
79
79
|
```
|
80
80
|
|
81
|
-
Once you have setup your tests as above, running `rake protractor:spec` will pick up new tests and run them for you
|
81
|
+
Once you have setup your tests as above, running `rake protractor:spec` will pick up new tests and run them for you.
|
82
|
+
|
83
|
+
You can specify the binding for the rails server as an environment variable: `rake protractor:spec rails_binding=hostname_or_ip`.
|
84
|
+
|
85
|
+
You can run specific test suites by passing in options to the rake task as per the below example.
|
86
|
+
|
87
|
+
$ rake protractor:spec --suite suite-name
|
82
88
|
|
83
89
|
### Setup and teardown
|
84
90
|
|
@@ -102,7 +108,7 @@ rspec tests. Keep your integration tests to a minimum and test as much as possib
|
|
102
108
|
|
103
109
|
**Contributions, questions, comments, threats or suggestions are welcome.**
|
104
110
|
|
105
|
-
1. Fork it (
|
111
|
+
1. Fork it (http://github.com/my-github-username/protractor-rails/fork)
|
106
112
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
107
113
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
108
114
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/tasks/protractor.rake
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
require 'optparse'
|
2
|
+
|
3
|
+
namespace :protractor do |args|
|
2
4
|
desc "starts protractor example test to see if you have your system set up correctly"
|
3
5
|
task :example do
|
4
6
|
begin
|
@@ -18,6 +20,15 @@ namespace :protractor do
|
|
18
20
|
desc "Run specs from spec/javascripts/protractor.conf.js"
|
19
21
|
task :spec do
|
20
22
|
begin
|
23
|
+
options = ''
|
24
|
+
OptionParser.new(args) do |opts|
|
25
|
+
# Suite setup
|
26
|
+
suiteKey = '--suite'
|
27
|
+
opts.on("#{suiteKey} {suite}", 'Test suite name', String) do |suite|
|
28
|
+
options = options + "#{suiteKey} #{suite}"
|
29
|
+
end
|
30
|
+
end.parse!
|
31
|
+
|
21
32
|
webdriver_pid = fork do
|
22
33
|
Rake::Task['protractor:webdriver'].invoke
|
23
34
|
end
|
@@ -28,7 +39,7 @@ namespace :protractor do
|
|
28
39
|
puts "Rails Server PID: #{rails_server_pid}".yellow.bold
|
29
40
|
puts "Waiting for servers to finish starting up...."
|
30
41
|
sleep 6
|
31
|
-
success = system
|
42
|
+
success = system "protractor #{options} spec/javascripts/protractor.conf.js"
|
32
43
|
Process.kill 'TERM', webdriver_pid
|
33
44
|
Process.kill 'TERM', rails_server_pid
|
34
45
|
Process.wait webdriver_pid
|
@@ -69,7 +80,11 @@ namespace :protractor do
|
|
69
80
|
|
70
81
|
task :rails do
|
71
82
|
puts "Starting Rails server on port 4000 pid file in tmp/pids/protractor_test_server.pid".green
|
72
|
-
|
83
|
+
rails_command = "rails s -e test -P tmp/pids/protractor_test_server.pid --port=4000"
|
84
|
+
if ENV['rails_binding'] != nil
|
85
|
+
rails_command << " --binding #{ ENV['rails_binding'] }"
|
86
|
+
end
|
87
|
+
system rails_command
|
73
88
|
end
|
74
89
|
|
75
90
|
task :webdriver do
|
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.
|
4
|
+
version: 0.0.7
|
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-
|
11
|
+
date: 2014-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|