PDA

View Full Version : multiple testsuites


Andreeeas
11-11-2008, 01:00 AM
hello everyone,

my question is how to chain multiple testsuites in one canvas, so that they are executed sequentially, meaning the end of a testsuite triggers the start of the next one. by default all testsuites are executed at the time they are instantiated.

the onsuitefinish event listed in the reference doesnt seem to be sent at all.

so here's a sample to explain what exactly my intention is:


<canvas>

<view name="a">....</view>

<view name="b">....</view>

<view name="c">....</view>

<TestSuite name="test_a">
//testcases for view a go in here
</TestSuite>


<TestSuite name="test_b">
//testcases for view b go in here
</TestSuite>


<TestSuite name="test_c">
//testcases for view c go in here
</TestSuite>

</canvas>


as aforementioned, i want those testsuites to execute one after another. combining them to one suite is not an option for me since in my application i have multiple views represented by classes that correspond to view a,b,c in this example.

hopefully someone can give me a hint on how to achieve this.

greets

andreas

pugmaster
11-11-2008, 07:23 PM
To get your test suites to execute in sequential order, you'll need to add this statement:

<script>
asynchronoustests = false
</script>

-- Norman Klein
Author: Laszlo in Action

Andreeeas
11-14-2008, 12:29 AM
thx for your reply, but i think you got me wrong.

i want to execute my suites in sequential order. the asynchronousTests property just makes sure that testXXX methods within a testcase are executed sequentially.

is there any way to get my suites to execute sequentially?

pugmaster
11-14-2008, 08:32 AM
LzUnit is designed to have a single test suite consisting of multiple TestCase, but you can still have multiple test suites that execute in sequential order by enclosing them within declarative state tags. Each state will have a condition that is set true as the final step from the previous test suite.

-- Norman Klein
Author: Laszlo in Action

Andreeeas
11-17-2008, 01:44 AM
thx alot! your approach lead me to the right mechanism.

however, i find it easier to make use of the initstage attribute of the testsuite. as the execution of a testsuite is directly affected by its instantiation one can also chain the suites sequentially calling the LzNode.completeInstantiation method on the suites. If someone wants to achieve the same and doesnt know how to do this by this fairly short description drop me a PM.

greets andreas