Live server tests from cron
I have some tests that use LiveServerTestCase and selenium. When I run
them from the command line they work fine. But I want to run them from
cron. I know I need to use pyvirtualdisplay, but I can't seem to get
it to work.
I have this in my test:
from pyvirtualdisplay import Display
@classmethod
def setUpClass(cls):
#initialize HIDDEN display
display = Display(visible=0, size=(800, 600))
display.start()
cls.selenium = WebDriver()
super(EventsTableTestLive, cls).setUpClass()
But it fails with:
WebDriverException: Message: 'The browser appears to have exited
before we could connect. The output was: Error: cannot open display:
:1024\n'
Where the display number is different each time. Googling this, I saw
that I needed to add something like this to the script I run from cron
that invokes the tests:
export DISPLAY=:0.0
xhost +
But that seems to have had no effect at all. This question seems to
have been asked a lot, but none of the answers I saw on SO or other
sites worked for me (none of them were using django).
Anyone here run LiveServerTestCase selenium tests from cron?
Thanks!
-larry
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home