Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vincent Lu's set up: Pusher Errors, Websocket error, and 16 failed tests #463

Open
VincentLu91 opened this issue Dec 17, 2016 · 7 comments

Comments

@VincentLu91
Copy link

I attempted twice in completing the set up, however I'm seeing errors and 16 failed tests.

The output's too long, but here I'll include the failing scenarios:

Failing Scenarios:
cucumber features/agency_admin.feature:304 # Scenario: update job specialty
cucumber features/agency_admin.feature:366 # Scenario: update job skill
cucumber features/event_management.feature:35 # Scenario: Job Seeker registers in PETS
cucumber features/event_management.feature:65 # Scenario: Company registration request in PETS
cucumber features/event_management.feature:115 # Scenario: Job developer assigned to job seeker by agency admin
cucumber features/event_management.feature:154 # Scenario: Case manager assigned to job seeker by agency admin
cucumber features/event_management.feature:193 # Scenario: Job developer assigns self to job seeker
cucumber features/event_management.feature:218 # Scenario: Case manager assigns self to job seeker
cucumber features/job_application.feature:49 # Scenario: Job seeker applies to job
cucumber features/job_application_by_jd.feature:46 # Scenario: Successful application for his job seeker
cucumber features/job_seeker.feature:117 # Scenario: job seeker finds new job opportunities
cucumber features/jobs.feature:38 # Scenario: Creating, Updating, and Deleting Job successfully and unsuccessfully
cucumber features/jobs.feature:90 # Scenario: Creating and Updating Job successfully and unsuccessfully
cucumber features/match_job_and_resume.feature:89 # Scenario: Match job to job seekers
cucumber features/reject_job_application.feature:45 # Scenario: company contact reject a job application
cucumber features/reject_job_application.feature:78 # Scenario: job developer reject notification when job application rejected

@VincentLu91
Copy link
Author

MetPlus_output.txt

@patmbolger
Copy link
Contributor

patmbolger commented Dec 17, 2016

  1. The error:
unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055) (Selenium::WebDriver::Error::WebDriverError)

might be due to not using the correct version of firefox. Please confirm your version. On OS X (mac) you can check via:

/Applications/Firefox.app/Contents/MacOS/firefox -v

This should return

Mozilla Firefox 46.0.1

If you're not using that version, the setup instructions describe how to get that version.

  1. You're seeing some errors that occur right after a "wait" step, e.g.:
And I click the "Update Specialty" button                   # features/step_definitions/web_steps.rb:131
    And I wait 1 second                                         # features/step_definitions/web_steps.rb:77
    And I should see "Description can't be blank"               # features/step_definitions/web_steps.rb:18
      expected to find text "Description can't be blank" in "MetPlus MET|PLUS Home Jobs About Contact Admin Agency and Partner Companies Job Properties Hello, John Log out PETS Administration - Job Properties Job Specialties Name Description Delete Software Engineer - RoR Develop website using Ruby on Rails Hide Job Specialties Add Job Specialty Job Skills Name Description Delete Visual Analysis Incidunt aut magni perferendis atque qui dolor. Web Research Hic deleniti explicabo inventore delectus veritatis mollitia. (in use) Hide Job Skills Add Job Skill × Add Job Specialty Name: Description: Cancel Add Specialty × Update Job Specialty Name: Description: Cancel Update Specialty × Add Job Skill Name: Description: Cancel Add Skill × Update Job Skill Name: Description: Cancel Update Skill For employers: Partner with Us ® MetPlus 2016 $(document).ready(function(){$('[data-toggle=\"tooltip\"]').tooltip(); });" (RSpec::Expectations::ExpectationNotMetError)
      features/agency_admin.feature:311:in `And I should see "Description can't be blank"'

We've had to introduce waits after certain steps since sometimes 1) the actual step method we are using is not waiting for the appearance of an element, or, 2) the step involves a round-trip to the controller via AJAX (like this particular step And I click the "Update Specialty" button) or to an external service.

I suggest you experiment with increasing the wait duration (by 1 second increments) and see if that solves these issues.

  1. You are seeing a lot a failures when the test involves changing from one user's browser to another user's (such as in event_management.feature), e.g.:
And "[email protected]" should receive an email with subject "Job seeker registered"            # features/step_definitions/email_steps.rb:58
    And "[email protected]" should receive an email with subject "Job seeker registered"          # features/step_definitions/email_steps.rb:58
    Then I am in Admin's browser                                                                 # features/step_definitions/web_steps.rb:232
    And I should see "Job Seeker: Paula Jones has joined PETS."                                  # features/step_definitions/web_steps.rb:18
      expected to find text "Job Seeker: Paula Jones has joined PETS." in "MetPlus MET|PLUS Home Jobs About Contact Admin Agency and Partner Companies Job Properties Hello, John Log out Signed in successfully. × Welcome back to PETS, John Smith Unassigned Agency Tasks Your Open Tasks All Agency Open Tasks All Agency Closed Tasks No outstanding tasks $(document).ready( function() { TaskManagerHolder('tasks-agency-new', 'agency-new') } ); × Assign user Select the user to assign the task to: Cancel Assign No outstanding tasks $(document).ready( function() { TaskManagerHolder('tasks-mine-open', 'mine-open') } ); No outstanding tasks $(document).ready( function() { TaskManagerHolder('tasks-agency-all', 'agency-all') } ); No outstanding tasks $(document).ready( function() { TaskManagerHolder('tasks-agency-closed', 'agency-closed') } ); For employers: Partner with Us ® MetPlus 2016 $(document).ready(function(){$('[data-toggle=\"tooltip\"]').tooltip(); });" (RSpec::Expectations::ExpectationNotMetError)
      features/event_management.feature:59:in `And I should see "Job Seeker: Paula Jones has joined PETS."'

Here, I suggest putting a wait step immediately after changing to a different browser (start with 1 second) and see if that helps. The browser needs to time to render itself and also to receive a notification message from Pusher (that the test is looking for).

  1. You are getting some intermittent pusher timeout errors:
Pusher : Error : {"type":"WebSocketError","error":{"type":"PusherError","data":{"code":1006,"message":"Connection interrupted (0)"}}}

Pusher.com is a SAAS site that we use to send event notifications to the browser. I have not seen those timeouts before, so not sure at this point how to address them. If they persist we can have a PP session and I can watch the pusher debug console and see if we can figure this out.

Also, this article: https://support.pusher.com/hc/en-us/articles/204202193-What-is-meant-by-Error-1006- says that this is sometimes caused by being behind a proxy that is not compliant with the WebSocket protocol.

@VincentLu91
Copy link
Author

Hi Patrick,

I'm looking to tackle 1, 2, and 3 for now and I'll move on to the 4).

For 1), I had attempted to follow the instructions but I'm not sure what I missed. I opened my .bashrc, and set the environment variable to the directory that includes the firefox.exe. What I did was I downloaded the zip file, unzipped the zip file, and moved the entire firefox 46x folder to my User directory. I then set the variable to the path:
export FIREFOX_BINARY_PATH="/Vincent/firefox"

I actually have the Firefox application as the current version as well as the firefox folder that I unzipped. However, I went to my current Firefox application and disabled automatic search for updates, as you indicated. But in order for the test to work, do I need to uninstall my current version of Firefox?

I also tried opening the firefox executable in the firefox 46 directory. However it only opened the terminal and gives the output:

`/Users/Vincent/firefox/firefox ; exit;
Vincents-MacBook-Pro:~ Vincent$ /Users/Vincent/firefox/firefox ; exit;
-bash: /Users/Vincent/firefox/firefox: cannot execute binary file
logout

[Process completed]`

For 2) and 3), how do I increase the wait duration/step? Is there a command for me to do this?

@patmbolger
Copy link
Contributor

Hi Vincent,

If your default FF version (in /Applications/Firefox.app/ directory) is already 46 then you don't need to install a 2nd FF anywhere. Unset the ENV FIREFOX_BINARY_PATH and the tests will then use the default FF.

Also, I updated the wiki doc to clarify that FIREFOX_BINARY_PATH is the absolute path the to executable, not the path to the directory containing the executable. (this is not an issue for you since you'll use the default FF anyway).

As far as increasing wait times - if there is already a step for wait, e.g.,

And I wait 1 second

then you can just increment the count, that is:

And I wait 2 seconds

If there is not a wait, and you think you need one, just add a wait step ala above.

@VincentLu91
Copy link
Author

MetPlusOutputDec26.txt

There are 12 failing scenarios. In this case, do they still relate to adjusting the wait steps? The good news is, the Firefox works now and I'm able to see Selenium tests pass

@patmbolger
Copy link
Contributor

Yes, it looks like those are all (or mostly) caused by not having a wait (or insufficient wait time).

I recommend creating a new branch and adjusting/adding waits in that branch. Once we get it working we can create a pull request using that branch so that the adjustments get merged into the codebase.

@VincentLu91
Copy link
Author

In this case, how do I know where to adjust the wait time? Do I go to a piece of source code and change the value of a variable? I looked through the test output and found where failures come from, but from the steps.rb files I haven't been able to derive a clue as to where I could adjust the wait? Could appreciate some guidance here!

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

No branches or pull requests

2 participants