ruby - How to run rspec tests using selenium through cron -
I'm having trouble running RSPEC test through cron I have a page in which to access Firefox and Test logging I am using All my files work properly when executed outside the cron. From what I've read, the problem may be that cron needs a display environment to run programs like Firefox. This is where I am stuck, how can I establish a demonstration environment for Selenium so that Firefox can start from the Kronos.
I have tried to set some ways in the cronnet to display. I have also tried to set it in script .. error messages that I keep on I am thinking that there is a way to change Selenium's code to run Firefox with a specified display. Or if I have missed something on the way. Any help will be very much appreciated. You must first start Xvfb, I recommend that you use the gem with Xvfb Simplifies the conversation Also, take a look at the readme, it has similar use cases. Also take a look at the establishment of Jenkins and Headless. PS: Do not use a single suggestion - cron for such purpose, use the CI tool. I recommend that this SCM can be made both by voting and from time to time (in the case of your exact use). * / 25 * * * * /home/justin/test.sh --display =: 0 & gt; Testlog * / 25 * * * * DISPLAY =: 0; /home/justin/test.sh> Testlog;
#! / Bin / sh cd / home / justin / widget_ui_testing / DISPLAY =: 0 /home/justin/.rvm/bin/rvm exec /home/justin/.rvm/gems/ruby-1.9.2-p290/bin/rspec- Fdoc / home / justin / widget_ui_testing / spec / requests / log_in_spec.rb
selenium :: WebDrive :: error :: WebDriver error: Unable to get stable Firefox connection in 60 seconds (127.0.0.1: 7055) # ./spec/requests/log_in_spec.rb:22:in 'in block (2 level) & lt; Top (required) & gt;
Comments
Post a Comment