java - bypassing @Test dependsOnMethods due to failure -
i have question regarding @test(dependonmethods{""}).. want tests run in particular order hit every test have written. best way far, atleast have found, dependsonmethods! however, since tests come after requires 1 before pass, cant run of tests , see ones failed. program exits! here i'm working with..
@test(dependsonmethods = {"shouldselectamountofdoors"}) public void shouldselectextcolor() throws interruptedexception{ sycoptionalinfopage.selectextcolor("green"); } @test(dependsonmethods = {"shouldselectextcolor"}) public void shouldselectintcolor() throws interruptedexception{ sycoptionalinfopage.selectintcolor("gold"); } @test(dependsonmethods = {"shouldselectintcolor"}) public void shouldenteracomment() throws interruptedexception{ sycoptionalinfopage.entercomments("<(*-<) <(*-*)> (>-*)> woot!"); takeabreakyo(); }
boom. easy understand , trusty pom! but, if shouldselectintcolor() fails due changed id dev team, want shouldenteracomment still run! how can continue keep tests chained in line, still run after failure? :)
you can use priority
instead of dependsonmethods
achieve want:
@test(priority = 1) public void shouldselectintcolor() throws interruptedexception{ } @test(priority = 2) public void shouldenteracomment() throws interruptedexception{ }
here if shouldselectintcolor
method fails, still execute shouldenteracomment
test method.
Comments
Post a Comment