Commit 73106a23 authored by resetswitch's avatar resetswitch Committed by Commit bot

OOBE sign in fixes for enterprise_PowerManagement

Debugging some tests that were unblocked by codereview.chromium.org/1084793002, I found that waiting for the password field to disappear sometimes fails. We need to wait for the OOBE page to disappear before continuing to the test logic.

BUG=480571

Review URL: https://codereview.chromium.org/1063853008

Cr-Commit-Position: refs/heads/master@{#326915}
parent 47b4c2f0
......@@ -91,7 +91,11 @@ class Oobe(web_contents.WebContents):
def _NavigateWebViewLogin(self, username, password):
"""Logs into the webview-based GAIA screen"""
self._NavigateWebViewEntry('identifierId', username)
self._GaiaWebViewContext().WaitForJavaScriptExpression(
"document.getElementById('identifierId') == null", 20)
self._NavigateWebViewEntry('password', password)
util.WaitFor(lambda: self._GaiaWebViewContext() == None, 20)
def _NavigateWebViewEntry(self, field, value):
self._WaitForField(field)
......@@ -101,8 +105,6 @@ class Oobe(web_contents.WebContents):
document.getElementById('%s').value='%s';
document.getElementById('next').click()"""
% (field, value))
gaia_webview_context.WaitForJavaScriptExpression(
"document.getElementById('%s') == null" % field, 20)
def _WaitForField(self, field_id):
gaia_webview_context = util.WaitFor(self._GaiaWebViewContext, 5)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment