Add check to ensure OobeAPI exists for screen in AU tests
OobeAPI.screens.UpdateScreen is not available when running
autoupdate_FocedOOBEUpdate.m2n test with latest stable version M91.
This check can be removed after M92 is in stable channel.
BUG=b:190869165
TEST=run autoupdate_ForcedOOBEUpdate
Change-Id: I5a3677ff39663451193d4e8a4266ee4add77550a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2961473
Reviewed-by: Roman Sorokin [CET] <rsorokin@chromium.org>
Reviewed-by: David Haddock <dhaddock@chromium.org>
Tested-by: Yunke Zhou <yunkez@google.com>
Commit-Queue: Yunke Zhou <yunkez@google.com>
diff --git a/client/site_tests/autoupdate_StartOOBEUpdate/autoupdate_StartOOBEUpdate.py b/client/site_tests/autoupdate_StartOOBEUpdate/autoupdate_StartOOBEUpdate.py
index 570d901..01d4c59 100644
--- a/client/site_tests/autoupdate_StartOOBEUpdate/autoupdate_StartOOBEUpdate.py
+++ b/client/site_tests/autoupdate_StartOOBEUpdate/autoupdate_StartOOBEUpdate.py
@@ -52,8 +52,16 @@
timeout=timeout)
self._oobe.ExecuteJavaScript(
"OobeAPI.screens.EulaScreen.clickNext()")
- self._oobe.WaitForJavaScriptCondition(
- "OobeAPI.screens.UpdateScreen.isVisible()", timeout=timeout)
+
+ # TODO(yunkez): remove this check after M92 is in stable
+ if self._oobe.EvaluateJavaScript(
+ "typeof OobeAPI.screens.UpdateScreen == 'object'"):
+ self._oobe.WaitForJavaScriptCondition(
+ "OobeAPI.screens.UpdateScreen.isVisible()",
+ timeout=timeout)
+ else:
+ self._oobe.WaitForJavaScriptCondition("!$('oobe-update').hidden",
+ timeout=timeout)
def _start_oobe_update(self, update_url, critical_update, full_payload):
"""