Closed datakurre closed 11 years ago
I'll give that a try
Basically this is possible...
I added a new section into buildout (this is already configured in master/buildout.cfg
file of plone.act
)
[buildout]
...
parts =
...
pybot
[pybot]
recipe = zc.recipe.egg
eggs =
plone.act [test]
robotentrypoints
initialization =
import os
os.environ.setdefault("ZSERVER_PORT", "8080")
os.environ.setdefault("PLONE_SITE_ID", "Plone")
os.environ.setdefault("SITE_OWNER_NAME", "admin")
os.environ.setdefault("SITE_OWNER_PASSWORD", "admin")
variables.py
to load SITE_OWNER_NAME and SITE_OWNER_PASSWORD from environment.bin/pybot --argumentfile src/plone.act/.../keywords.txt --include [tag] [testfile]
RIDE's configuration Skip tests with these tags and Only run tests with these tags did not work for me, but you can add --include
or --exclude
as arguments for custom script.
I believe, if we could configure working --listener parameter for the pybot calls in RIDE, our act_server would make RIDE really usable:
@saily I've been struggling to build wxPython in buildout to get a buildout with RIDE. If we'd manage to do that, then with act_server (or robot-server in p.a.robotframework) we would have complete RIDE support.
These steps will build wxPython for OSX, but there's still something missing...
[wxPython-post-make-hook]
recipe = collective.recipe.template
input = inline:
import os
import sys
import subprocess
wxpython_post_make_hook = lambda o, b:\
subprocess.call([sys.executable, 'setup.py',\
'WX_CONFIG=%s' % os.path.join(o['location'], 'bin', 'wx-config'),\
'WXPORT=osx_cocoa', 'CORE_ONLY=1', 'install', '--home=%s' %\
o['location'],], cwd=os.path.join(os.getcwd(), 'wxPython'))
output = ${buildout:parts-directory}/hooks.py
[wxPython]
# Thanks to: http://geekscrap.com/2010/01/install-wxpython-in-buildout/
recipe = hexagonit.recipe.cmmi
url = http://downloads.sourceforge.net/wxpython/wxPython-src-2.9.4.0.tar.bz2
post-make-hook = ${buildout:parts-directory}/hooks.py:wxpython_post_make_hook
keep-compile-dir = true
configure-options =
--enable-optimise
--enable-display
--enable-geometry
--with-libjpeg=builtin
--with-libpng=builtin
--with-libtiff=builtin
--with-zlib=builtin
# OSX:
--enable-framework
--with-osx_cocoa
# Linux:
# --with-gtk2
hi, thanks for sharing this! We should target wxPython 2.8 because RIDE crashes with an segmentation fault on 2.9. see: http://code.google.com/p/robotframework-ride/issues/detail?id=888 Try to figure out what else we need.
Oh, I missed that one. Many options will look different for 2.8 build, because cocoa vs. carbon.
The missing thing is this:
This program needs access to the screen.
Please run with a Framework build of python, and only when you are
logged in on the main display of your Mac.
I'm not sure if there's any way to get wxPython working without installing it as "system python", but I still wish that there is a way.
The alternative for getting nice RIDE experience is to install all required robot libraries into system wide wxPython installation and I really wish that there's a better approach.
The optimal would be a buildout that would create ride.py with sys.path including both wxPython and buildout paths (p.a.testing, robot libraries and develop products, etc...).
Too bad, 2.8 cannot be built for current OSX version without installing an old Xcode version. For example: https://trac.macports.org/ticket/37215
I think, that's no go for that approach.
The next best thing would be to hack virtualenv with wxPython...
I still would like to get RIDE started with buildout-generated sys.paths to make it easier to use custom libraries with it.
Of course, 2.8 won't work on 64bit OSX environment... (Why has this be this hard :P)
hmm, what about posting that on ride googlecode page and find a voluntary helping us... for someone who's into ride's code it shouldn't be too hard implementing wxPython 2.9 support.
2.9 support is already work in progress: http://code.google.com/p/robotframework-ride/issues/detail?id=888#c22
Done (in p.a.robotframework). https://github.com/plone/plone.app.robotframework/blob/master/buildout-ride.cfg
@saily
The key is to set the RIDE startup script to use system python to give wx-libraries access to display and all magic they need (at least on OSX).
https://github.com/plone/plone.app.robotframework/blob/master/buildout-ride.cfg
At the end you should have bin/ride-script with both wx-libraries and buildout eggs available.
And finally, how to run tests with RIDE and p.a.robotframework:
bin/robot-server my.product.testing.ROBOT_TESTING
bin/ride
bin/robot
from the buildoutWhy bin/robot
instead of pybot? Because bin/robot
is a shortcut for pybot with --listener plone.app.robotframework.RobotListener
and that enables plone(.app).testing
's test isolation with bin/robot-server
.
It's even possible to use RIDE to run Plone-tests at SauceLabs (just tried that out), but that might need a little more documentation :)
Good job!
RIDE is visual Robot Framework IDE for writing and running robot tests.
Currently, it's not very pretty and it's a bit hard to get installed (requires wxPython). Yet, eventually it might ease writing test, because it should help to discover the existing keywords (and their documentation).
I didn't yet manage to get RIDE configured to discover selenium2library and plone.act -keywords from a buildout, but I understood, that there were options for setting python-paths and custom robot-script to make everything possible.
Currently, you cannot pass a custom configuration file for RIDE.
Yet, we could have a conditional buildout-part, which creates a RIDE-configuration file with buildout-eggs in python paths and executes pybot from our buildout. Or maybe even install ride under buildout?
Would @saily be interested trying this out?
What I'm trying to achieve is that, a new developer could just
Of course, not sure, if that will work. Just looking for options where one could try plone.act without need to create plone.app.testing-layer, wrapper test suites etc. before writing any tests. (Yes, I've been trying to listen to the criticism about robotsuite/zope.testrunner-approach.)