From 4be7ce0f5daf2d6eff00f72ef54027f4c2cb72a9 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 16 Apr 2023 13:28:22 +0530 Subject: [PATCH] tests: functional: Update detecting page changes Several tests failed randomly (on a slightly slow machine) while trying to detect that a page change has occurred. Workaround this by handling the exception thrown. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/tests/functional/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plinth/tests/functional/__init__.py b/plinth/tests/functional/__init__.py index 645522c19..35396dd3f 100644 --- a/plinth/tests/functional/__init__.py +++ b/plinth/tests/functional/__init__.py @@ -94,7 +94,7 @@ class _PageLoaded(): is_stale = False try: self.element.has_class('whatever_class') - except StaleElementReferenceException: + except (StaleElementReferenceException, TypeError): # After a domain name change, Let's Encrypt will restart the web # server and could cause a connection failure. if driver.find_by_id('netErrorButtonContainer'):