laurentj / slimerjs

A scriptable browser like PhantomJS, based on Firefox
http://slimerjs.org
Other
3k stars 259 forks source link

When using ghostdriver to use slimerjs I'm getting aborted request #377

Open jboffel opened 9 years ago

jboffel commented 9 years ago

So a bug I identified in the 0.10.0pre is if you run a test which open a webpage, if you don't wait for slimerjs with a pause in the test program that it finish to process the request, slimerjs will cancel the first request to treat the new one.

Test software                               Slimerjs 
Call slimerjs                       =>      slimerjs ask to open the wepage
Wait for slimerjs                 =>      return instantly OK to the test software (but should be pending for the request to be finished)
Call slimerjs on new page  =>      Cancel first request and start the new one

On the other hand this scenario works well then:

Test software                               Slimerjs  
Call slimerjs                       =>      slimerjs ask to open the wepage
Wait for slimerjs                 =>      return instantly OK to the test software (but should be pending for the request to be finished)
Sleep 20s                           =>      Enough time to complete the request
Call slimerjs on new page  =>      slimerjs ask to open the wepage
laurentj commented 8 years ago

please provide a minimal test case

jboffel commented 8 years ago

Well I was using it through a BDD like cucumber or behat and I was simply using a test case where I was doing: When I visit "anyUrl" <= this one was returning ok before the page is actually completely loaded And I press on "submit" <= this one was working or not depend how much of the page has been loaded before this request was sent to ghost driver Then I visit "anyOtherUrl" <= this call was killing the unfinished load of the first visited page

laurentj commented 8 years ago

Ok, you're using --webdriver right?

jboffel commented 8 years ago

Yes I was using the --webdriver support.