Our app uses Masonry grid layout. After page_A opens, the tiles keep moving for a second or two.
The test case is: open the page_A and click on the button which opens page_B.
While clicking the button I get either element click intercepted exception or nothing happens. Which I assume the button gets clicked but no event has fired, because it is too soon, maybe not all the functions have finished loading.
I tried explicit waits with ExpectedConditions.presenceOfElementLocated and ExpectedConditions.elementToBeClickable but I get results mentioned above.
How to solve this without Thread.sleep?
Preferably I would like to not use the second loading page_B (check the url or elements on page_B) as a criteria since it is a slow loading page and it has other problems.
Is there a way to know if the click was "successful", like if it has fired an onClick action, or started a function (I am not very good at JS).