awatson1978 / clinical-nightwatch

Ultra-easy acceptance testing for your Meteor app with Selenium and Nightwatch.
21 stars 3 forks source link

Cannot run example with Firefox 33 on Ubuntu #1

Closed numtel closed 9 years ago

numtel commented 10 years ago

I'm trying to get the package running with the example tests from the readme. I was confused on first impression that sudo was required to run the tests. That helped and was able to get an instance of firefox to pop up with the included selenium 2.42.0 jar but no tests ran. It looks like the latest 2.44.0 must be installed for Firefox 33 support so I downloaded the jar and updated the package.js, nightwatch_from_app_root.json and launch_nightwatch_from_app_root.sh (displayed below)

#!/bin//bash
# run this file from your application's root directory

echo "changing file permissions"
chmod +x .meteor/local/build/programs/server/assets/packages/clinical_nightwatch/launch_nightwatch*.sh
chmod +x .meteor/local/build/programs/server/assets/packages/clinical_nightwatch/selenium/selenium-server-standalone-2.44.0.jar

echo "installing nightwatch in .meteor/local/build"
  cd .meteor/local/build
  npm install nightwatch@0.5.3
  cd ../../..

echo "running nightwatch"
   .meteor/local/build/node_modules/nightwatch/bin/nightwatch -c .meteor/local/build/programs/server/assets/packages/clinical_nightwatch/nightwatch_from_app_root.json $1 $2

Now it hangs trying to start selenium:

$ ./run_nightwatch.sh --verbose
changing file permissions
installing nightwatch in .meteor/local/build
nightwatch@0.5.3 node_modules/nightwatch
├── mkpath@0.1.0
├── ejs@1.0.0
├── minimatch@0.2.14 (sigmund@1.0.0, lru-cache@2.5.0)
└── optimist@0.6.1 (minimist@0.0.10, wordwrap@0.0.2)
running nightwatch
Starting selenium server... 

Have you had any luck running with firefox 33 / selenium 2.44.0?

Looks like the jar works fine:

$ java -jar .meteor/local/build/programs/server/assets/packages/clinical_nightwatch/selenium/selenium-server-standalone-2.44.0.jar 
16:47:45.772 INFO - Launching a standalone server
16:47:45.949 INFO - Java: Oracle Corporation 24.65-b04
16:47:45.950 INFO - OS: Linux 3.13.0-39-generic amd64
16:47:46.027 INFO - v2.44.0, with Core v2.44.0. Built from revision 76d78cf
16:47:46.264 INFO - Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match with current platform: LINUX
16:47:46.495 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
16:47:46.497 INFO - Version Jetty/5.1.x
16:47:46.498 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
16:47:46.499 INFO - Started HttpContext[/selenium-server,/selenium-server]
16:47:46.500 INFO - Started HttpContext[/,/]
16:47:46.631 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@22729305
16:47:46.632 INFO - Started HttpContext[/wd,/wd]
16:47:46.649 INFO - Started SocketListener on 0.0.0.0:4444
16:47:46.650 INFO - Started org.openqa.jetty.jetty.Server@52675236

Nightwatch does throw an error if the port is occupied:

$ ./run_nightwatch.sh --verbose
changing file permissions
installing nightwatch in .meteor/local/build
nightwatch@0.5.3 node_modules/nightwatch
├── mkpath@0.1.0
├── ejs@1.0.0
├── minimatch@0.2.14 (sigmund@1.0.0, lru-cache@2.5.0)
└── optimist@0.6.1 (minimist@0.0.10, wordwrap@0.0.2)
running nightwatch
Starting selenium server... ERROR There was an error while starting the Selenium server:
16:52:15.416 INFO - Launching a standalone server
Setting system property webdriver.chrome.driver to selenium/chromedriver
16:52:15.617 INFO - Java: Oracle Corporation 24.65-b04
16:52:15.617 INFO - OS: Linux 3.13.0-39-generic amd64
16:52:15.653 INFO - v2.44.0, with Core v2.44.0. Built from revision 76d78cf
16:52:15.808 INFO - Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match with current platform: LINUX
16:52:16.030 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
16:52:16.032 INFO - Version Jetty/5.1.x
16:52:16.033 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
16:52:16.035 INFO - Started HttpContext[/selenium-server,/selenium-server]
16:52:16.035 INFO - Started HttpContext[/,/]
16:52:16.164 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@22729305
16:52:16.165 INFO - Started HttpContext[/wd,/wd]
16:52:16.195 WARN - Failed to start: SocketListener0@0.0.0.0:4444
Exception in thread "main" java.net.BindException: Selenium is already running on port 4444. Or some other service is.
    at org.openqa.selenium.server.SeleniumServer.start(SeleniumServer.java:491)
    at org.openqa.selenium.server.SeleniumServer.boot(SeleniumServer.java:300)
    at org.openqa.selenium.server.SeleniumServer.main(SeleniumServer.java:245)
    at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:97)
jakobmm18 commented 9 years ago

I have similar problem in Ubunutu with Firefox.

istals commented 9 years ago

I suggest temporary fix to downgrade firefox to version 31. I had the same issue with firefox 33 and i found out that version 33 don't have extension webDriver

awatson1978 commented 9 years ago

Hmmm. I haven't seen those errors, but I'm getting ready to do some maintenance on the package and try to see if it will finally integrate with velocity. I'll see about upgrading the core libraries....

awatson1978 commented 9 years ago

Confirmed that there is a conflict between Nightwatch 0.5.3 and Firefox 33 through 35. Updated documentation to specify which version of Firefox to use. Please use Firefox 31.