Exemple #1
0
def readRolesTest():
    try:
        role = tu.createRole("hello", "hey", [1, 2, 4, 5, 6, 9, 10, 17, 18])
        inds = [8, 19, 21, 4, 15, 0, 11, 6, 17]
        iden = tu.createIdentity("billy", "bob")
        tu.assignRole(iden, role)
    except:
        print "Failed to set up read roles test"
        return False
    d = tu.newtest()
    wait = WebDriverWait(d, timeout=5, poll_frequency=0.2)
    try:
        tu.goUsers(d)
        tu.goRoles(d)
        time.sleep(2)
        wait.until(lambda x: len(
            x.find_elements_by_xpath("//input[@type='checkbox']")) > 22)
        checked = d.find_elements_by_xpath(
            "//input[@type='checkbox' and @value='on']")
        boxes = d.find_elements_by_xpath("//input[@type='checkbox']")
        for i in inds:
            box = d.find_elements_by_xpath("//input[@type='checkbox']")[(i * 2)
                                                                        + 1]
            if not box in checked:
                print "Permission {0} isn't checked".format(i)
                return False
    except Exception as e:
        print e
        print "Failed to access users/roles page"
        return False
    finally:
        tu.endtest(d)

    return True
Exemple #2
0
def main():
    failcount = 0
    d = tu.newtest()

    if not nameFilterTest(d):
        failcount += 1

    tu.endtest(d)
    sys.exit(failcount)
Exemple #3
0
def main():
    failcount = 0

    d = tu.newtest()
    time.sleep(2)
    if not regressSortTest(d):
        failcount += 1
    tu.endtest(d)
    d = tu.newtest()
    time.sleep(2)
    if not binomSortTest(d):
        failcount += 1
    tu.endtest(d)
    d = tu.newtest()
    time.sleep(2)
    if not mulnomSortTest(d):
        failcount += 1

    tu.endtest(d)
    sys.exit(failcount)
Exemple #4
0
def main():
    failcount = 0
    d = tu.newtest()

    if not compRegTest(d):
        failcount += 1
    if not compBinTest(d):
        failcount += 1
    if not compMultiTest(d):
        failcount += 1

    tu.endtest(d)
    sys.exit(failcount)
Exemple #5
0
def main():
    failcount = 0
    d = tu.newtest()
    d.get("http://*****:*****@localhost:9000")
    if not createProjectTest(d):
        print "createproj"
        failcount += 1
    if not viewProjectTest(d):
        print "viewproj"
        failcount += 1
    if not importMultiTest(d):
        print "importmulti"
        failcount += 1

    d.quit()
    sys.exit(failcount)
Exemple #6
0
def main():
	failcount = 0
	d = tu.newtest()
	
	if not createTagTest(d):
		failcount += 1
	if not applyTagTest(d):
		failcount += 1
	if not multiTagTest(d):
		failcount += 1
	if not conflictTagTest(d):
		failcount += 1	
	if not deleteTagTest(d):
		failcount += 1
			
	tu.endtest(d)
	sys.exit(failcount)
Exemple #7
0
def main():
    failcount = 0
    d = tu.newtest()
    r = setup()

    if not writeumsTest(d, r):
        failcount += 1
    d.refresh()
    tu.goHome(d)
    if not createUserTest(d):
        failcount += 1
    if not createRoleTest(d):
        failcount += 1
    if not createRoleUserTest(d):
        failcount += 1

    tu.endtest(d)
    sys.exit(failcount)
Exemple #8
0
def readUsersTest():
    d = tu.newtest()
    wait = WebDriverWait(d, timeout=5, poll_frequency=0.2)
    iden = [("joe", "shmoe"), ("jerry", "fairy"), ("Rick", "kimmy")]
    try:
        for i in iden:
            num = tu.createIdentity(i[0], i[1])
            tu.assignRole(num, 1)

    except:
        print "Failed to create idnetities"
        return False
    try:
        tu.goUsers(d)
        for i in iden:
            wait.until(lambda x: x.find_element_by_xpath(
                "//div[@class='cell' and text()='{0}']".format(i[0])))
    except:
        print "Users missing from users page"
        return False
    finally:
        tu.endtest(d)
    return True
Exemple #9
0
def superShareTest():
    res = [True, True]
    tu.cliLogin("superuser", "superuser")
    wg = tu.createWorkgroup("supertest", "testin super share")
    d = tu.newtest()
    wait = WebDriverWait(d, timeout=5, poll_frequency=0.2)
    tu.newProject(d)
    tu.addCluster(d, "localhost", "54535", "steamtest")
    d.find_element_by_xpath("//div[@class='select-cluster']//button").click()
    tu.selectDataframe(d, "bank_full.hex")
    tu.selectModelCategory(d, "Regression")
    try:
        tu.selectModel(d, "regress")
        d.find_element_by_xpath(
            "//div[@class='name-project']//input").send_keys("supertest")
        d.find_element_by_xpath("//button[text()='Create Project']").click()
        wait.until(lambda x: x.find_element_by_xpath(
            "//div[@class='model-name' and text()='regress']"))
        tu.goProjectConfig(d)
        d.find_element_by_xpath("//button[text()='Create New Label']").click()
        wait.until(lambda x: x.find_element_by_xpath("//input[@name='name']").
                   is_displayed())
        d.find_element_by_xpath("//input[@name='name']").send_keys("taggy")
        d.find_element_by_xpath("//textarea[@name='description']").send_keys(
            "the taggiest tag")
        d.find_element_by_xpath("//button[text()='Save']").click()
        wait.until(lambda x: x.find_element_by_xpath(
            "//div[@class='label-name' and text()='taggy']").is_displayed())
    except:
        print "Failed to setup super sharing test"
        return False
    finally:
        tu.endtest(d)

    tu.shareEntity(6, 1, wg, 'edit')
    tu.shareEntity(9, 1, wg, 'edit')

    uid = tu.createIdentity("noperm", "noperm")
    tu.assignWorkgroup(uid, wg)
    d = tu.testAs("noperm", "noperm")
    try:
        #permissionless test
        tu.goProjects(d)
        if tu.viewProject(d, "supertest"):
            res[0] = False
            print "User with no permissions is able to view entities shared by superuser"
    except:
        res[0] = True
    finally:
        tu.endtest(d)

    uid = tu.createIdentity("yaperm", "yaperm")
    rid = tu.createRole("permissed", "for testing supershare",
                        [9, 10, 11, 12, 17, 18, 19, 20])
    tu.assignWorkgroup(uid, wg)
    tu.assignRole(uid, rid)
    d = tu.testAs("yaperm", "yaperm")
    try:
        #permissable test
        tu.goProjects(d)
        time.sleep(2)
        if not tu.viewProject(d, "supertest"):
            res[0] = False
            print "User could not see project shared by superuser"
    except:
        res[1] = False
        print "User with appropriate permissions is not able to view entities shared by superuser"
    finally:
        tu.endtest(d)
    return res[0] and res[1]
Exemple #10
0
def setup():
	driver = tu.newtest()
	return driver
Exemple #11
0
def main():
	failcount = 0
	d = tu.newtest()
	
	tu.endtest(d)
	sys.exit(failcount)