protractor-rails 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/protractor/rails/configuration.rb +6 -2
- data/lib/protractor/rails/version.rb +1 -1
- data/lib/tasks/install.rake +17 -16
- data/spec/javascripts/templates/example_spec.js +36 -5
- 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: 9f07fed01ee88bf678a1fddb7ae1c92b44ddb578
|
4
|
+
data.tar.gz: 8dec8d40a86ff8a49c5ac6cb1e95cf7adf892262
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d46d05852bf564f4fabdb38155df46dc614dfe1446f80b5a28ad84d10fe541744ec3064a0ec84571ea9b27e584738c17bc0d7b5ba7fe74b73753b066b2ab53f
|
7
|
+
data.tar.gz: 126e512d2aeb644e5b144b524e3eb8d3eb08b23339c6ada5f0fcdc39c9ea29e29c3749e0f38e9ecf6744f4e3dce754f0bd30f1256d75162b9b7908dd86398424
|
data/Gemfile.lock
CHANGED
@@ -24,13 +24,17 @@ module Protractor
|
|
24
24
|
|
25
25
|
class Configuration
|
26
26
|
attr_accessor :config_path,
|
27
|
+
:config_file,
|
27
28
|
:startup_timeout,
|
29
|
+
:spec_path,
|
28
30
|
:port
|
29
31
|
|
30
32
|
def initialize ( data=nil )
|
31
33
|
@data = data
|
32
|
-
@config_path = get( :config_path ) || 'spec/javascripts
|
33
|
-
@
|
34
|
+
@config_path = get( :config_path ) || 'spec/javascripts'
|
35
|
+
@config_file = get( :config_file ) || 'protractor.conf.js'
|
36
|
+
@spec_path = get( :spec_path ) || 'spec/javascripts'
|
37
|
+
@startup_timeout = get( :startup_timeout ) || 8
|
34
38
|
@port = get( :port ) || 4000
|
35
39
|
end
|
36
40
|
|
data/lib/tasks/install.rake
CHANGED
@@ -39,25 +39,26 @@ namespace :protractor do
|
|
39
39
|
|
40
40
|
desc "Initialize protractor rails."
|
41
41
|
task :init do
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
puts "
|
48
|
-
|
42
|
+
conf_path = Protractor.configuration.config_path
|
43
|
+
conf_file = File.join(conf_path, Protractor.configuration.config_file)
|
44
|
+
spec_path = Protractor.configuration.spec_path
|
45
|
+
|
46
|
+
if !File.directory?(spec_path)
|
47
|
+
puts "You have chosen to put your protractor-rails specs file in #{spec_path} but the directory doesn't exist. Please create it and then rerun this command".red
|
48
|
+
next
|
49
49
|
end
|
50
|
-
if
|
51
|
-
puts "
|
52
|
-
|
50
|
+
if File.exist? conf_file
|
51
|
+
puts "You already have a configuration file. If you would like to start over, remove #{Protractor.configuration.config_path} and run rake protractor:init".red
|
52
|
+
next
|
53
|
+
else
|
54
|
+
puts "Creating template configuration file in #{conf_path}".green
|
55
|
+
template_path = File.expand_path("../../../spec/javascripts/templates", __FILE__)
|
53
56
|
template_conf = File.join(template_path, 'protractor.conf.js')
|
54
57
|
template_spec = File.join(template_path, 'example_spec.js')
|
55
|
-
system "cp #{template_conf} #{
|
56
|
-
puts "You will need to edit the #{
|
57
|
-
system "cp #{template_spec}
|
58
|
-
puts "created example_spec.js in
|
59
|
-
else
|
60
|
-
puts "You already have a configuration file. If you would like to start over, remove #{Protractor.configuration.config_path} and run rake protractor:init".red
|
58
|
+
system "cp #{template_conf} #{conf_file}"
|
59
|
+
puts "You will need to edit the #{conf_file} file to suite your requirements."
|
60
|
+
system "cp #{template_spec} #{File.join(Protractor.configuration.spec_path, 'example_spec.js')}"
|
61
|
+
puts "created example_spec.js in #{spec_path}. You can test it out by running rake protractor:example"
|
61
62
|
end
|
62
63
|
end
|
63
64
|
end
|
@@ -1,6 +1,37 @@
|
|
1
|
-
describe('
|
2
|
-
it('should
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
describe('angularjs homepage', function() {
|
2
|
+
it('should greet the named user', function() {
|
3
|
+
browser.get('http://www.angularjs.org');
|
4
|
+
|
5
|
+
element(by.model('yourName')).sendKeys('Julie');
|
6
|
+
|
7
|
+
var greeting = element(by.binding('yourName'));
|
8
|
+
|
9
|
+
expect(greeting.getText()).toEqual('Hello Julie!');
|
10
|
+
});
|
11
|
+
|
12
|
+
describe('todo list', function() {
|
13
|
+
var todoList;
|
14
|
+
|
15
|
+
beforeEach(function() {
|
16
|
+
browser.get('http://www.angularjs.org');
|
17
|
+
|
18
|
+
todoList = element.all(by.repeater('todo in todos'));
|
19
|
+
});
|
20
|
+
|
21
|
+
it('should list todos', function() {
|
22
|
+
expect(todoList.count()).toEqual(2);
|
23
|
+
expect(todoList.get(1).getText()).toEqual('build an angular app');
|
24
|
+
});
|
25
|
+
|
26
|
+
it('should add a todo', function() {
|
27
|
+
var addTodo = element(by.model('todoText'));
|
28
|
+
var addButton = element(by.css('[value="add"]'));
|
29
|
+
|
30
|
+
addTodo.sendKeys('write a protractor test');
|
31
|
+
addButton.click();
|
32
|
+
|
33
|
+
expect(todoList.count()).toEqual(3);
|
34
|
+
expect(todoList.get(2).getText()).toEqual('write a protractor test');
|
35
|
+
});
|
36
|
+
});
|
6
37
|
});
|
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.10
|
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-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|