Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

redirect (sometimes) goes to a blank page. (cached 302's???) #841

Open
patrick99e99 opened this issue Sep 23, 2015 · 4 comments
Open

redirect (sometimes) goes to a blank page. (cached 302's???) #841

patrick99e99 opened this issue Sep 23, 2015 · 4 comments

Comments

@patrick99e99
Copy link

I have the simplest of simple as far as tests go:

sign_in user
visit root_path

within('.nav-links') do
  click_on 'LOGOUT'
end

expect(current_path).to eq '/sign_in'

within('form') do
  expect(page).to have_field 'user_username'
  expect(page).to have_field 'user_password'
end

... This fails, claiming it was unable to find the selector 'form'. This is an intermittent failure (my favorite kind) which happens every few spec runs. I found that if I use the seed of a failing test run, it will fail each and every time which means somehow it has something to do with previous browser state. I am assuming that for some reason, capybara-webkit sometimes gets hung up on 302 redirects, as the sign out link goes to /sign_out and that redirects to /sign_in. Since I can reproduce this with the same random seed, I was able to do screenshot prior to failure and I see:
http://tinyurl.com/pm3tlfm

It is a blank page... Nothing there.. I tried setting my default max timeout is set to something ridiculous like 30 seconds... It never shows anything. However, my rails test log shows during this failing spec:

Redirected to http://127.0.0.1:59441/
Completed 302 Found in 17ms (ActiveRecord: 1.9ms)
Started GET "/" for 127.0.0.1 at 2015-09-23 11:48:44 -0700
  User Load (0.3ms)  SELECT  "users".* FROM "users"  WHERE "users"."username" IS NULL LIMIT 1
Started GET "/sign_in" for 127.0.0.1 at 2015-09-23 11:48:44 -0700

So it is rendering the page.. Capybara is somehow just not getting the response.

.... Also since I can reproduce this with the seed, I spent over an hour debugging / troubleshooting by going in and commenting out previous specs to isolate what about the current test order causes this failure. I finally found there is one spec, if I comment it out, this sign out spec no longer fails... And guess what that spec is doing? Clicking cancel on a modal which signs out the user. So I am suspecting the action of visiting /sign_out is somehow getting cached in capybara-webkit, and the second time it gets that it just goes to that "blank page" without actually redirecting

This is what my capybara-webkit debug shows during the failure:

Load started
"Node.leftClick" started page load
Started request to "http://127.0.0.1:61067/sign_out"
Finished "Node.leftClick" with response "Success()"
Started request to "http://127.0.0.1:61067/"
Received 302 from "http://127.0.0.1:61067/sign_out"
Started request to "http://127.0.0.1:61067/sign_in"
Received 301 from "http://127.0.0.1:61067/"
Received 304 from "http://127.0.0.1:61067/sign_in"
Page finished with true
Load finished
Page load from command finished
Wrote response true ""
Received "CurrentUrl()"
Started "CurrentUrl()"
Finished "CurrentUrl()" with response "Success(http://127.0.0.1:61067/sign_in)"
Wrote response true "http://127.0.0.1:61067/sign_in"
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(1)"
Wrote response true "1"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(2)"
Wrote response true "2"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(3)"
Wrote response true "3"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(4)"
Wrote response true "4"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(5)"
Wrote response true "5"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(6)"
Wrote response true "6"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(7)"
Wrote response true "7"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(8)"
Wrote response true "8"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(9)"
Wrote response true "9"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(10)"
Wrote response true "10"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(11)"
Wrote response true "11"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(12)"
Wrote response true "12"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(13)"
Wrote response true "13"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(14)"
Wrote response true "14"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(15)"
Wrote response true "15"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(16)"
Wrote response true "16"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(17)"
Wrote response true "17"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(18)"
Wrote response true "18"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(19)"
Wrote response true "19"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(20)"
Wrote response true "20"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(21)"
Wrote response true "21"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(22)"
Wrote response true "22"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(23)"
Wrote response true "23"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(24)"
Wrote response true "24"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(25)"
Wrote response true "25"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(26)"
Wrote response true "26"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(27)"
Wrote response true "27"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(28)"
Wrote response true "28"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(29)"
Wrote response true "29"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(30)"
Wrote response true "30"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(31)"
Wrote response true "31"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(32)"
Wrote response true "32"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(33)"
Wrote response true "33"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(34)"
Wrote response true "34"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(35)"
Wrote response true "35"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(36)"
Wrote response true "36"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(37)"
Wrote response true "37"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(38)"
Wrote response true "38"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(39)"
Wrote response true "39"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(40)"
Wrote response true "40"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(41)"
Wrote response true "41"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(42)"
Wrote response true "42"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(43)"
Wrote response true "43"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(44)"
Wrote response true "44"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(45)"
Wrote response true "45"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(46)"
Wrote response true "46"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(47)"
Wrote response true "47"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(48)"
Wrote response true "48"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(49)"
Wrote response true "49"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(50)"
Wrote response true "50"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(51)"
Wrote response true "51"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(52)"
Wrote response true "52"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(53)"
Wrote response true "53"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(54)"
Wrote response true "54"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(55)"
Wrote response true "55"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(56)"
Wrote response true "56"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(57)"
Wrote response true "57"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(58)"
Wrote response true "58"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(59)"
Wrote response true "59"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(60)"
Wrote response true "60"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(61)"
Wrote response true "61"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(62)"
Wrote response true "62"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(63)"
Wrote response true "63"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(64)"
Wrote response true "64"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(65)"
Wrote response true "65"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(66)"
Wrote response true "66"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(67)"
Wrote response true "67"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(68)"
Wrote response true "68"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(69)"
Wrote response true "69"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(70)"
Wrote response true "70"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(71)"
Wrote response true "71"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(72)"
Wrote response true "72"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(73)"
Wrote response true "73"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(74)"
Wrote response true "74"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(75)"
Wrote response true "75"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(76)"
Wrote response true "76"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(77)"
Wrote response true "77"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(78)"
Wrote response true "78"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(79)"
Wrote response true "79"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(80)"
Wrote response true "80"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(81)"
Wrote response true "81"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(82)"
Wrote response true "82"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(83)"
Wrote response true "83"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(84)"
Wrote response true "84"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(85)"
Wrote response true "85"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(86)"
Wrote response true "86"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(87)"
Wrote response true "87"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(88)"
Wrote response true "88"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(89)"
Wrote response true "89"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(90)"
Wrote response true "90"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(91)"
Wrote response true "91"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(92)"
Wrote response true "92"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "FindXpath(/html)"
Started "FindXpath(/html)"
Finished "FindXpath(/html)" with response "Success(93)"
Wrote response true "93"
Received "Node.visible"
Started "Node.visible"
Finished "Node.visible" with response "Success(true)"
Wrote response true "true"
Received "Node.text"
Started "Node.text"
Finished "Node.text" with response "Success()"
Wrote response true ""
Received "Reset()"
Started "Reset()"
Finished "Reset()" with response "Success()"
Wrote response true ""
Received "EnableLogging()"
Started "EnableLogging()"
Finished "EnableLogging()" with response "Success()"
Wrote response true ""
Received "SetUnknownUrlMode(block)"
Started "SetUnknownUrlMode(block)"
Finished "SetUnknownUrlMode(block)" with response "Success()"
Wrote response true ""
Received "IgnoreSslErrors()"
Started "IgnoreSslErrors()"
Finished "IgnoreSslErrors()" with response "Success()"
Wrote response true ""
Received "SetSkipImageLoading(true)"
Started "SetSkipImageLoading(true)"
Finished "SetSkipImageLoading(true)" with response "Success()"
Wrote response true ""
Received "SetTimeout(60)"
Started "SetTimeout(60)"
Finished "SetTimeout(60)" with response "Success()"
Wrote response true ""
Received "FindXpath(/html/body/*)"
Started "FindXpath(/html/body/*)"
Finished "FindXpath(/html/body/*)" with response "Success()"
Wrote response true ""


Failure/Error: within('form') do
 Capybara::ElementNotFound:
   Unable to find css "form"
@bencappello
Copy link

Also having this issue! Exactly the same - Completed 302 Found, and then a GET for the next page. Capybara somehow executing the expectations on the next page.

@abinoam
Copy link

abinoam commented Feb 24, 2016

Hi @patrick99e99, I was trying to update my gem versions and perhaps I'm running your same problem.
I have a visit to user destroy session and then a expectation about the content of the page.

But it returns a blank page like

<html><head></head><body></body></html>

I have tracked the version of capybara-webkit that this error first appears.

  • capybara-webkit (1.5.2) - GOOD
  • capybara-webkit (1.6.0) - BAD

I have

  • gem 'capybara', "2.4.4"

and ...

  • ruby '2.2.2'
  • gem 'rails', '4.2.5.1'

@patrick99e99, could you try capybara-webkit 1.5.2 on your setup to see if the issue is only from 1.6.0. I think this could be of value to someone trying to fix it.

And also, I have changed this in my setup. (As you said that a cached GET is the suspect, I think should be important to show these fragments also).

config/routes.rb

MyAppName::Application.routes.draw do

  devise_for :users, :controllers => { :sessions => "users/sessions" }
  # It seems devise always send GET requests.
  # The destroy session would be a DELETE request.
  # Making GET possible for production sessions#destroy seems
  # to be a security failure.
  # So we make a GET route available _only_ on tests.
  if Rails.env.test?
    devise_scope :user do
      get '/users/sign_out' => 'devise/sessions#destroy'
    end
  end
  # ...
end

config/initializers/devise.rb

Devise.setup do |config|
  #...
  # The default HTTP method used to sign out a resource. Default is :delete.
  config.sign_out_via = :delete
  config.sign_out_via = :get if Rails.env.test?
  # ...
end

@jferris
Copy link
Contributor

jferris commented Feb 24, 2016

@abinoam I think the change in 1.6 related to what you're seeing is #775.

It seems very likely that this is because QtWebKit is caching something between test runs. We have some ongoing discussion about that on #724.

@morganick
Copy link

@patrick99e99 Since you are using Rails, in your config/environments/test.rb add:

Rails.application.configure do
  #... all your other stuffs
  config.middleware.delete Rack::ETag
end

You'll see in your test debug output that you are getting a 304 and things fall apart from there. We were getting the same issue and 304 was causing capybara to give us a response body exactly as you posted above.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants