Re: [mxunit:3639] force test suites to run in a specific order

43 views
Skip to first unread message

Marc Esher

unread,
Jun 26, 2012, 7:14:03 PM6/26/12
to mxu...@googlegroups.com
Hey Andrew,

Your name sounds familiar ;-)

This is fairly simple, though you're going to lose the convenience of
the DirectoryTestSuite.

Here's how you'd do it if running from ANT. To do it from the web
runner, in your runUI.cfm (or whatever it is) will require something
similar. If you don't like the duplication you could pull it out into
a "WorkflowTestSuite.cfc" which basically just wraps up what I'm
showing you below, and then you could include it in both the ANT and
web contexts.

Anyway:

Right now, you have a custom HttpAntRunner.cfc in your tests
directory, and that's what ANT is talking to. It extends the
mxunit.runner.HttpAntRunner. It probably has some if() statements to
control which kind of TestSuite gets created.

Basically, to do what you want to do, you're going to look for your
specific component path, and then you're going to build the TestSuite
manually. OR, yeah, you could just alphabetize them.

Here's what it'll look like if you do it manually:

Let's assume that you have a test directory at tests/ui/workflow and
those workflow tests are the ones you want to create manually and run
in a specific order. For the rest of your UI tests you don't care.

if( componentPath contains ".ui.workflow" ){
suite = createObject("component", "mxunit.framework.TestSuite")
.addAll("tests.ui.workflow.Step1Test")
.addAll("tests.ui.workflow.Step2Test")
.addAll("tests.ui.workflow.Step3Test");
results = suite.run();

} else if( componentPath contains "ui")...{
... all your existing stuff goes here

Let me know how that works out.

Marc

On Tue, Jun 26, 2012 at 4:52 PM, Andrew K <klimcha...@gmail.com> wrote:
> I am trying to test an application where there is a pretty complex
> workflow.  The workflow has multiple steps and the steps have multiple
> sections.
>
> So:
>    Step 1
>       Section A
>       Section B
>     Step 2
>       Section A
>       Section B
>
> We had some rudimentary UI tests which tested each section, but we are now
> looking to create UI tests which test the workflow engine.  The test suites
> are defined to match the workflow.
>
> My question is, "Is there a way to force test suites to run in a specific
> order?"  I've seen the decorators (pretty cool) which allow you to run tests
> in a specific order within a test suite, but I am looking to order the test
> suites.  Will alphabetizing the test suites help me here?
>
> Thanks.  Please let me know if my question is unclear or you need more
> information.
>
> --
> You received this message because you are subscribed to the Google Groups
> "mxunit" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/mxunit/-/Fga3fEwc4bYJ.
> To post to this group, send email to mxu...@googlegroups.com.
> To unsubscribe from this group, send email to
> mxunit+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mxunit?hl=en.
Reply all
Reply to author
Forward
0 new messages