cucumber / cucumber-ruby

Cucumber for Ruby. It's amazing!
https://cucumber.io
MIT License
5.18k stars 1.12k forks source link

Visit method adds /content/index-m.php at the end of my URL #794

Closed toshidavila closed 9 years ago

toshidavila commented 9 years ago

It happens from time to time and I don't know why.

It randomly adds /content/index-m.php at the end of my URL which makes the scenario fail because the page is never loaded because that specific url doesn't exists. screen shot 2015-01-21 at 16 45 25

mattwynne commented 9 years ago

Can you explain why you think it's Cucumber that's doing this?

toshidavila commented 9 years ago

Hi Matt,

Because sometimes the visit method works as expected. Meaning my variable is www.assembla.com and it redirects me there but sometimes it adds this text /content/index-m.php with apparently no reason and randomly.

I don't know what's causing this. Do you have any idea?

mattwynne commented 9 years ago

Do you know which code implements the visit method?

toshidavila commented 9 years ago

Hi Matt,

I must say I am new with cucumber. This is the code in my steps.rb file

#BACKGROUND:
Given (/^I am on login page$/) do
  visit $page
end

It works OK most of the time but as I mentioned, sometimes that text is added at the end of the URL.

mattwynne commented 9 years ago

The visit method you're using is probably the one implemented by http://github.com/jnicklas/capybara. Do you have that gem as a dependency in your project?

Cucumber's responsibility only goes as far as finding step definition to match the words you used in your feature file, and then executing the code in the step definition block. The code that runs in the block is not really anything to do with Cucumber, sorry.

My guess is that either your app is doing a redirect, or whatever logic sets the $page variable is behaving unexpectedly. Either way, I can't see how Cucumber could be responsible for this. :smile:

toshidavila commented 9 years ago

Hi Matt,

I see. Thank you so much for your help. I'll start looking at other places to get this resolved.

Again thank you!

mattwynne commented 9 years ago

No problem, I know it's confusing when you're new to something. Good luck!

lock[bot] commented 6 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.