blob: c079c8cc318fe5757e25a7e84b9a37cfe666d0d0 [file] [log] [blame]
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import sys
def _SetupPaths():
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
sys.path.append('/usr/local') # to import autotest libs
from autotest.cros import constants
import pyauto
class ChromeosUtils(pyauto.PyUITest):
"""Utils for ChromeOS."""
def LoginToDefaultAccount(self):
"""Login to ChromeOS using default testing account.
python \
if self.GetLoginInfo()['is_logged_in']:'Already logged in as %s.' % self.GetLoginInfo()['email'])
creds = constants.CREDENTIALS['$default']
username = creds[0]
passwd = creds[1]
self.Login(username, passwd)
assert self.GetLoginInfo()['is_logged_in']'Logged in as %s.' % username)
if __name__ == '__main__':