|
15 | 15 | import static org.junit.Assert.assertNotEquals; |
16 | 16 | import static org.junit.Assert.assertTrue; |
17 | 17 | import static org.junit.Assert.fail; |
| 18 | +import static org.junit.Assume.assumeFalse; |
18 | 19 |
|
19 | 20 | import java.util.List; |
20 | 21 |
|
21 | 22 | import org.junit.Before; |
22 | | -import org.junit.Ignore; |
23 | 23 | import org.junit.Test; |
24 | 24 | import org.openqa.selenium.ElementNotInteractableException; |
25 | 25 | import org.openqa.selenium.remote.DesiredCapabilities; |
26 | 26 |
|
27 | 27 | import com.vaadin.testbench.By; |
28 | 28 | import com.vaadin.testbench.TestBenchElement; |
| 29 | +import com.vaadin.testbench.parallel.BrowserUtil; |
29 | 30 |
|
30 | 31 | public class ScrollIntoViewIT extends MultiBrowserTest { |
31 | 32 | private TestBenchElement lastButton; |
@@ -68,8 +69,21 @@ public void getText_scrollIntoViewDisabled_ElementIsNotScrolled() { |
68 | 69 | } |
69 | 70 |
|
70 | 71 | @Test |
71 | | - @Ignore("This seems to fail on Firefox") |
72 | 72 | public void click_scrollIntoViewDisabled_ElementIsNotScrolled() { |
| 73 | + // Firefox has some auto-scrolling logic of its own that is |
| 74 | + // unrelated to the auto-scrolling logic provided by TestBench. |
| 75 | + // Disabling the TestBench auto-scrolling doesn't prevent Firefox |
| 76 | + // auto-scrolling. |
| 77 | + // Without this check, Firefox auto-scrolling can be observed with |
| 78 | + // this test both locally (tested on Windows 11) and in the |
| 79 | + // validation builds. It cannot be prevented by TestBench except by |
| 80 | + // preventing the click altogether, which could give a misleading |
| 81 | + // impression on what actually happens when a user clicks an |
| 82 | + // element. |
| 83 | + // AssumptionViolatedException marks this test skipped on Firefox. |
| 84 | + assumeFalse("Firefox does its own auto-scrolling.", |
| 85 | + BrowserUtil.isFirefox(getDesiredCapabilities())); |
| 86 | + |
73 | 87 | assertFalse(lastButton.isDisplayed()); |
74 | 88 | getCommandExecutor().setAutoScrollIntoView(false); |
75 | 89 | try { |
|
0 commit comments