privly / privly-applications

The central repository for Privly Injectable Applications.
MIT License
19 stars 48 forks source link

[Level 3] Normal to have failing tests ? #232

Closed jatindhankhar closed 9 years ago

jatindhankhar commented 9 years ago

I tried running the integration testing for the privly applications and installed the necessary gems as well as the privly server. However login for normal user is not working, rails can't find the route, while the admin route works fine. screenshot from 2015-04-08 14 38 17

For Chrome_web image

For Chrome_extension image

I am yet to test this on SauceLabs, but I doubt how much testing free plan will allow. Can I have the free account with adequate testing rights

smcgregor commented 9 years ago

It looks like you did not do git clone --recursive for privly-web. Am I right? The reason the route is not found is you do not have the privly-applications repository in the rails "public" directory.

jatindhankhar commented 9 years ago

Yes :sweat_smile: checked my public folder, you were right, should have asked the question at correct place in the first place, my bad :sweat: . Cloned the repo again, first issue is fixed and test success rate increasing , but still not 100% yet, is this the task to fix this ?

smcgregor commented 9 years ago

We can work through the problem on this issue. What is currently failing? Can you give me the command you are issuing to start the tests?

jatindhankhar commented 9 years ago

Platform : chrome_web Command issued : ruby run_all.rb -p chrome_web -r experimental -c http://localhost:3000

Errors Error: test_creating_posts(TestNew) Error: test_creating_posts(TestNew) image


Platform : chrome_extension Command issued : ruby run_all.rb -p chrome_extension -r experimental -c http://localhost:3000

Errors Cannot open the extension page image

Logging the exact output

.....F
========================================================================================================================================================================
Failure: <false> is not true.
test_create_update_destroy(TestNew)
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:13:in `login'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:12:in `setup'
========================================================================================================================================================================
E
========================================================================================================================================================================
Error: test_create_update_destroy(TestNew)
: Capybara::ElementNotFound: Unable to find link "logout_link"
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/actions.rb:27:in `click_link'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:47:in `logout'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:79:in `teardown'
========================================================================================================================================================================
F
========================================================================================================================================================================
Failure: <false> is not true.
test_creating_posts(TestNew)
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:13:in `login'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:12:in `setup'
========================================================================================================================================================================
E
========================================================================================================================================================================
Error: test_creating_posts(TestNew)
: Capybara::ElementNotFound: Unable to find link "logout_link"
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/actions.rb:27:in `click_link'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:47:in `logout'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:79:in `teardown'
========================================================================================================================================================================
E
========================================================================================================================================================================
Error: test_changing_content_server(TestOptions)
: Capybara::ElementNotFound: Unable to find select box "content_server_url"
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/actions.rb:112:in `select'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_extension_options.rb:62:in `test_changing_content_server'
     59: 
     60:     page.driver.browser.get(@options_url)
     61: 
  => 62:     page.select 'https://dev.privly.org', :from => 'content_server_url'
     63:     click_button('save_server')
     64:     page.driver.browser.get(@options_url)
     65:     assert page.has_content?('dev.privly.org')
========================================================================================================================================================================
E
========================================================================================================================================================================
Error: test_regenerating_glyph(TestOptions)
: Capybara::ElementNotFound: Unable to find button "regenerate_glyph"
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/actions.rb:37:in `click_button'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_extension_options.rb:23:in `block in test_regenerating_glyph'
     20: 
     21:     # todo, make this elegant
     22:     10.times do
  => 23:       click_button('regenerate_glyph')
     24:       if not current_fill == page.all(:css, '.glyph_fill').length
     25:        return
     26:       end
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_extension_options.rb:22:in `times'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_extension_options.rb:22:in `test_regenerating_glyph'
========================================================================================================================================================================
E
========================================================================================================================================================================
Error: test_update_whitelist(TestOptions)
: NoMethodError: undefined method `set' for nil:NilClass
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_extension_options.rb:44:in `test_update_whitelist'
     41:     # Update the whitelist
     42:     page.driver.browser.get(@options_url)
     43:     elements = page.all(:css, '.whitelist_url')
  => 44:     elements[0].set 'Dev.Privly.Org.phish.org'
     45:     click_button 'save_whitelist'
     46:     page.driver.browser.get("http://test.privly.org/test_pages/nonwhitelist.html")
     47:     assert page.has_xpath?('//iframe')
========================================================================================================================================================================
^[[B^[[A^[[AF
========================================================================================================================================================================
Failure: <false> is not true.
test_showing_post_extension(TestShow)
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_show.rb:32:in `block in test_showing_post_extension'
     29:       to_append = testing_strings[to_test[:manifest_dictionary]["name"]]
     30:       url = to_test[:url]+to_append
     31:       page.driver.browser.get(url)
  => 32:       assert page.has_text?('The Apology')
     33:       assert page.has_text?('Metadata')
     34:       assert page.has_text?('https://privlyalpha.org/apps/')
     35:     end
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_show.rb:24:in `each'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_show.rb:24:in `test_showing_post_extension'
========================================================================================================================================================================

Finished in 172.296232528 seconds.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
11 tests, 15 assertions, 3 failures, 5 errors, 0 pendings, 0 omissions, 0 notifications
45.4545% passed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0.06 tests/s, 0.09 assertions/s

image

smcgregor commented 9 years ago

Two possibilities:

  1. You didn't do --recursive when you cloned the chrome extension.
  2. The Chrome extension's identifier changed. To solve this problem, open the extension's page with your browser and copy the long sequence of seemingly random characters that are shown in the address bar between chrome-extension:// and /privly-applications/. Replace all occurrences of the old address in the testing code with the new address.
jatindhankhar commented 9 years ago

Case 2 was the cuplirt, :+1: (Thanks !) so changed the Capybara.app_host to the extension address that was wokring. Test success percentage increased, logging in the remaining errors

.....E
========================================================================================================================================================================
Error: test_create_update_destroy(TestNew)
: Capybara::ElementNotFound: Unable to find field "content"
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/actions.rb:56:in `fill_in'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:46:in `block in test_create_update_destroy'
     43:       page.driver.browser.get(to_test[:url])
     44: 
     45:       # Create some content
  => 46:       fill_in 'content', :with =>  "Hello WebDriver!"
     47:       Selenium::WebDriver::Support::Select.new(page.driver.browser.find_element(:id, "seconds_until_burn")).select_by(:text, "1 Day")
     48:       find_button("save").click
     49:       page.find(:css,"span.privlyUrl").click
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:32:in `each'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:32:in `test_create_update_destroy'
========================================================================================================================================================================
E
========================================================================================================================================================================
Error: test_create_update_destroy(TestNew)
: Capybara::ElementNotFound: Unable to find link "logout_link"
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/actions.rb:27:in `click_link'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:47:in `logout'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:79:in `teardown'
========================================================================================================================================================================
E
========================================================================================================================================================================
Error: test_creating_posts(TestNew)
: Capybara::ElementNotFound: Unable to find field "content"
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/actions.rb:56:in `fill_in'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:22:in `block in test_creating_posts'
     19:         not to_test[:manifest_dictionary]["name"] == "Help" and
     20:         not to_test[:manifest_dictionary]["name"] == "Login"
     21:         page.driver.browser.get(to_test[:url]) # Re-load the page after we set the server
  => 22:         fill_in 'content', :with =>  "Hello WebDriver!"
     23:         click_on ('save')
     24:         urls = page.find('.privlyUrl', :visible => true)
     25:         assert urls.visible?
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:17:in `each'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:17:in `test_creating_posts'
========================================================================================================================================================================
E
========================================================================================================================================================================
Error: test_creating_posts(TestNew)
: Capybara::ElementNotFound: Unable to find link "logout_link"
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/actions.rb:27:in `click_link'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:47:in `logout'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:79:in `teardown'
========================================================================================================================================================================
....

Finished in 115.159495194 seconds.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
11 tests, 24 assertions, 0 failures, 4 errors, 0 pendings, 0 omissions, 0 notifications
81.8182% passed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0.10 tests/s, 0.21 assertions/s

image

P.S: Will be asleep by the time you read this (sorry for breaking the session ) 11 PM (bed time)

smcgregor commented 9 years ago

What do you see when you look at the browser window as it executes the test script? Does it hang on a particular screen?

jatindhankhar commented 9 years ago

It stucks for a while on the following screen image

Command log

....E
========================================================================================================================================================================
Error: test_twitter_injection(TestInjected)
: Capybara::ExpectationNotMet: expected to find css "iframe[data-privly-display='true']" 1 time but there were no matches
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/matchers.rb:97:in `block in assert_selector'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/matchers.rb:93:in `assert_selector'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_show_injected.rb:29:in `test_twitter_injection'
     26:     end
     27: 
     28:     visit "https://twitter.com/PrivlyTest/status/308809779655102464"
  => 29:     page.assert_selector("iframe[data-privly-display='true']", :count => 1)
     30:   end
     31: 
     32:   def test_showing_injected_posts
========================================================================================================================================================================
E
========================================================================================================================================================================
Error: test_create_update_destroy(TestNew)
: NoMethodError: undefined method `click' for nil:NilClass
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:30:in `login'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:12:in `setup'
========================================================================================================================================================================
E
========================================================================================================================================================================
Error: test_create_update_destroy(TestNew)
: Capybara::ElementNotFound: Unable to find link "logout_link"
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/actions.rb:27:in `click_link'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:47:in `logout'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:79:in `teardown'
========================================================================================================================================================================
E
========================================================================================================================================================================
Error: test_creating_posts(TestNew)
: NoMethodError: undefined method `click' for nil:NilClass
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:30:in `login'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:12:in `setup'
========================================================================================================================================================================
E
========================================================================================================================================================================
Error: test_creating_posts(TestNew)
: Capybara::ElementNotFound: Unable to find link "logout_link"
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/actions.rb:27:in `click_link'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:47:in `logout'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:79:in `teardown'
========================================================================================================================================================================
....

Finished in 103.394097035 seconds.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
11 tests, 23 assertions, 0 failures, 5 errors, 0 pendings, 0 omissions, 0 notifications
72.7273% passed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0.11 tests/s, 0.22 assertions/s

image

smcgregor commented 9 years ago

I don't think this is the problem, but it is still good to check: did you seed the database of the content server?

jatindhankhar commented 9 years ago

Yes I did. Also seeded the database again but still same issue, though success percentage increased a little ( 1 less error)

Started
.....E
================================================================================
Error: test_create_update_destroy(TestNew)
: NoMethodError: undefined method `click' for nil:NilClass
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:30:in `login'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:12:in `setup'
================================================================================
E
================================================================================
Error: test_create_update_destroy(TestNew)
: Capybara::ElementNotFound: Unable to find link "logout_link"
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/actions.rb:27:in `click_link'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:47:in `logout'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:79:in `teardown'
================================================================================
E
================================================================================
Error: test_creating_posts(TestNew)
: NoMethodError: undefined method `click' for nil:NilClass
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:30:in `login'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:12:in `setup'
================================================================================
E
================================================================================
Error: test_creating_posts(TestNew)
: Capybara::ElementNotFound: Unable to find link "logout_link"
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/actions.rb:27:in `click_link'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:47:in `logout'
/home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:79:in `teardown'
================================================================================
....

Finished in 84.003442748 seconds.
--------------------------------------------------------------------------------
11 tests, 23 assertions, 0 failures, 4 errors, 0 pendings, 0 omissions, 0 notifications
81.8182% passed
--------------------------------------------------------------------------------
0.13 tests/s, 0.27 assertions/s
smcgregor commented 9 years ago

What are you getting in the console for the web server while tests are running?

jatindhankhar commented 9 years ago

Everything seems normal

Started GET "/posts/user_account_data" for 127.0.0.1 at 2015-04-09 22:19:02 +0530
Processing by PostsController#user_account_data as JSON
Completed 200 OK in 10.5ms (Views: 8.0ms | ActiveRecord: 0.0ms)

Started GET "/posts/user_account_data" for 127.0.0.1 at 2015-04-09 22:19:02 +0530
Processing by PostsController#user_account_data as JSON
Completed 200 OK in 2.2ms (Views: 0.6ms | ActiveRecord: 0.0ms)

Started GET "/posts/user_account_data" for 127.0.0.1 at 2015-04-09 22:19:17 +0530
Processing by PostsController#user_account_data as JSON
Completed 200 OK in 1.6ms (Views: 0.4ms | ActiveRecord: 0.0ms)

Started GET "/posts/user_account_data" for 127.0.0.1 at 2015-04-09 22:19:18 +0530
Processing by PostsController#user_account_data as JSON
Completed 200 OK in 122.9ms (Views: 0.8ms | ActiveRecord: 0.0ms)

Started GET "/posts/user_account_data" for 127.0.0.1 at 2015-04-09 22:19:18 +0530
Processing by PostsController#user_account_data as JSON
Completed 200 OK in 1.6ms (Views: 0.4ms | ActiveRecord: 0.0ms)

Started GET "/posts/user_account_data" for 127.0.0.1 at 2015-04-09 22:19:33 +0530
Processing by PostsController#user_account_data as JSON
Completed 200 OK in 1.5ms (Views: 0.4ms | ActiveRecord: 0.0ms)

Started GET "/posts/user_account_data" for 127.0.0.1 at 2015-04-09 22:19:33 +0530
Processing by PostsController#user_account_data as JSON
Completed 200 OK in 1.6ms (Views: 0.4ms | ActiveRecord: 0.0ms)
^C[2015-04-09 22:21:41] INFO  going to shutdown ...
[2015-04-09 22:21:41] INFO  WEBrick::HTTPServer#start done.
Exiting
smcgregor commented 9 years ago

I wonder if this is because you are using ruby 2. Would it be easy for you to run Ruby 1.9.3?

jatindhankhar commented 9 years ago

Sure, installing ruby 1.9.3-p551. Will run the tests again in the morning and post the response :smile:

jatindhankhar commented 9 years ago

So managed to install the ruby 1.9.3 and updated the gems accordingly both on privly-chrome and privly-web, sauce-connect gave me a hard time, but now solved, check this issue from SauceLabs.

Anyway changing ruby version doesn't helps much other than suppressing warnings when running tests. Test still fails

Test Console Output

 You passed the arguments: {:platform=>"chrome_extension", :release_status=>"experimental", :content_server=>"http://localhost:3000"}
Skipping due to release status: ZeroBin/new.html
Run options: 

# Running tests:

....EEE....

Finished tests in 114.951039s, 0.0957 tests/s, 0.2088 assertions/s.

  1) Error:
test_twitter_injection(TestInjected):
Capybara::ExpectationNotMet: expected to find css "iframe[data-privly-display='true']" 1 time but there were no matches
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/matchers.rb:97:in `block in assert_selector'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/matchers.rb:93:in `assert_selector'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_show_injected.rb:29:in `test_twitter_injection'

  2) Error:
test_create_update_destroy(TestNew):
NoMethodError: undefined method `click' for nil:NilClass
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:30:in `login'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:12:in `setup'

  3) Error:
test_create_update_destroy(TestNew):
Capybara::ElementNotFound: Unable to find link "logout_link"
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/actions.rb:27:in `click_link'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:47:in `logout'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:79:in `teardown'

  4) Error:
test_creating_posts(TestNew):
Capybara::ElementNotFound: Unable to find field "content"
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/actions.rb:56:in `fill_in'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:22:in `block in test_creating_posts'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:17:in `each'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:17:in `test_creating_posts'

  5) Error:
test_creating_posts(TestNew):
Capybara::ElementNotFound: Unable to find link "logout_link"
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/actions.rb:27:in `click_link'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:47:in `logout'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:79:in `teardown'

11 tests, 24 assertions, 0 failures, 5 errors, 0 skips

Server Console Log

Started GET "/posts/user_account_data" for 127.0.0.1 at 2015-04-10 11:00:19 +0530
Processing by PostsController#user_account_data as JSON
Completed 200 OK in 1.9ms (Views: 0.4ms | ActiveRecord: 0.0ms)

Started GET "/posts/user_account_data" for 127.0.0.1 at 2015-04-10 11:00:20 +0530
Processing by PostsController#user_account_data as JSON
Completed 200 OK in 1.3ms (Views: 0.3ms | ActiveRecord: 0.0ms)

Started GET "/posts/user_account_data" for 127.0.0.1 at 2015-04-10 11:00:35 +0530
Processing by PostsController#user_account_data as JSON
Completed 200 OK in 1.0ms (Views: 0.3ms | ActiveRecord: 0.0ms)

Started GET "/posts/user_account_data" for 127.0.0.1 at 2015-04-10 11:00:35 +0530
Processing by PostsController#user_account_data as JSON
Completed 200 OK in 1.4ms (Views: 0.4ms | ActiveRecord: 0.0ms)
[2015-04-10 11:00:35] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true

Started GET "/posts/user_account_data" for 127.0.0.1 at 2015-04-10 11:00:35 +0530
Processing by PostsController#user_account_data as JSON
Completed 200 OK in 0.8ms (Views: 0.2ms | ActiveRecord: 0.0ms)
[2015-04-10 11:00:35] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true

Started POST "/users/sign_in" for 127.0.0.1 at 2015-04-10 11:00:36 +0530
Processing by SessionsController#create as JSON
  Parameters: {"user"=>{"email"=>"development@priv.ly", "password"=>"[FILTERED]"}}
  User Load (0.4ms)  SELECT "users".* FROM "users" WHERE "users"."email" = 'development@priv.ly' LIMIT 1
   (0.1ms)  begin transaction
   (4.4ms)  UPDATE "users" SET "last_sign_in_at" = '2015-04-10 05:30:37.021785', "current_sign_in_at" = '2015-04-10 05:30:37.021785', "last_sign_in_ip" = '127.0.0.1', "current_sign_in_ip" = '127.0.0.1', "sign_in_count" = 1, "updated_at" = '2015-04-10 05:30:37.024419' WHERE "users"."id" = 1
   (129.9ms)  commit transaction
  User Load (0.4ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
Completed 200 OK in 432.8ms (Views: 0.4ms | ActiveRecord: 136.4ms)

Started GET "/posts/user_account_data" for 127.0.0.1 at 2015-04-10 11:00:37 +0530
Processing by PostsController#user_account_data as JSON
Completed 200 OK in 1.5ms (Views: 0.3ms | ActiveRecord: 0.0ms)

Started GET "/posts/user_account_data" for 127.0.0.1 at 2015-04-10 11:00:37 +0530
Processing by PostsController#user_account_data as JSON
Completed 200 OK in 1.0ms (Views: 0.3ms | ActiveRecord: 0.0ms)
[2015-04-10 11:00:37] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true

Started GET "/posts/user_account_data" for 127.0.0.1 at 2015-04-10 11:00:52 +0530
Processing by PostsController#user_account_data as JSON
Completed 200 OK in 11.0ms (Views: 2.1ms | ActiveRecord: 0.0ms)

Started GET "/posts/user_account_data" for 127.0.0.1 at 2015-04-10 11:01:07 +0530
Processing by PostsController#user_account_data as JSON
Completed 200 OK in 1.2ms (Views: 0.3ms | ActiveRecord: 0.0ms)

Started GET "/posts/user_account_data" for 127.0.0.1 at 2015-04-10 11:01:08 +0530
Processing by PostsController#user_account_data as JSON
Completed 200 OK in 4.4ms (Views: 3.7ms | ActiveRecord: 0.0ms)
^C[2015-04-10 11:06:10] INFO  going to shutdown ...
[2015-04-10 11:06:10] INFO  WEBrick::HTTPServer#start done.
Exiting
smcgregor commented 9 years ago

Let's see if these should be passing. Change this line so that it has a high timeout. Then, while your tests are running, the browser should hang at whatever point the tests are failing while it searches for the element. Examine the state of the web page to see if the element is present and the test is not picking it up.

jatindhankhar commented 9 years ago

So I tried to run the tests again, and set the timeout field high enough so that it gives enough time for inspection but Inspect element is broken in selenium drived chrome :disappointed:

Anyway there are no failures only 4 errors and most of them are appearing in the tc_new.rb file and this have something to do with the login mechanism of the auth_helper.rb as all the 4 errors have common complaints like Unable to find "logout link" Unable to find field "content"

Error logs

  1) Error:
test_create_update_destroy(TestNew):
Capybara::ElementNotFound: Unable to find field "content"
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/actions.rb:56:in `fill_in'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:46:in `block in test_create_update_destroy'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:32:in `each'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:32:in `test_create_update_destroy'

  2) Error:
test_create_update_destroy(TestNew):
Capybara::ElementNotFound: Unable to find link "logout_link"
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/actions.rb:27:in `click_link'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:47:in `logout'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:79:in `teardown'

  3) Error:
test_creating_posts(TestNew):
Capybara::ElementNotFound: Unable to find field "content"
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/actions.rb:56:in `fill_in'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:22:in `block in test_creating_posts'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:17:in `each'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:17:in `test_creating_posts'

  4) Error:
test_creating_posts(TestNew):
Capybara::ElementNotFound: Unable to find link "logout_link"
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/actions.rb:27:in `click_link'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:47:in `logout'
    /home/jatin/Area_51/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:79:in `teardown'
smcgregor commented 9 years ago

I tested on all platforms and got everything to pass. I also refactored everything substantially in this PR. It might be worth pulling those changes and testing. This still passes on SauceLabs?

jatindhankhar commented 9 years ago

So I pulled down changes recursively using git submodule foreach git pull and test success percentage got down. So I deleted the local repos, re-cloned them recursively, switched to ruby 2.0 and test coverage came close to 100% for all.

Summary

Chrome Web

Finished in 16.593785365 seconds.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
11 tests, 12 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Chrome Extension 1 error :disappointed: for ruby 2.0

......E
========================================================================================================================================================================
Error: test_creating_posts(TestNew)
:
  Selenium::WebDriver::Error::UnknownError: unknown error: jQuery is not defined
    (Session info: chrome=41.0.2272.118)
    (Driver info: chromedriver=2.15.322448 (52179c1b310fec1797c81ea9a20326839860b7d3),platform=Linux 3.13.0-37-generic x86_64)
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.45.0/lib/selenium/webdriver/remote/response.rb:52:in `assert_ok'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.45.0/lib/selenium/webdriver/remote/response.rb:15:in `initialize'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.45.0/lib/selenium/webdriver/remote/http/common.rb:59:in `new'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.45.0/lib/selenium/webdriver/remote/http/common.rb:59:in `create_response'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.45.0/lib/selenium/webdriver/remote/http/default.rb:66:in `request'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.45.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.45.0/lib/selenium/webdriver/remote/bridge.rb:640:in `raw_execute'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.45.0/lib/selenium/webdriver/remote/bridge.rb:618:in `execute'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.45.0/lib/selenium/webdriver/remote/bridge.rb:339:in `executeScript'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/selenium-webdriver-2.45.0/lib/selenium/webdriver/common/driver.rb:193:in `execute_script'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/selenium/driver.rb:84:in `evaluate_script'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/session.rb:527:in `evaluate_script'
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:40:in `block in login'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/2.0.0/timeout.rb:66:in `timeout'
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:39:in `login'
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:12:in `setup'
========================================================================================================================================================================
....

Finished in 54.441506785 seconds.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
11 tests, 31 assertions, 0 failures, 1 errors, 0 pendings, 0 omissions, 0 notifications
90.9091% passed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Chrome Extension 100 % for ruby 1.9.3 :smile:

...........

Finished tests in 61.016187s, 0.1803 tests/s, 0.5408 assertions/s.

11 tests, 33 assertions, 0 failures, 0 errors, 0 skips

Sauce Chrome Web (Ruby 1.9.3)

.....EE....

Finished tests in 95.086163s, 0.1157 tests/s, 0.0210 assertions/s.

  1) Failure:
test_create_update_destroy(TestNew) [/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:13]:
Failed assertion, no message given.

  2) Error:
test_create_update_destroy(TestNew):
Capybara::ElementNotFound: Unable to find link "logout_link"
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/actions.rb:27:in `click_link'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
    /home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:47:in `logout'
    /home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:79:in `teardown'

  3) Failure:
test_creating_posts(TestNew) [/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:13]:
Failed assertion, no message given.

  4) Error:
test_creating_posts(TestNew):
Capybara::ElementNotFound: Unable to find link "logout_link"
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/node/actions.rb:27:in `click_link'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
    /home/jatin/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
    /home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:47:in `logout'
    /home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:79:in `teardown'

11 tests, 2 assertions, 2 failures, 2 errors, 0 skips

Sauce Chrome Web (Ruby 2.0.0) Same for ruby 1.9.3

Failure: <false> is not true.
test_create_update_destroy(TestNew)
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:13:in `login'
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:12:in `setup'
========================================================================================================================================================================
E
========================================================================================================================================================================
Error: test_create_update_destroy(TestNew)
: Capybara::ElementNotFound: Unable to find link "logout_link"
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/actions.rb:27:in `click_link'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:47:in `logout'
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:79:in `teardown'
========================================================================================================================================================================
F
========================================================================================================================================================================
Failure: <false> is not true.
test_creating_posts(TestNew)
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:13:in `login'
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:12:in `setup'
========================================================================================================================================================================
E
========================================================================================================================================================================
Error: test_creating_posts(TestNew)
: Capybara::ElementNotFound: Unable to find link "logout_link"
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/actions.rb:27:in `click_link'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:47:in `logout'
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:79:in `teardown'
========================================================================================================================================================================
....

Finished in 90.15329872 seconds.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
11 tests, 2 assertions, 2 failures, 2 errors, 0 pendings, 0 omissions, 0 notifications
81.8182% passed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0.12 tests/s, 0.02 assertions/s

Ruby versions don't make a difference on Sauce infrastrcture

Sauce Chrome Extension (Ruby 2.0.0)

.....F
========================================================================================================================================================================
Failure: <false> is not true.
test_create_update_destroy(TestNew)
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:33:in `login'
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:12:in `setup'
========================================================================================================================================================================
E
========================================================================================================================================================================
Error: test_create_update_destroy(TestNew)
: Capybara::ElementNotFound: Unable to find link "logout_link"
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/actions.rb:27:in `click_link'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:47:in `logout'
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:79:in `teardown'
========================================================================================================================================================================
F
========================================================================================================================================================================
Failure: <false> is not true.
test_creating_posts(TestNew)
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:33:in `login'
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:12:in `setup'
========================================================================================================================================================================
E
========================================================================================================================================================================
Error: test_creating_posts(TestNew)
: Capybara::ElementNotFound: Unable to find link "logout_link"
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:41:in `block in find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/base.rb:84:in `synchronize'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/finders.rb:30:in `find'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/node/actions.rb:27:in `click_link'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/session.rb:676:in `block (2 levels) in <class:Session>'
/home/jatin/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:DSL>'
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/auth_helper.rb:47:in `logout'
/home/jatin/Area_51/Privly/privly-chrome/privly-applications/test/selenium/specs/tc_new.rb:79:in `teardown'
========================================================================================================================================================================
....            

Finished in 375.713418375 seconds.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
11 tests, 17 assertions, 2 failures, 2 errors, 0 pendings, 0 omissions, 0 notifications
81.8182% passed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0.03 tests/s, 0.05 assertions/s

Firefox Issue Although I am not a firefox user but Privly is not secure according to firefox, works fine on Chrome and Vivaldi though

screenshot from 2015-04-14 19 33 31

smcgregor commented 9 years ago
jatindhankhar commented 9 years ago

Facing the same error for both priv.ly and www.priv.ly


image


image

See Issue no #38 on privly-organization for more insight

smcgregor commented 9 years ago

I am closing this because I think both issues have now been resolved. Feel free to comment or reopen if this is not the case.