tools/perf/page_sets/login_helpers/pinterest_login.py
def LoginMobileAccount(action_runner, credential,
                        credentials_path=login_utils.DEFAULT_CREDENTIAL_PATH):
  """Logs in into a Pinterest account on mobile.

  This function navigates the tab into Pinterest's login page and logs in a user
  using credentials in |credential| part of the |credentials_path| file.

  Args:
    action_runner: Action runner responsible for running actions on the page.
    credential: The credential to retrieve from the credentials file (string).
    credentials_path: The path to credential file (string).

  Raises:
    exceptions.Error: See ExecuteJavaScript()
    for a detailed list of possible exceptions.
  """
  wait_for_local_storage = """
  (function() {
    try {
      const state = JSON.parse(window.localStorage.REDUX_STATE);
      return state.users[state.session.userId].login_state;
    } catch(e) { return false; }
  })()
  """
  _LoginAccount(action_runner, credential, credentials_path)
  action_runner.WaitForJavaScriptCondition(wait_for_local_storage, timeout=20)
Logs in into a Pinterest account on mobile.

  This function navigates the tab into Pinterest's login page and logs in a user
  using credentials in |credential| part of the |credentials_path| file.

  Args:
    action_runner: Action runner responsible for running actions on the page.
    credential: The credential to retrieve from the credentials file (string).
    credentials_path: The path to credential file (string).

  Raises:
    exceptions.Error: See ExecuteJavaScript()
    for a detailed list of possible exceptions.
  
Logs in into a Pinterest account on mobile.
This function navigates the tab into Pinterest's login page and logs in a user
using credentials in |credential| part of the |credentials_path| file.

Action runner responsible for running actions on the page.
credential: The credential to retrieve from the credentials file (string).
credentials_path: The path to credential file (string).

exceptions.Error: See ExecuteJavaScript()
for a detailed list of possible exceptions.
Logs in into a Pinterest account on mobile . This function navigates the tab into Pinterest ' s login page and logs in a user using credentials in |credential| part of the |credentials_path| file . Action runner responsible for running actions on the page . credential : The credential to retrieve from the credentials file ( string ) . credentials_path : The path to credential file ( string ) . exceptions . Error : See ExecuteJavaScript () for a detailed list of possible exceptions .
def LoginMobileAccount(action_runner, credential,
                        credentials_path=login_utils.DEFAULT_CREDENTIAL_PATH):
  wait_for_local_storage = """
  (function() {
    try {
      const state = JSON.parse(window.localStorage.REDUX_STATE);
      return state.users[state.session.userId].login_state;
    } catch(e) { return false; }
  })()
  """
  _LoginAccount(action_runner, credential, credentials_path)
  action_runner.WaitForJavaScriptCondition(wait_for_local_storage, timeout=20)
def LoginMobileAccount ( action_runner , credential , credentials_path = login_utils . DEFAULT_CREDENTIAL_PATH ) : wait_for_local_storage = """
  (function() {
    try {
      const state = JSON.parse(window.localStorage.REDUX_STATE);
      return state.users[state.session.userId].login_state;
    } catch(e) { return false; }
  })()
  """ _LoginAccount ( action_runner , credential , credentials_path ) action_runner . WaitForJavaScriptCondition ( wait_for_local_storage , timeout = 20 )
Logs in into a Pinterest account on mobile.
Logs in into a Pinterest account on mobile .
"""Logs in into a Pinterest account on mobile.

  This function navigates the tab into Pinterest's login page and logs in a user
  using credentials in |credential| part of the |credentials_path| file.

  Args:
    action_runner: Action runner responsible for running actions on the page.
    credential: The credential to retrieve from the credentials file (string).
    credentials_path: The path to credential file (string).

  Raises:
    exceptions.Error: See ExecuteJavaScript()
    for a detailed list of possible exceptions.
  """
action_runner
credential
credentials_path