예제 #1
0
 def testAdminActions(self):
     url = "https://10.10.0.112/"
     adminCredentials = getAdminCredentials()
     error = None
     try:
         driver = getDriver(url)
         adminLogin(url, driver, adminCredentials[0], adminCredentials[1])
         registerPatientAccount(url, driver)
         assignTherapist(url, driver)
     except Exception as e:
         error = e
     self.assertIsNone(error)
예제 #2
0
def main(url):
    '''
    Logic behind the main function

    Arguments:
        url(str) : Target URL

    Returns:
        None
    '''
    driver = None
    try:
        adminCredentials = getAdminCredentials()
        therapistCredentials = getTherapistCredentials()
        patientCredentials = getPatientCredentials()
        driver = getDriver(url)
        adminLogin(url, driver, adminCredentials[0], adminCredentials[1])
        registerPatientAccount(url, driver)
        assignTherapist(url, driver)
        driver = getDriver(url)
        patientLogin(url, driver, patientCredentials[0], patientCredentials[8])
        createNewRecord(url, driver)
        driver = getDriver(url)
        therapistLogin(url, driver, therapistCredentials[0],
                       therapistCredentials[1])
        requestPermissions(url, driver)
        driver = getDriver(url)
        patientLogin(url, driver, patientCredentials[0], patientCredentials[8])
        approvePermissions(url, driver)
        driver = getDriver(url)
        therapistLogin(url, driver, therapistCredentials[0],
                       therapistCredentials[1])
        addDiagnosis(url, driver)
        driver = getDriver(url)
        patientLogin(url, driver, patientCredentials[0], patientCredentials[8])
        viewDiagnosis(url, driver)
    except:
        if (getDriverStatus(driver) == "alive"):
            driver.quit()
            print("Invalid hostname. Please try again!")
        else:
            print("Invalid hostname. Please try again!")
예제 #3
0
 def testGetAdminCredentials(self):
     adminCredentials = getAdminCredentials()
     adminCredentialsData = ["S1234567C", "easyP@ssw0rd"]
     self.assertEqual(adminCredentials, adminCredentialsData)