title: How to indicate certain events to Selenium tests?
body: <p>I'm relatively new to Selenium testing. I have a React SPA I want to create Selenium tests for. I can work with locators and such, but I don't know how I can make the test wait for certain events.</p>
  <p>I.e.: The test opens a page where I have a list that is loaded via an API. I need the test to wait until the content is loaded. How can I indicate this to the test? I may be able to check the spinner and wait until it disappears, but there could be situations when the spinner doesn't even appear. Besides, I need to handle events when there are no elements in the list or when there is a communication issue with the API. I really don't want to rely on user messages and spinners.</p>
  <p>Should I create an DOM element which is invisible to the user and fill it with the event result so the test can read it? This also doesn't seem a good solution for me.</p>