mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-15 09:51:21 +00:00
- Splinter/selenium have implicit and explicit waiting time. Implicit wait time will make every negative lookup wait for about 3 seconds before it actually fails. Because we ensure missing elements in quite a few places, this introduces many 3 seconds wait periods during testing. Remove it instead rely on explicit waiting whenever needed. - Explicit wait time is only used during explicitly requests waiting conditions. In a loop the API waits for a maximum of timeout period until a given condition is satisfied. Each time the condition is checked, it goes into sleep for explicit wait period amount of time. This is typically a second or so. Since we are impatient, make it 0.1 instead. - Also make sure that whenever a page is visit()ed, we automatically wait until the page is fully loaded by overriding the splinter wait condition. Otherwise, we will need to introduce waiting code in a lot of places. - Using document.readyState == complete is a better check to ensure that a page is fully loaded. If we proceed with the page 'loading' or 'interactive' state, we will have to change a lot of code to make it wait. - Handle Apache restarts when waiting for page load. The error page apparently is never reaches document.readyState == 'complete'. So, if an error page is encountered, always reload. - While waiting for installation, ensure that we atomically check that page has loaded fully and the installation progress is not being shown. Otherwise, there would be race condition due to installation page refreshing itself. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>