Right now, the tests related to the rollback confirmation prompt (specifically tests/selenium/specs/rollback.js) use browser.pause() to solve issues with delays in JavaScript loading and elements appearing after animations have been executed.
In order to solve the issues with the delayed loading of JavaScript modules, we should implement something similar to what has been done in the Cite extension to ensure that mediawiki.api is always loaded before we try to make API calls:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Cite/+/502212/
Additionally, instead of using pause to wait for the buttons to become clickable, we should use waitForVisible() to ensure the elements are there without relying on arbitrary time constraints.