File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -499,8 +499,24 @@ Received: "not displayed"`)
499499 await expectLib ( elements ) . toBeElementsArrayOfSize ( 2 )
500500 } )
501501
502+ test ( 'toBe matchers and toHve matchers work with .not' , async ( ) => {
503+ await expectLib ( elements ) . not . toBeDisabled ( )
504+ await expectLib ( elements ) . not . toHaveText ( 'Some other text' )
505+ await expectLib ( elements ) . not . toHaveHTML ( '<SomeOtherHtml/>' )
506+ await expectLib ( elements ) . not . toHaveComputedLabel ( 'Some Other Computed Label' )
507+ await expectLib ( elements ) . not . toHaveComputedRole ( 'Some Other Computed Role' )
508+ await expectLib ( elements ) . not . toHaveElementProperty ( 'someProperty' , 'some other value' )
509+ await expectLib ( elements ) . not . toHaveAttribute ( 'someAttribute' , 'some other attribute' )
510+ await expectLib ( elements ) . not . toHaveAttr ( 'someAttribute' , 'some other attribute' )
511+ await expectLib ( elements ) . not . toHaveSize ( { width : 200 , height : 100 } )
512+ await expectLib ( elements ) . not . toHaveHeight ( 100 )
513+ await expectLib ( elements ) . not . toHaveWidth ( 200 )
514+ await expectLib ( elements ) . not . toBeElementsArrayOfSize ( 3 )
515+ } )
516+
502517 test ( 'toHave works with stringContaining asymmetric matcher' , async ( ) => {
503518 await expectLib ( elements ) . toHaveText ( [ expectLib . stringContaining ( 'Valid' ) , expectLib . stringContaining ( 'Valid' ) ] )
519+ await expectLib ( elements ) . not . toHaveText ( [ expectLib . stringContaining ( 'Test' ) , expectLib . stringContaining ( 'Test' ) ] )
504520 } )
505521
506522 // TODO to support one day?
Original file line number Diff line number Diff line change @@ -687,7 +687,7 @@ declare namespace ExpectWebdriverIO {
687687
688688 // Number options is the only options that also serves as a expected value container
689689 // This can caused problems with multiple expected values vs global command options
690- // Potnetial we should have this object as a NumberExpect type and have the options separate
690+ // Potentially we should have this object as a NumberExpect type and have the options separate
691691 interface NumberOptions extends CommandOptions {
692692
693693 /**
You can’t perform that action at this time.
0 commit comments