cuke-island 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -5,4 +5,5 @@ group(:test) do
5
5
  gem 'capybara'
6
6
  gem 'capybara-webkit'
7
7
  gem 'rspec'
8
+ gem 'poltergeist'
8
9
  end
@@ -1,10 +1,11 @@
1
+ @javascript
1
2
  Feature: Search
2
3
  In order to find pages on the web
3
4
  As an information seeker
4
5
  I want to be able to search using keywords
5
6
 
6
7
  Scenario: Search for cucumber
7
- Given I am on the home page
8
+ Given I am on /mobile
8
9
  And I have entered "cucumber bdd" into the "q" field
9
10
  When I click the "Search" button
10
11
  Then I should see "Cucumber - Making BDD fun"
@@ -38,6 +38,13 @@ Then /^I should not see "(.*)"$/ do |text|
38
38
  page.body.to_s.should_not =~ /#{text}/m
39
39
  end
40
40
 
41
+ #https://github.com/daneroo/capybara-phantomjs/blob/master/features/step_definitions/web_steps.rb
42
+ When /^I wait (\d+) seconds?$/ do |seconds|
43
+ sleep seconds.to_i
44
+ stamp = Time.now.strftime("%Y%m%d%H%M%S");
45
+ save_screenshot("screen-#{stamp}.png")
46
+ end
47
+
41
48
  When /^I sign in as "(.*?)"$/ do |arg1|
42
49
  fill_in("username", :with => arg1.split("/")[0])
43
50
  fill_in("password", :with => arg1.split("/")[1])
@@ -56,4 +63,10 @@ end
56
63
 
57
64
  When /^I click the "([^"]*)" button$/ do |button_text|
58
65
  click_button button_text
66
+ end
67
+
68
+ #https://github.com/mrako/standalone-cucumber/blob/master/features/step_definitions/web_steps.rb
69
+
70
+ Then /^show me the page$/ do
71
+ save_and_open_page
59
72
  end
@@ -2,12 +2,25 @@ begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations
2
2
  require 'capybara'
3
3
  require 'capybara/dsl'
4
4
  require 'capybara/cucumber'
5
+
6
+
7
+ Capybara.app_host = 'http://www.google.com'
8
+
9
+
10
+ #Use Webkit
5
11
  require 'capybara-webkit'
6
12
  Capybara.default_driver = :webkit
7
- #Capybara.app_host = 'http://www.google.com'
13
+
14
+ #User Poltergeist - Is Headless and runs without a framebuffer - https://github.com/jonleighton/poltergeist
15
+ #require 'capybara/poltergeist'
16
+ #Capybara.default_driver = :poltergeist
17
+
18
+ #Use ChromeDriver
8
19
  Capybara.register_driver :chrome do |app|
9
20
  Capybara::Selenium::Driver.new(app, :browser => :chrome)
10
21
  end
11
-
12
22
  Capybara.javascript_driver = :chrome
13
- World(Capybara)
23
+
24
+
25
+
26
+ World(Capybara)
data/lib/cuke_island.rb CHANGED
@@ -6,9 +6,10 @@ require 'fileutils'
6
6
  class CukeIsland < Thor::Group
7
7
  include Thor::Actions
8
8
 
9
- VERSION = "0.0.5"
9
+ VERSION = "0.0.6"
10
10
 
11
11
  argument :dir_name
12
+ argument :hostdomain, :optional => true
12
13
 
13
14
  def self.source_root
14
15
  File.join(File.dirname(__FILE__), '..', 'features')
@@ -38,6 +39,9 @@ class CukeIsland < Thor::Group
38
39
  template '../search.feature.off', 'search.feature.sample'
39
40
  empty_directory 'support'
40
41
  template '../support/env.rb', 'support/env.rb'
42
+ unless hostdomain.nil?
43
+ gsub_file("support/env.rb", "http://www.google.com", hostdomain)
44
+ end
41
45
  empty_directory 'step_definitions'
42
46
  template '../step_definitions/web_steps.rb', 'step_definitions/web_steps.rb'
43
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuke-island
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -108,6 +108,22 @@ dependencies:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
110
  version: 2.13.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: poltergeist
113
+ requirement: !ruby/object:Gem::Requirement
114
+ none: false
115
+ requirements:
116
+ - - '='
117
+ - !ruby/object:Gem::Version
118
+ version: 1.1.0
119
+ type: :runtime
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ none: false
123
+ requirements:
124
+ - - '='
125
+ - !ruby/object:Gem::Version
126
+ version: 1.1.0
111
127
  description: ! 'Standalone generator for a lightly configured cucumber capybara chromedriver
112
128
  test enviroment: cuke-island <test folder>'
113
129
  email: paul.scarrone@gmail.com
@@ -145,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
161
  version: '0'
146
162
  requirements: []
147
163
  rubyforge_project:
148
- rubygems_version: 1.8.24
164
+ rubygems_version: 1.8.25
149
165
  signing_key:
150
166
  specification_version: 3
151
167
  summary: Standalone webdriver generator