[wtr-general] Re: goto method not found

2016-10-04 Thread Justin Ko
The "type: :request" is added when Rails is detected, which happened during 
your installation. As a result, each of the configurations only applies to 
examples groups that have the same metadata of "type: :request". I am not a 
Rails developer, so I cannot explain the rationale for adding the filter. 
At any rate, instead of removing the filter, you could have also gotten the 
tests to run by adding the metadata to the example group - ie 
"RSpec.describe "Google", type: :request do"

In terms of getting the second test to run, it looks there have been some 
changes in the layout of the Google results. I had to update the test to be:

  it "allows to search" do
text_field(name: "q").set "watir"

# Changed the locator, as well as added when_present to wait for the 
layout changes
button(name: "btnG").when_present.click

results = div(id: "ires")
expect(results).to be_present.within(2)

# Changed to look at divs instead of lis
expect(results.divs(class: "g").map(&:text)).to be_any { |text| text =~ 
/watir/ }

expect(results).to be_present.during(1)
  end

Justin


On Tuesday, October 4, 2016 at 2:37:39 PM UTC-4, artie.z...@gmail.com wrote:
>
> Thanks very much for the dialog on this, Justin. 
> I know your time must be valuable.  
>
> Well, perhaps the mystery deepens. :)
> At least for me it does. Lot for me to learn here. 
>
> Indeed, this entire block (with comments) was inside my 
> ./spec/spec_helper.rb file:
>
> require "watir/rspec"
>
> RSpec.configure do |config|
>   config.add_formatter(:progress) if config.formatters.empty?
>   config.add_formatter(Watir::RSpec::HtmlFormatter)
>
>
>   config.before :all, type: :request do
> @browser = Watir::Browser.new
>   end
>
>
>   config.after :all, type: :request do
> @browser.close if @browser
>   end
>
>   config.include Watir::RSpec::Helper, type: :request
>   config.include Watir::RSpec::Matchers, type: :request
> end
>
>
>
> My Terminal scroll-back indicates I ran the installer:
> $ watir-rspec install
> Rails application detected.
> Installing watir-rspec configuration into 
> /Users/dks/Projects/spiker/spec/spec_helper.rb.
>
> Can anyone elaborate on the reason why the removal of the four occurrences 
> of "type: :request", creates conditions where the goto appears to work 
> properly. Well, honestly I did not try with only two or three. I removed 
> all four. 
>
> In fact, the sample "google url" script on the github page appears to work 
> to completion on my system. 
>
> May I ask further... in the sample script, why does the second test fail? 
> I tried to fix it by changing the search string that presumably referenced 
> the CSS id of the "Google Search" and "Feeling Lucky" button. However, when 
> I change it to any reasonable id I discover when using GoogleChrome 
> Developer Inspect Tool. I get various errors, including selenium 
> ElementNotVisibleError, and Watir UnknownMethodException. I would not think 
> making the second test pass was this challenging. Ha! How to make it pass?
>
> Many thanks.
> AZ
>
>
> On Tuesday, October 4, 2016 at 8:50:02 AM UTC-7, Justin Ko wrote:
>>
>> When I ran the install, the following was added to the spec_helper (with 
>> the comments removed for brevity):
>>
>> require "watir/rspec"
>>
>> RSpec.configure do |config|
>>   config.add_formatter(:progress) if config.formatters.empty?
>>   config.add_formatter(Watir::RSpec::HtmlFormatter)
>>
>>   config.before :all do
>> @browser = Watir::Browser.new
>>   end
>>
>>   config.after :all do
>> @browser.close if @browser
>>   end
>>
>>   config.include Watir::RSpec::Helper
>>   config.include Watir::RSpec::Matchers
>> end
>>
>>
>> The "goto" method is added to examples by the "config.include 
>> Watir::RSpec::Helper" line. Though you will likely want to include all of 
>> these lines if you are just starting out.
>>
>> Justin
>>
>>
>>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: goto method not found

2016-10-04 Thread artie . ziff
Thanks very much for the dialog on this, Justin. 
I know your time must be valuable.  

Well, perhaps the mystery deepens. :)
At least for me it does. Lot for me to learn here. 

Indeed, this entire block (with comments) was inside my 
./spec/spec_helper.rb file:

require "watir/rspec"

RSpec.configure do |config|
  config.add_formatter(:progress) if config.formatters.empty?
  config.add_formatter(Watir::RSpec::HtmlFormatter)


  config.before :all, type: :request do
@browser = Watir::Browser.new
  end


  config.after :all, type: :request do
@browser.close if @browser
  end

  config.include Watir::RSpec::Helper, type: :request
  config.include Watir::RSpec::Matchers, type: :request
end



My Terminal scroll-back indicates I ran the installer:
$ watir-rspec install
Rails application detected.
Installing watir-rspec configuration into 
/Users/dks/Projects/spiker/spec/spec_helper.rb.

Can anyone elaborate on the reason why the removal of the four occurrences 
of "type: :request", creates conditions where the goto appears to work 
properly. Well, honestly I did not try with only two or three. I removed 
all four. 

In fact, the sample "google url" script on the github page appears to work 
to completion on my system. 

May I ask further... in the sample script, why does the second test fail? I 
tried to fix it by changing the search string that presumably referenced 
the CSS id of the "Google Search" and "Feeling Lucky" button. However, when 
I change it to any reasonable id I discover when using GoogleChrome 
Developer Inspect Tool. I get various errors, including selenium 
ElementNotVisibleError, and Watir UnknownMethodException. I would not think 
making the second test pass was this challenging. Ha! How to make it pass?

Many thanks.
AZ


On Tuesday, October 4, 2016 at 8:50:02 AM UTC-7, Justin Ko wrote:
>
> When I ran the install, the following was added to the spec_helper (with 
> the comments removed for brevity):
>
> require "watir/rspec"
>
> RSpec.configure do |config|
>   config.add_formatter(:progress) if config.formatters.empty?
>   config.add_formatter(Watir::RSpec::HtmlFormatter)
>
>   config.before :all do
> @browser = Watir::Browser.new
>   end
>
>   config.after :all do
> @browser.close if @browser
>   end
>
>   config.include Watir::RSpec::Helper
>   config.include Watir::RSpec::Matchers
> end
>
>
> The "goto" method is added to examples by the "config.include 
> Watir::RSpec::Helper" line. Though you will likely want to include all of 
> these lines if you are just starting out.
>
> Justin
>
>
>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: goto method not found

2016-10-04 Thread Justin Ko
When I ran the install, the following was added to the spec_helper (with 
the comments removed for brevity):

require "watir/rspec"

RSpec.configure do |config|
  config.add_formatter(:progress) if config.formatters.empty?
  config.add_formatter(Watir::RSpec::HtmlFormatter)

  config.before :all do
@browser = Watir::Browser.new
  end

  config.after :all do
@browser.close if @browser
  end

  config.include Watir::RSpec::Helper
  config.include Watir::RSpec::Matchers
end


The "goto" method is added to examples by the "config.include 
Watir::RSpec::Helper" line. Though you will likely want to include all of 
these lines if you are just starting out.

Justin


On Tuesday, October 4, 2016 at 11:28:23 AM UTC-4, artie.z...@gmail.com 
wrote:
>
> Thank you very much for your reply
> Yes, I ran install. 
> IIRC correctly there were two lines of output. 
> I did not make a copy of the spec_helper before I ran the install. 
> What should I look for in there?
>
> thanks!
> -AZ
>
>
> On Tuesday, October 4, 2016 at 6:52:30 AM UTC-7, Justin Ko wrote:
>>
>> It sounds like the Watir::RSpec::Helper has not been added to the example 
>> groups.
>>
>> Did you run the "watir-rspec install" (see last step of installation)? 
>> The install augments your project's spec_helper file to include this module 
>> and other related parts.
>>
>> In terms of the debugging question, I do not have much advice. With 
>> undefined method errors, I suppose you need to figure out where the method 
>> is supposed to be defined and then figure out why it isn't being included. 
>> If you have some familiarity with RSpec and Watir, you might be able to 
>> guess that "goto" method is being done by Watir-RSpec. You can dig through 
>> the code to figure out where it defines the "goto" method - though this one 
>> is a bit difficult since it is implemented using method_missing in the 
>> Watir::RSpec::Helper. From there, you would look at why it is not being 
>> included in your RSpec config, which might lead you to noticing your 
>> spec_helper hasn't been updated.
>>
>> Justin
>>
>>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: goto method not found

2016-10-04 Thread artie . ziff
Thank you very much for your reply
Yes, I ran install. 
IIRC correctly there were two lines of output. 
I did not make a copy of the spec_helper before I ran the install. 
What should I look for in there?

thanks!
-AZ


On Tuesday, October 4, 2016 at 6:52:30 AM UTC-7, Justin Ko wrote:
>
> It sounds like the Watir::RSpec::Helper has not been added to the example 
> groups.
>
> Did you run the "watir-rspec install" (see last step of installation)? The 
> install augments your project's spec_helper file to include this module and 
> other related parts.
>
> In terms of the debugging question, I do not have much advice. With 
> undefined method errors, I suppose you need to figure out where the method 
> is supposed to be defined and then figure out why it isn't being included. 
> If you have some familiarity with RSpec and Watir, you might be able to 
> guess that "goto" method is being done by Watir-RSpec. You can dig through 
> the code to figure out where it defines the "goto" method - though this one 
> is a bit difficult since it is implemented using method_missing in the 
> Watir::RSpec::Helper. From there, you would look at why it is not being 
> included in your RSpec config, which might lead you to noticing your 
> spec_helper hasn't been updated.
>
> Justin
>
>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: goto method not found

2016-10-04 Thread Justin Ko
It sounds like the Watir::RSpec::Helper has not been added to the example 
groups.

Did you run the "watir-rspec install" (see last step of installation)? The 
install augments your project's spec_helper file to include this module and 
other related parts.

In terms of the debugging question, I do not have much advice. With 
undefined method errors, I suppose you need to figure out where the method 
is supposed to be defined and then figure out why it isn't being included. 
If you have some familiarity with RSpec and Watir, you might be able to 
guess that "goto" method is being done by Watir-RSpec. You can dig through 
the code to figure out where it defines the "goto" method - though this one 
is a bit difficult since it is implemented using method_missing in the 
Watir::RSpec::Helper. From there, you would look at why it is not being 
included in your RSpec config, which might lead you to noticing your 
spec_helper hasn't been updated.

Justin


On Tuesday, October 4, 2016 at 9:22:58 AM UTC-4, artie.z...@gmail.com wrote:
>
> Hello!
>
> I want to use watir-rspec . After 
> finding this google group, I see a post announcing a new release from 
> jarmo. So, I must be in the right place, finally. 
>
> Is the recent release of watir-rspec known to work?
>  
> I tried the "Google" example (exactly as shown). It is the one on the 
> watir-rspec github home page. 
>
> There is some issue "seeing" the "goto" method. 
>
> I'd like to know how somebody can perform debugging an error like this:
>
> NoMethodError:
>undefined method `goto' for 
> #
>
> Is there a way I can learn to determine what the root cause of this issue?
>
> Of course, if I modify the script and insert initialize a "browser" 
> variable explicitly in the before clause, like this, things appear to work 
> fine:
> browser = Watir:Browser.new :chrome
> browser.goto("http://www.google.com/;)
>
> FTR (and to help me solve this), I am using ruby 2.3.1 and here is my gem 
> list:
>
> [{2.3.1}]~: ➭ gem list
>
> *** LOCAL GEMS ***
>
> actioncable (5.0.0.1)
> actionmailer (5.0.0.1)
> actionpack (5.0.0.1)
> actionview (5.0.0.1)
> activejob (5.0.0.1)
> activemodel (5.0.0.1)
> activerecord (5.0.0.1)
> activesupport (5.0.0.1)
> addressable (2.4.0)
> arel (7.1.2)
> bigdecimal (default: 1.2.8)
> builder (3.2.2)
> bundler (1.13.2)
> byebug (9.0.6)
> capybara (2.9.1)
> childprocess (0.5.9)
> coderay (1.1.1)
> coffee-rails (4.2.1)
> coffee-script (2.4.1)
> coffee-script-source (1.10.0)
> concurrent-ruby (1.0.2)
> debug_inspector (0.0.2)
> did_you_mean (1.0.0)
> diff-lcs (1.2.5)
> erubis (2.7.0)
> execjs (2.7.0)
> ffi (1.9.14)
> globalid (0.3.7)
> i18n (0.7.0)
> io-console (default: 0.4.5)
> jbuilder (2.6.0)
> jquery-rails (4.2.1)
> json (default: 1.8.3)
> listen (3.0.8)
> loofah (2.0.3)
> mail (2.6.4)
> method_source (0.8.2)
> mime-types (3.1)
> mime-types-data (3.2016.0521)
> mini_portile2 (2.1.0)
> minitest (5.9.1, 5.8.3)
> multi_json (1.12.1)
> net-telnet (0.1.1)
> nio4r (1.2.1)
> nokogiri (1.6.8)
> pkg-config (1.1.7)
> power_assert (0.2.6)
> pry (0.10.4)
> psych (default: 2.0.17)
> puma (3.6.0)
> rack (2.0.1)
> rack-test (0.6.3)
> rails (5.0.0.1)
> rails-dom-testing (2.0.1)
> rails-html-sanitizer (1.0.3)
> railties (5.0.0.1)
> rake (11.3.0, 10.4.2)
> rb-fsevent (0.9.7)
> rb-inotify (0.9.7)
> rdoc (default: 4.2.1)
> rspec (3.5.0)
> rspec-core (3.5.4, 3.5.3)
> rspec-expectations (3.5.0)
> rspec-mocks (3.5.0)
> rspec-rails (3.5.2)
> rspec-support (3.5.0)
> rubygems-update (2.6.7)
> rubyzip (1.2.0)
> sass (3.4.22)
> sass-rails (5.0.6)
> selenium-webdriver (3.0.0.beta3.1, 2.53.4)
> slop (3.6.0)
> spring (2.0.0)
> spring-watcher-listen (2.0.1)
> sprockets (3.7.0)
> sprockets-rails (3.2.0)
> sqlite3 (1.3.11)
> test-unit (3.1.5)
> thor (0.19.1)
> thread_safe (0.3.5)
> tilt (2.0.5)
> turbolinks (5.0.1)
> turbolinks-source (5.0.0)
> tzinfo (1.2.2)
> uglifier (3.0.2)
> watir (6.0.0.beta5)
> watir-rails (2.0.0)
> watir-rspec (3.0.0)
> watir-webdriver (0.9.3)
> web-console (3.3.1)
> websocket (1.2.3)
> websocket-driver (0.6.4)
> websocket-extensions (0.1.2)
> xpath (2.0.0)
>
>
> Many thanks for any advices.
> AZ
>
>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] goto method not found

2016-10-04 Thread artie . ziff
Hello!

I want to use watir-rspec . After 
finding this google group, I see a post announcing a new release from 
jarmo. So, I must be in the right place, finally. 

Is the recent release of watir-rspec known to work?
 
I tried the "Google" example (exactly as shown). It is the one on the 
watir-rspec github home page. 

There is some issue "seeing" the "goto" method. 

I'd like to know how somebody can perform debugging an error like this:

NoMethodError:
   undefined method `goto' for 
#

Is there a way I can learn to determine what the root cause of this issue?

Of course, if I modify the script and insert initialize a "browser" 
variable explicitly in the before clause, like this, things appear to work 
fine:
browser = Watir:Browser.new :chrome
browser.goto("http://www.google.com/;)

FTR (and to help me solve this), I am using ruby 2.3.1 and here is my gem 
list:

[{2.3.1}]~: ➭ gem list

*** LOCAL GEMS ***

actioncable (5.0.0.1)
actionmailer (5.0.0.1)
actionpack (5.0.0.1)
actionview (5.0.0.1)
activejob (5.0.0.1)
activemodel (5.0.0.1)
activerecord (5.0.0.1)
activesupport (5.0.0.1)
addressable (2.4.0)
arel (7.1.2)
bigdecimal (default: 1.2.8)
builder (3.2.2)
bundler (1.13.2)
byebug (9.0.6)
capybara (2.9.1)
childprocess (0.5.9)
coderay (1.1.1)
coffee-rails (4.2.1)
coffee-script (2.4.1)
coffee-script-source (1.10.0)
concurrent-ruby (1.0.2)
debug_inspector (0.0.2)
did_you_mean (1.0.0)
diff-lcs (1.2.5)
erubis (2.7.0)
execjs (2.7.0)
ffi (1.9.14)
globalid (0.3.7)
i18n (0.7.0)
io-console (default: 0.4.5)
jbuilder (2.6.0)
jquery-rails (4.2.1)
json (default: 1.8.3)
listen (3.0.8)
loofah (2.0.3)
mail (2.6.4)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.9.1, 5.8.3)
multi_json (1.12.1)
net-telnet (0.1.1)
nio4r (1.2.1)
nokogiri (1.6.8)
pkg-config (1.1.7)
power_assert (0.2.6)
pry (0.10.4)
psych (default: 2.0.17)
puma (3.6.0)
rack (2.0.1)
rack-test (0.6.3)
rails (5.0.0.1)
rails-dom-testing (2.0.1)
rails-html-sanitizer (1.0.3)
railties (5.0.0.1)
rake (11.3.0, 10.4.2)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
rdoc (default: 4.2.1)
rspec (3.5.0)
rspec-core (3.5.4, 3.5.3)
rspec-expectations (3.5.0)
rspec-mocks (3.5.0)
rspec-rails (3.5.2)
rspec-support (3.5.0)
rubygems-update (2.6.7)
rubyzip (1.2.0)
sass (3.4.22)
sass-rails (5.0.6)
selenium-webdriver (3.0.0.beta3.1, 2.53.4)
slop (3.6.0)
spring (2.0.0)
spring-watcher-listen (2.0.1)
sprockets (3.7.0)
sprockets-rails (3.2.0)
sqlite3 (1.3.11)
test-unit (3.1.5)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.5)
turbolinks (5.0.1)
turbolinks-source (5.0.0)
tzinfo (1.2.2)
uglifier (3.0.2)
watir (6.0.0.beta5)
watir-rails (2.0.0)
watir-rspec (3.0.0)
watir-webdriver (0.9.3)
web-console (3.3.1)
websocket (1.2.3)
websocket-driver (0.6.4)
websocket-extensions (0.1.2)
xpath (2.0.0)


Many thanks for any advices.
AZ

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.