protractor-rails 0.0.9 → 0.0.10

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: 8fc32fad5a4153160310ef39a668be0dde0f9e71
4
- data.tar.gz: eebf81e2741edcd7ceee76f1da6af55fbee8657d
3
+ metadata.gz: 9f07fed01ee88bf678a1fddb7ae1c92b44ddb578
4
+ data.tar.gz: 8dec8d40a86ff8a49c5ac6cb1e95cf7adf892262
5
5
  SHA512:
6
- metadata.gz: 66ae54f75fe47bcefe7568461f3ec31cb63f5b271c6f1db7f2fc65aebd7c4d306f0cf8efb29c20a99ad0f5cde76fa4b2c38ae19e75051b5150b54e765c65e63d
7
- data.tar.gz: a29b92fec5364dd83d29f362c4c5af4f9ed3d0d735e193caa143964a7b35e1d3434dc662d76fde68dd8694fb17e25a548e245be3f6d16d0755c10221276ce9b6
6
+ metadata.gz: 6d46d05852bf564f4fabdb38155df46dc614dfe1446f80b5a28ad84d10fe541744ec3064a0ec84571ea9b27e584738c17bc0d7b5ba7fe74b73753b066b2ab53f
7
+ data.tar.gz: 126e512d2aeb644e5b144b524e3eb8d3eb08b23339c6ada5f0fcdc39c9ea29e29c3749e0f38e9ecf6744f4e3dce754f0bd30f1256d75162b9b7908dd86398424
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- protractor-rails (0.0.9)
4
+ protractor-rails (0.0.10)
5
5
  colorize
6
6
  railties
7
7
 
@@ -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/protractor.conf.js'
33
- @startup_timeout = get( :startup_timeout ) || 6
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
 
@@ -1,5 +1,5 @@
1
1
  module Protractor
2
2
  module Rails
3
- VERSION = "0.0.9"
3
+ VERSION = "0.0.10"
4
4
  end
5
5
  end
@@ -39,25 +39,26 @@ namespace :protractor do
39
39
 
40
40
  desc "Initialize protractor rails."
41
41
  task :init do
42
- if !File.directory?('spec/javascripts')
43
- if !File.directory?('spec')
44
- puts "create spec directory".yellow
45
- `mkdir spec`
46
- end
47
- puts "Create spec/javascripts directory".yellow
48
- `mkdir spec/javascripts`
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 !File.exist? Protractor.configuration.config_path
51
- puts "Creating template configuration file in #{Protractor.configuration.config_path}".green
52
- template_path = File.expand_path("../../../#{Protractor.configuration.config_path}", __FILE__)
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} #{Protractor.configuration.config_path}"
56
- puts "You will need to edit the #{Protractor.configuration.config_path} file to suite your requirements."
57
- system "cp #{template_spec} spec/javascripts/example_spec.js"
58
- puts "created example_spec.js in spec/javascripts. You can test it out by running rake protractor:spec"
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('Example Specifcation', function() {
2
- it('should be able to find the rails test server', function(done) {
3
- expect(true).toBeTruthy();
4
- done();
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.9
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-10 00:00:00.000000000 Z
11
+ date: 2014-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler