How can I use When step after a Then step in specflow? -
i'd using specflow system test test steps whould like:
when i'm selecting "a" "a" item(s) appear when i'm selecting "b" "a" , "b" item(s) appear when i'm unselecting "a" "a" item(s) appear problem 2'nd when considered new method specflow. did of know what's solution that?
thanks in advance!
your scenario has strange use of language me. implies in process of doing something, rather performing , completing , action. think when select 'a' read better.
anyway these step definitions should allow steps reused:
[when(@"i'm selecting ""(.*)""")] public void whenimselecting(string p0) { scenariocontext.current.pending(); } [then(@"""(.*)"" item\(s\) appear")] public void thenitemsappear(string p0) { scenariocontext.current.pending(); } [then(@"""(.*)"" , ""(.*)"" item\(s\) appear")] public void thenanditemsappear(string p0, string p1) { scenariocontext.current.pending(); } [when(@"i'm unselecting ""(.*)""")] public void whenimunselecting(string p0) { scenariocontext.current.pending(); } generally prefer single quotes wrap parameters makes regexes easier work with, rewrite scenarios this:
when select 'a' 'a' item(s) shown when select 'b' 'a' , 'b' item(s) shown when deselect 'a' 'a' item(s) shown which result in these step definitions:
[when(@"i select '(.*)'")] public void wheniselect(string p0) { scenariocontext.current.pending(); } [then(@"'(.*)' item\(s\) shown")] public void thenitemsareshown(string p0) { scenariocontext.current.pending(); } [then(@"'(.*)' , '(.*)' item\(s\) shown")] public void thenanditemsareshown(string p0, string p1) { scenariocontext.current.pending(); } [when(@"i deselect '(.*)'")] public void whenideselect(string p0) { scenariocontext.current.pending(); } but domain use whatever language want in scenarios :-)
Comments
Post a Comment