In order to feed my test cases in a dynamic way I am trying to feed it form
a Class *Test*Provider
The purpose is the same as the dataDriven antTask but instead of feeding
from an excel it feeds from from a Class.
The problem I am having is that I want to run all the tests not stopping
when the first test fails.
The only way I found to do that was :
public class SeoHomepageTest extends WebtestCase {
def provider = new SeoHomepageProvider()
public void testSeoStructure() {
*provider.testCasesData.each(){test ->*
webtest("MetatagId: $test.metatagid Testing Title - Meta
Description - MetaKeyword"){
config (haltonerror: "false", haltonfailure: "false")
ant.group description:"MetatagId: $test.metatagid" , {
Homepage.goTo(test.url, ant)
SeoVerifications.checkMetatags(test.title,
test.metadescription, test.metakeyword, ant)
}
}
}
}
}
However this way when i see the results I see the same test several times,
one per data injection. Does anyone know if there is a way to do this in
webtest:
public class SeoHomepageTest extends WebtestCase {
def provider = new SeoHomepageProvider()
public void testSeoStructure() {
webtest("MetatagId: $test.metatagid Testing Title - Meta
Description - MetaKeyword"){
config (haltonerror: "false", haltonfailure: "false")
* provider.testCasesData.each(){test -> *
ant.group description:"MetatagId: $test.metatagid" , {
Homepage.goTo(test.url, ant)
SeoVerifications.checkMetatags(test.title,
test.metadescription, test.metakeyword, ant)
}
}
}
}
but telling webtest to continue with the next "test" if there is a step that
fails.
Right now it stops the complete execution of the test when a setp fails.
something like this:
public void testSeoStructure() {
webtest("MetatagId: $test.metatagid Testing Title - Meta
Description - MetaKeyword"){
config (haltonerror: "false", haltonfailure: "false")
* provider.testCasesData.each(){test -> *
*ant.test* description:"MetatagId: $test.metatagid" , {
Homepage.goTo(test.url, ant)
SeoVerifications.checkMetatags(test.title,
test.metadescription, test.metakeyword, ant)
}
}
}
}
Thanks in advance
Hernan