I am using cucumberjs selenium webdriver to take screenshot of web app that's developed with React.
My question would be: Given a nested list like below:
<ul>
<li>child 1</li>
<li>child 2</li>
</ul>
<ul>
<li>child 3</li>
<li>child 4</li>
<li>
<ul>
<li>child 5</li>
<li>child 6</li>
</ul>
</li>
</ul>
What would be a good approach to let selenium webdriver to know that this page has finished rendering(or updating), so that selenium webdriver can take a screenshot of fully rendered web page?
Some thoughts:
1. Extending React components to have extra data field that webdriver can know about (child)
2. Using the React lifecycle ComponentDidMount
and ComponentDidUpdate
Some thoughts?