apexcharts / apexcharts.js

📊 Interactive JavaScript Charts built on SVG
https://apexcharts.com
MIT License
14.03k stars 1.28k forks source link

Improved e2e test reliability #4540

Closed Sebastian-Webster closed 1 week ago

Sebastian-Webster commented 1 week ago

With https://github.com/apexcharts/apexcharts.js/pull/4515 the tests passed locally, but ever since then some tests (mostly funnel/funnel, funnel/pyramid, and line/line-with-annotations) would sometimes fail spontaneously and running the tests again with no code changes would fix the error. Adding a while loop to wait for all timers/intervals/network requests and the chart animation to end fixes the reliability issues. This change would also improve reliability for future possible tests, like for example if a test needed a timeout after the chart animation ended, the test would not wait for that timeout because it had already waited for all timeouts to finish. With this PR, if a timeout is created after a chart animation ends, the test would wait for the timeout to end before continuing.

Type of change

Checklist: