@@ -41,7 +41,7 @@ public void CheckDropdownHeaders([NotNull] IGroupedDropdownWrapper wrapper, [Not
4141 CheckDropdownElements ( wrapper . GroupTexts , items , $ "{ wrapper . Caption } groups") ;
4242 }
4343
44- [ When ( "(.*?) (contain|not contain) \" (.*)\" " ) ]
44+ [ Given ( "(.*?) (contain|not contain) \" (.*)\" " ) ]
4545 [ Then ( "(.*?) should (contain|not contain) \" (.*)\" " ) ]
4646 public void CheckDropdownContainsItems (
4747 [ NotNull ] IDropdownWrapper wrapper ,
@@ -54,6 +54,23 @@ public void CheckDropdownContainsItems(
5454 $ "{ wrapper . Caption } items are { wrapper . Items . Aggregate ( ( x , y ) => $ "{ x } , { y } ") } ") ;
5555 }
5656
57+ [ Given ( "the (.*?) (contains|not contains) the following values:" ) ]
58+ [ Then ( "the (.*?) should (contain|not contain) the following values:" ) ]
59+ [ Then ( "the \" (.*?)\" menu should (contain|not contain) the following values:" ) ]
60+ public void CheckDropdownContainsMultipleItems ( [ NotNull ] IDropdownWrapper wrapper , [ NotNull ] string behavior , [ NotNull ] Table table )
61+ {
62+ Assert . ShouldBecome ( ( ) => table . Rows . Any ( ) , true ,
63+ new AssertionBehavior ( AssertionType . Immediate , false ) , "Please provide data in the table" ) ;
64+
65+ var dropdownItems = wrapper . Items ;
66+ foreach ( var row in table . Rows )
67+ {
68+ var value = row . Values . FirstOrDefault ( ) ;
69+ Assert . ShouldBecome ( ( ) => dropdownItems . Contains ( value ) , ! behavior . Contains ( "not" ) ,
70+ $ "{ wrapper . Caption } items are { dropdownItems . Aggregate ( ( x , y ) => $ "{ x } , { y } ") } ") ;
71+ }
72+ }
73+
5774 [ Then ( "all items in the (.+?) should (have|not have) \" (.+?)\" " ) ]
5875 public void CheckAllItemsContainString (
5976 [ NotNull ] IDropdownWrapper wrapper ,
0 commit comments