示例#1
0
    def setUp(self):
        self.gui = Eucaweb(configFile='../input/2b_tested.lst',
                           clcpasswd='foobar')
        self.admin = euwebuser.Euwebuser(user="******",
                                         account="eucalyptus",
                                         passwd="admin")
        self.wg = self.gui.wg

        self.logger = eulogger.Eulogger(name="user_first_time_login")

        self.debug = self.logger.log.debug
        self.critical = self.logger.log.critical
        self.info = self.logger.log.info
示例#2
0
class AdminFirstTimeLogin(unittest.TestCase):
    def setUp(self):
        self.gui = Eucaweb(configFile='../input/2b_tested.lst',
                           clcpasswd='foobar')
        self.admin = euwebuser.Euwebuser(user="******",
                                         account="eucalyptus",
                                         passwd="admin")
        self.wg = self.gui.wg

        self.logger = eulogger.Eulogger(name="user_first_time_login")

        self.debug = self.logger.log.debug
        self.critical = self.logger.log.critical
        self.info = self.logger.log.info

    def test_admin_first_time_login(self):
        newuser = self.admin
        gui = self.gui
        try:
            newuser.printUser()
            #gui.driverRestart()
            gui.goLoginPage()
            try:
                gui.login(newuser.account, newuser.user, newuser.passwd)
            except:
                try:
                    self.gui.waitForTextOnPage('Login failed')
                except:
                    self.debug(
                        "First time Log in went to pop up instead, good")
                    gui.userFirstTimeLogin(newuser.email,
                                           newuser.passwd,
                                           newpass='******')

                    self.debug(
                        "Entered out form now checking page to see if we logged in correctly"
                    )
                    gui.verifyUserLinkPresent(newuser.user, newuser.account)
                    self.debug("First time login for (" + newuser.user +
                               ") succeeded")
                else:
                    self.fail("Initial password:"******" was rejected")
            else:
                self.fail(
                    "Initial Login succeeded without popup, was this really the first time?"
                )
        except Exception, e:
            self.fail("test_admin_first_time_login failed:" + str(e))
    def __init__(
            self,
            eucagui=None,  #eucawebdriver object
            euadmin=None,  #euwebuser object
            acctadmin=None,  #euwebuser object
            rejectuser=None,  #euwebuser object
            newuser=None,  #euwebuser object
            results=[]):  #buffer for results summary
        if (eucagui is None):
            print "qa_29: euca webdriver is null at init"
            self.gui = Eucaweb()
            self.wg = self.gui.wg
        else:
            self.gui = eucagui
            self.wg = eucagui.wg

        self.rejectuser = rejectuser
        self.euadmin = euadmin
        self.newacctadmin = acctadmin
        self.origpassword = self.newacctadmin.passwd
        if (newuser is not None):
            self.newuser = newuser
        else:
            #create a random user which should fail
            self.newuser = euwebuser.Euwebuser()
        self.results = results
 def setUp(self):
     self.gui = Eucaweb(configFile='../input/2b_tested.lst', clcpasswd='foobar')
     self.admin = euwebuser.Euwebuser(user="******", account="eucalyptus", passwd="admin")
     self.wg = self.gui.wg
     
     self.logger = eulogger.Eulogger(name= "user_first_time_login")
     
     self.debug = self.logger.log.debug
     self.critical = self.logger.log.critical
     self.info = self.logger.log.info 
class AdminFirstTimeLogin(unittest.TestCase):
    def setUp(self):
        self.gui = Eucaweb(configFile='../input/2b_tested.lst', clcpasswd='foobar')
        self.admin = euwebuser.Euwebuser(user="******", account="eucalyptus", passwd="admin")
        self.wg = self.gui.wg
        
        self.logger = eulogger.Eulogger(name= "user_first_time_login")
        
        self.debug = self.logger.log.debug
        self.critical = self.logger.log.critical
        self.info = self.logger.log.info 
        
    def test_admin_first_time_login(self):
        newuser = self.admin
        gui = self.gui
        try:       
            newuser.printUser()
            #gui.driverRestart()
            gui.goLoginPage()
            try:
                gui.login(newuser.account,newuser.user, newuser.passwd )
            except:
                try: 
                    self.gui.waitForTextOnPage('Login failed')
                except:
                    self.debug("First time Log in went to pop up instead, good")
                    gui.userFirstTimeLogin(newuser.email, newuser.passwd, newpass='******')
                
                    self.debug("Entered out form now checking page to see if we logged in correctly")
                    gui.verifyUserLinkPresent(newuser.user, newuser.account)
                    self.debug("First time login for ("+newuser.user+") succeeded")
                else:
                    self.fail("Initial password:"******" was rejected")
            else:
                self.fail("Initial Login succeeded without popup, was this really the first time?")
        except Exception, e:
            self.fail("test_admin_first_time_login failed:"+str(e))
示例#6
0
'''
Created on Nov 10, 2011

@author: clarkmatthew
'''

from eucaweb import Eucaweb, euwebuser, euwebaccount,euwebglobals
import time

if __name__ == '__main__':
    wg = euwebglobals.Webui_globals()
    ret = 0
    try:
        user = euwebuser.Euwebuser()
        a = euwebaccount.Euwebaccount()
        gui = Eucaweb("localhost","FIREFOX","192.168.51.9","admin")
        #gui.signUpUser(user.account, user.user, user.passwd, user.email)
        gui.login()
        accounts = gui.getAccountList()
        for a in accounts:
            a.printSelf()
            gui.clickButtonXpathAndVerify(a.id_xpath,a.name)
            navname= gui.getAccountsRightNavValueByName(wg.AccountsRightNav_Name)
            if (not navname):
                print "Ouch nav is missing"
            else:
                print "navname is:"+navname
                if (navname == a.name):
                    print "Matched name in right nav"+navname
            regstat = gui.getAccountsRightNavValueByName(wg.AccountsRightNav_RegStatus)
            if (not regstat):
示例#7
0
    #gui = eucawebdriver.Euguid(host="localhost",browser="FIREFOX",clc="192.168.51.9",needEutester=False)
    gui.goLoginPage()
    gui.login(user.account, user.user, user.passwd)
    time.sleep(5)
    gui.downloadCredentials(user.user,
                            user.account,
                            timeout=10,
                            callBackMethod=testMethod,
                            force=False)

    time.sleep(30)

    gui.tearDown(0)


def testMethod(filename):
    creddir = '/tmp/credentialtests'
    print "this is our test method we got filename(" + filename + ")"
    gui.unzipCredentialsToDir(filename, creddir)
    gui.sourceEucarcFromDir(creddir)


if __name__ == '__main__':
    gui = Eucaweb(host="localhost",
                  browser="FIREFOX",
                  clc="192.168.51.9",
                  needEutester=False)
    testrun()
    print "this test is done"
##############################################################################
#account admin, this users  randomly generated
acctadmin = euwebuser.Euwebuser(account="random", user="******", passwd="password", prefix="good")
acctadmin.printUser()

#New User to be added username will be randomly generated account is derived from acctadmin above
newuser = euwebuser.Euwebuser(prefix="newuser", passwd="password", account=acctadmin.account, user="******")
newuser.printUser()

#a throw away user...
rejectuser = euwebuser.Euwebuser(prefix="bad", passwd="password")
newuser.printUser()

#gui = Eucaweb(host="localhost",browser="FIREFOX",clc="192.168.51.9")
gui = Eucaweb(host="localhost",browser="FIREFOX", configFile="2b_tested.lst",clcpasswd="foobar")
results = []

#################################################################################

#load up our tests...
accounttests= qa_account_signup_tests.Qa_Account_SignUp_Tests(eucagui=gui,newuser=newuser,acctadmin=acctadmin, euadmin=euadmin,results = results)
addusertest = qa_add_user_tests.Qa_Add_User_Tests(eucagui=gui, newuser=newuser, acctadmin = acctadmin, euadmin = euadmin, results = results)
logintest = qa_login_tests.Qa_29_Login_Tests( eucagui=gui,validuser = newuser, adminuser = euadmin, results = results)

#now run the tests...
print "Running initial account sign up tests..."
accounttests.runAllTests(results, acctadmin, rejectuser, euadmin)
gui.wg.printResults(results)
print "Running initial add users tests..."
addusertest.runAllTests(results, euadmin, newuser, acctadmin)
示例#9
0
'''
Created on Nov 10, 2011

@author: clarkmatthew
'''

from eucaweb import Eucaweb, euwebuser, euwebaccount, euwebglobals
import time

if __name__ == '__main__':
    wg = euwebglobals.Webui_globals()
    ret = 0
    try:
        user = euwebuser.Euwebuser()
        a = euwebaccount.Euwebaccount()
        gui = Eucaweb("localhost", "FIREFOX", "192.168.51.9", "admin")
        #gui.signUpUser(user.account, user.user, user.passwd, user.email)
        gui.login()
        accounts = gui.getAccountList()
        for a in accounts:
            a.printSelf()
            gui.clickButtonXpathAndVerify(a.id_xpath, a.name)
            navname = gui.getAccountsRightNavValueByName(
                wg.AccountsRightNav_Name)
            if (not navname):
                print "Ouch nav is missing"
            else:
                print "navname is:" + navname
                if (navname == a.name):
                    print "Matched name in right nav" + navname
            regstat = gui.getAccountsRightNavValueByName(