Creating template suite files

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

Creating template suite files

JROCK2004
Our current suite files have required parameter that you need to specify and sometimes people are missing them. What I would like to do is create a master template suite file that users can include into their personal suite files. This way if a required parameter changes all people will instantly get those changes. I thought the use of suite-files would help but it is not working the way I want. Here is an example of what I want to do


MasterTemplate.xml
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="John's - Test Suite" parallel="false" >
    <parameter name = "browserType" value="firefox" />
    <parameter name = "setupBrowserType" value="htmlunit" />
    <parameter name = "url" value="www.google.com" />
</suite>

My personal suite file

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="John's - Test Suite" parallel="false" >
    <suite-files>
        <suite-file path="./MasterTemplate.xml" />
    </suite-files>

    <test name="Johns Smoke Tests"  preserve-order="true">
        <classes>
            <class name="OrderHistoryValidationTests">
                <methods>
                    <include name="testHistoryLookup" />
                </methods>
            </class>
        </classes>
    </test>
</suite>

Is this possible?

--
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 http://groups.google.com/group/testng-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Creating template suite files

Krishnan Mahadevan
What you essentially did here was create a suite of suites.

AFAIK currently within TestNG you CANNOT bring in the "inheritance sort of behavior" in Suite XML files.

However you can define default values for the parameters inside your framework (The place wherein you are reading the values from the parameters)

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/


On Fri, Apr 19, 2013 at 7:38 PM, jrock2004 <[hidden email]> wrote:
Our current suite files have required parameter that you need to specify and sometimes people are missing them. What I would like to do is create a master template suite file that users can include into their personal suite files. This way if a required parameter changes all people will instantly get those changes. I thought the use of suite-files would help but it is not working the way I want. Here is an example of what I want to do


MasterTemplate.xml
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="John's - Test Suite" parallel="false" >
    <parameter name = "browserType" value="firefox" />
    <parameter name = "setupBrowserType" value="htmlunit" />
    <parameter name = "url" value="www.google.com" />
</suite>

My personal suite file

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="John's - Test Suite" parallel="false" >
    <suite-files>
        <suite-file path="./MasterTemplate.xml" />
    </suite-files>

    <test name="Johns Smoke Tests"  preserve-order="true">
        <classes>
            <class name="OrderHistoryValidationTests">
                <methods>
                    <include name="testHistoryLookup" />
                </methods>
            </class>
        </classes>
    </test>
</suite>

Is this possible?

--
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 http://groups.google.com/group/testng-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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 http://groups.google.com/group/testng-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.