Dependency in TestNG suite of suites xml file

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Dependency in TestNG suite of suites xml file

Тарас Митлович
Hi all
I am very interested, is there any possibility to make suites dependent?

It would be great to have something like this: 

<suite name="Parent" verbose="1" >
    <suite-files>
        <suite-file name="base" path="base.xml"/>
        <suite-file path="first.xml" depends-on="base" />
        <suite-file path="first.xml" depends-on="base" />
    </suite-files>
</suite>

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Dependency in TestNG suite of suites xml file

Krishnan Mahadevan
Can you please elaborate on your use case wherein you would need a suite dependency ?


On Thu, Mar 1, 2018, 00:13 Тарас Митлович <[hidden email]> wrote:
Hi all
I am very interested, is there any possibility to make suites dependent?

It would be great to have something like this: 

<suite name="Parent" verbose="1" >
    <suite-files>
        <suite-file name="base" path="base.xml"/>
        <suite-file path="first.xml" depends-on="base" />
        <suite-file path="first.xml" depends-on="base" />
    </suite-files>
</suite>

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Dependency in TestNG suite of suites xml file

Тарас Митлович
My use case is following: I need to parallel cucumber tests, but only some of them.
Hence I was thinking about dividing my features in different xmls - the one to parallel and the another one - for single thread

But also I have one "acceptance" test on connection
If it is failed -> it is useless to run the rest UI test

So I would like to make separate xml for  this acceptance test and make the rest ones dependent on it. Ones the acceptans tests fails -we skip all test

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Dependency in TestNG suite of suites xml file

Тарас Митлович
In reply to this post by Krishnan Mahadevan
My use case is following: I need to parallel cucumber tests, but only some of them.
Hence I was thinking about creating separate runners for those features and dividing that runners in different xmls - the one to parallel and the another one - for single thread

But also I have one "acceptance" test on connection
If it is failed -> it is useless to run the rest UI test

So I would like to make separate xml for  this acceptance test and make the rest ones dependent on it. Ones the acceptans tests fails -we skip all test 

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Dependency in TestNG suite of suites xml file

Krishnan Mahadevan

You should be able to do this on your own today.

 

TestNG currently doesn’t have any data structure that can be shared by multiple <suite> objects.

But you can build your own data structure (perhaps a singleton) that keeps track of failures in a suite.

The next suite which has a dependency (you can perhaps express that dependency via a <parameter> at the suite level) would basically query your data structure using the suite name provided in the <parameter> and check its status. If the status indicates that all tests in the <suite> passed, it would proceed further, else the onStart(ISuite) (or) a @BeforeSuite method would basically throw an error and thus abort execution of the entire suite.

 

On a side note:

Since you mentioned parallel cucumber tests, perhaps you can give a try at a library that I built, which lets you run cucumber scenarios in parallel and also generate the json/html reports in a thread safe manner.

 

https://github.com/RationaleEmotions/cucumber-roadrunner

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

From: <[hidden email]> on behalf of Тарас Митлович <[hidden email]>
Reply-To: <[hidden email]>
Date: Thursday, March 1, 2018 at 5:03 PM
To: testng-users <[hidden email]>
Subject: Re: [testng-users] Dependency in TestNG suite of suites xml file

 

My use case is following: I need to parallel cucumber tests, but only some of them.

Hence I was thinking about creating separate runners for those features and dividing that runners in different xmls - the one to parallel and the another one - for single thread

 

But also I have one "acceptance" test on connection

If it is failed -> it is useless to run the rest UI test

 

So I would like to make separate xml for  this acceptance test and make the rest ones dependent on it. Ones the acceptans tests fails -we skip all test 

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
[hidden email].
To post to this group, send email to
[hidden email].
Visit this group at
https://groups.google.com/group/testng-users.
For more options, visit
https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.