selenium - Ignore all tests from specflow using [BeforeTestRun] hook -
my project has 2 default configurations (debug , release) , custom 1 called uitest.
when uitest config selected changes ioc use in memory verson of database perfect ui tests.
i using nunit , resharper run tests , run ui tests when uitest configuration active.
i decided go [beforetestrun] hook achieve cant ignore tests.
throwing exception prevent tests running show fail, prefer have them show pending or ignored. possible?
[beforetestrun] public static void beforetests() { #if !uitest throw new exception("abort!"); #endif }
addendum
if change this:
[beforetestrun] public static void beforetests() { #if !uitest assert.ignore(); #endif }
then each of scenarios show ignored feature fail.
the beforetestrun
hook method runs once, before run starts. if want skip whole testrun, can use environment.exit();
exit run.
in mstest tests show not run, not sure how nunit or resharper handles this.
Comments
Post a Comment