LionsAd / drupal_ti

Drupal - Travis Integration
82 stars 37 forks source link

PhantomJS #35

Closed Decipher closed 9 years ago

Decipher commented 9 years ago

Hi Fabian,

Hopefully you can help me out with something. In epically large amount of test commits based repo, http://github.com/Decipher/test, I'm trying to get some behat tests for my Wysiwyg Fields module sorted out.

The tests work on my local machine with both selenium/firefox and with phantomjs, but no matter what I do, I can't get them to work on Travis.

The major complexity is that they are CKEditor dialog based tests, which requires timing. I have take two approaches, both which work locally, one using the DrupalExtension 'wait for AJAX' step, and the current with a custom 'wait till :element visible' approach. The first approach just failed outright on Travis, whereas the current just sits there until I kill the test (as it's a loop with no timeout).

If there's anything you can think of I would greatly appreciate it.

LionsAd commented 9 years ago

Yes, I had problems on container infra with timing and popup related tests too.

The first thing to do is to enable debug output:

Uncomment

    #- DRUPAL_TI_DEBUG_FILE_OUTPUT="xvfb selenium webserver"

and make it say:

    - DRUPAL_TI_DEBUG_FILE_OUTPUT="xvfb selenium webserver"

Then you will get way more information from selenium / phantomjs why something fails :).

LionsAd commented 9 years ago

I am also investigating if switching to sudo: false fixes that, so that might be worth a try.

I had opened an upstream issue in DrupalDriver, but they seem to be of the thought that it is a "won't fix".

My current experiments can be seen here:

https://travis-ci.org/LionsAd/panopoly/builds

Decipher commented 9 years ago

Thanks for your response. What I gathered by looking at your panopoly tests was that there shouldn't be any reason why mine didn't work, so I did a bit more digging and it turned out that my enabling of the test module wasn't working properly locally.

Simple addition of 'drupal_flush_all_caches()' resolved the problem.

Now to write a suite of tests.

Thanks again.