@@ -48,11 +48,22 @@ public void hasDifferentSizeAsWithTolerance() {
4848 assertThatHasDifferentSizeWithTolerance (-1 , 0 ).isFalse ();
4949 assertThatHasDifferentSizeWithTolerance ( 0 , 0 ).isFalse ();
5050 assertThatHasDifferentSizeWithTolerance (+1 , 0 ).isFalse ();
51- assertThatHasDifferentSizeWithTolerance (0 , +2 ).isTrue ();
51+ assertThatHasDifferentSizeWithTolerance (+2 , 0 ).isTrue ();
52+ assertThatHasDifferentWidthWithTolerance (-2 ).isTrue ();
53+ assertThatHasDifferentWidthWithTolerance (-1 ).isFalse ();
54+ assertThatHasDifferentWidthWithTolerance ( 0 ).isFalse ();
55+ assertThatHasDifferentWidthWithTolerance (+1 ).isFalse ();
56+ assertThatHasDifferentWidthWithTolerance (+2 ).isTrue ();
5257 assertThatHasDifferentSizeWithTolerance (0 , -2 ).isTrue ();
5358 assertThatHasDifferentSizeWithTolerance (0 , -1 ).isFalse ();
59+ assertThatHasDifferentSizeWithTolerance (0 , 0 ).isFalse ();
5460 assertThatHasDifferentSizeWithTolerance (0 , +1 ).isFalse ();
5561 assertThatHasDifferentSizeWithTolerance (0 , +2 ).isTrue ();
62+ assertThatHasDifferentHeightWithTolerance (-2 ).isTrue ();
63+ assertThatHasDifferentHeightWithTolerance (-1 ).isFalse ();
64+ assertThatHasDifferentHeightWithTolerance ( 0 ).isFalse ();
65+ assertThatHasDifferentHeightWithTolerance (+1 ).isFalse ();
66+ assertThatHasDifferentHeightWithTolerance (+2 ).isTrue ();
5667 }
5768
5869 public AbstractBooleanAssert <?> assertThatHasDifferentSizeWithTolerance (int deltaWidth , int deltaHeight ) {
@@ -62,6 +73,16 @@ public AbstractBooleanAssert<?> assertThatHasDifferentSizeWithTolerance(int delt
6273 haveDifferentSizes (asList (root , element ), 1 ));
6374 }
6475
76+ public AbstractBooleanAssert <?> assertThatHasDifferentHeightWithTolerance (int deltaHeight ) {
77+ WebElement element = DummyWebElement .createElement (x , y , x + width , y + height + deltaHeight );
78+ return assertThat (haveDifferentHeights (asList (root , element ), 1 ));
79+ }
80+
81+ public AbstractBooleanAssert <?> assertThatHasDifferentWidthWithTolerance (int deltaWidth ) {
82+ WebElement element = DummyWebElement .createElement (x , y , x + width + deltaWidth , y + height );
83+ return assertThat (haveDifferentWidths (asList (root , element ), 1 ));
84+ }
85+
6586 private AbstractBooleanAssert <?> assertThatNotOverlappingWithTolerance (int x , int y ) {
6687 WebElement element = createElement (x , y );
6788 return assertThat (isNotOverlapping (root , element , 1 ) &&
0 commit comments