[Product-Developers] Re: Selenium tests

Balazs Ree ree at ree.hu
Tue May 27 09:44:38 UTC 2008


Hi Martin,

On Tue, 27 May 2008 09:06:41 +0100, Martin Aspeli wrote:

>> For the recording of tests, Selenium IDE is used. For the running of
>> tests, Zelenium is used which means it runs on every browser. It was
>> not a goal to be runnable from within PloneTestCase, instead we wanted
>> to make a group of tests runnable from a browser with a single click.
>> 
>> It also does not use DemoStorage but operates on an existing server,
>> but this could be extended if needed.
> 
> Then how do you do test setup and tear-down?

The tests are run on IDE (Zelenium) and controlled by a html Selenium 
testsuite. This is a html page that contains a table with links to the 
actual test cases. Selenium can execute all testcases in the suite at 
once or one by one. The tests visit a normal working website.

kss.demo generates the testsuite based on the set of tests selected to 
run, groups them accordingly and inserts layer setup and layer teardown 
testcases in between. A setup (or teardown) testcase is typically "open 
url portal/@@create_site" but it can also be "log in as Manager", 'log 
our' or "change the skin on the browser", so it's not only about server 
side content.

p.s. besides html, kss.demo can also produce testsuites in python format,
which is how the kissbot is running.

> I think the only complex bit is to ensure that you get:
> 
>   - set up based on layers
>   - tear-down/roll-back after each test

The rollback is unhandy to be done with zodb transactions, because a 
testcase typically consists of several requests. A "create plone site" 
action takes long to execute, so one solution would be to snapshot the 
DemoStorage when a layer sets up, which then could be reverted before 
each individial test.
 

> Selenium will start the browser and do the automation, even if you're
> running the test in PloneTestCase.

Indepedently if we execute from the browser with Selenium IDE (like 
currently kss.demo does) or with Selenuim RC (like currently funittest, 
or the kissbot does with kss.demo) the setup/teardown snapshotting would 
need to be taken care of the same. I am not sure how funittest is doing 
this.

(
Note the advantage of IDE is that it executes in any browser while RC may 
depend more strongly on actual browser implementations, due to the need 
to remote control.
)


Best wishes,

-- 
Balazs Ree





More information about the Product-Developers mailing list