def test_roleName_editBy_apartfrom_RegEx_027():
    logger = LogGen.loggen()
    com = Common_role_api()
    logger.info("**************** In Description : TestCase_027: Test createRole by sending the 'EditedBy' values apart from  ^[a-zA-Z0-9]+$ ****************")
    print("In Description :Testcase_027: Test createRole by sending the 'EditedBy' values apart from  ^[a-zA-Z0-9]+$")
    logger.info("Jama link: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164299?projectId=50")
    print("Jama link: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164299?projectId=50")

    role = userRoleName_field_validations()
    roleName = role.userRolename_regex()

    print("\n Trying to create role :::", roleName)
    list = {".", "!", "@", "=", "$", "%", "^", "&", "*", "~", ":", ";", "/", "/", "?", "]", "[", "|"}
    for i in list:
        print("\n Trying to create role", roleName, " with editedBy:::", i)
        files = readFiles()
        body = files.create_role_body()
        body['editedBy'] = i
        body['userRoleName'] = roleName

        com.create_role_negative(body, roleName)

        com.verify_roles_from_sm_with_api(roleName)

    logger.info("****************  Role not created ****************")
Example #2
0
def test_Create_defaultRole_028():
    logger = LogGen.loggen()
    com = Common_role_api()
    logger.info(
        "****************  In Description :TestCase_028: Test CreateRole for by giving default userRoleName(Administrator/Operator/Fieldservice) ****************"
    )
    print(
        "In Description :Testcase_028: Test CreateRole for by giving default userRoleName(Administrator/Operator/Fieldservice)"
    )
    logger.info(
        "Jama link: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164299?projectId=50"
    )
    print(
        "Jama link: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164299?projectId=50"
    )

    list = {"Administrator", "FieldService", "Operator"}
    for roleName in list:
        print("\n Trying to create roleName ::", roleName)

        files = readFiles()
        body = files.create_role_body()
        body['userRoleName'] = roleName

        com.create_role_negative(body, roleName)

        com.verify_roles_from_sm_with_api(roleName)

    logger.info("****************  Role not created ****************")
Example #3
0
def test_roleName_empty_013():
    logger = LogGen.loggen()
    com = Common_role_api()
    logger.info(
        "****************  IN Description: TestCase_013: Test CreateRole when user sends  - 'userRoleName' with values :: empty ****************"
    )
    print(
        "In Description :Testcase_013: Test CreateRole when user sends  - userRoleName with values :: empty"
    )
    logger.info(
        "Jama link: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164299?projectId=50"
    )
    print(
        "Jama link: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164299?projectId=50"
    )

    role = userRoleName_field_validations()
    roleName = role.userRolename_empty()
    files = readFiles()
    body = files.create_role_body()
    body['userRoleName'] = roleName

    com.create_role_negative(body, roleName)

    com.verify_roles_from_sm_with_api(roleName)
def test_roleName_maxPlusOne_004():
    logger = LogGen.loggen()
    com = Common_role_api()
    logger.info(
        "**************** IN Description: TestCase_004 : Test CreateRole when user sends  - userRoleName with Maximum+1 value("
        "51) ****************")
    print(
        "**************** IN Description: TestCase_004 : Test CreateRole when user sends  - userRoleName with Maximum+1 value("
        "51) ****************")
    logger.info(
        "Jama link: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164299?projectId=50"
    )
    print(
        "jama link: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164299?projectId=50"
    )

    role = userRoleName_field_validations()
    roleName = role.userRolename_max_plus_one()
    file_body = readFiles()
    body = file_body.create_role_body()
    body['userRoleName'] = roleName

    com.create_role_negative(body, roleName)

    com.verify_roles_from_sm_with_api(roleName)
Example #5
0
def test_roleName_booleanFields_otherthan_true_false_023():
    logger = LogGen.loggen()
    com = Common_role_api()
    logger.info(
        "**************** In Description: TestCase_023: Test CreateRole by sending all boolean fields other than true or false. ****************"
    )
    print(
        "In Description :Testcase_023: Test CreateRole by sending all boolean fields other than true or false."
    )
    logger.info(
        "Jama link: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164299?projectId=50"
    )
    print(
        "Jama link: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164299?projectId=50"
    )

    roleName = random.randint(0, 9)
    print("\n Trying to create role :::", roleName)

    files = readFiles()
    body = files.create_role_body()
    body['createMethod'] = 1
    body['editMethod'] = 1
    body['deleteMethod'] = 0
    body['createActionAlertLevel'] = 1
    body['userRoleName'] = roleName

    com.create_role_negative(body, roleName)

    com.verify_roles_from_sm_with_api(roleName)
Example #6
0
def test_roleName_RegEx_025():
    logger = LogGen.loggen()
    com = Common_role_api()
    logger.info(
        "****************  IN Description: TestCase_025: Test CreateRole by sending the userRoleName apart from  ^[a-zA-Z0-9\-_()'.#\\+ ]*$  (ex:- ?,@ etc.,) ****************"
    )
    print(
        "In Description :Testcase_025: Test CreateRole by sending the userRoleName apart from  ^[a-zA-Z0-9\-_()'.#\\+ ]*$  (ex:- ?,@ etc.,)"
    )
    logger.info(
        "Jama link: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164299?projectId=50"
    )
    print(
        "Jama link: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164299?projectId=50"
    )

    # Body
    list = {
        ".", "!", "@", "=", "$", "%", "^", "&", "*", "~", ":", ";", "/", "/",
        "?", "]", "[", "|"
    }
    for roleName in list:
        print("\n Trying to create role :::", roleName)
        files = readFiles()
        body = files.create_role_body()
        body['userRoleName'] = roleName

        com.create_role_negative(body, roleName)

        com.verify_roles_from_sm_with_api(roleName)
Example #7
0
def test_roleName_without_userRoleNameField_020():
    logger = LogGen.loggen()
    com = Common_role_api()
    logger.info(
        "**************** IN Description: TestCase_020: Test CreateRole when user sends JSON without 'userRoleName'. ****************"
    )
    print(
        "In Description :Testcase_020: Test CreateRole when user sends JSON without 'userRoleName'."
    )
    logger.info(
        "Jama link: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164299?projectId=50"
    )
    print(
        "Jama link: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164299?projectId=50"
    )

    roleName = ""
    print("\n Trying to create role :::", roleName)

    files = readFiles()
    body = files.create_role_body()
    body['userRoleName'] = roleName

    com.create_role_negative(body, roleName)

    com.verify_roles_from_sm_with_api(roleName)
Example #8
0
def test_roleName_without_EditByField_022():
    logger = LogGen.loggen()
    com = Common_role_api()
    logger.info(
        "****************  IN Description: TestCase_022: Test CreateRole by sending EditedBy='whitespaces'. ****************"
    )
    print(
        "In Description :Testcase_022: Test CreateRole by sending EditedBy='whitespaces'"
    )
    logger.info(
        "Jama link: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164299?projectId=50"
    )
    print(
        "Jama link: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164299?projectId=50"
    )

    roleName = random.randint(0, 9)
    print("\n Trying to create role :::", roleName)

    files = readFiles()
    body = files.create_role_body()
    body['editedBy'] = ''
    body['userRoleName'] = roleName

    com.create_role_negative(body, roleName)

    com.verify_roles_from_sm_with_api(roleName)
def test_roleName_leadingSpaces_015():
    logger = LogGen.loggen()
    logger.info(
        "****************  IN Description: TestCase_015: Test CreateRole when user sends  - 'userRoleName' with values :: leadingSpaces ****************"
    )
    print(
        "In Description :Testcase_015: Test CreateRole when user sends  - userRoleName with values :: leadingSpaces"
    )
    logger.info(
        "Jama link: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164299?projectId=50"
    )
    print(
        "Jama link: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164299?projectId=50"
    )

    com = Common_role_api()

    role = userRoleName_field_validations()
    roleName = role.userRolename_leading_spaces()
    files = readFiles()
    body = files.create_role_body()
    body['userRoleName'] = roleName

    com.create_role_positive(body, roleName)

    com.verify_roles_from_sm_with_api(roleName)

    e = com.verify_roleName_options(roleName)
    assert e['userRoleName'] == roleName
    assert e['createMethod'] == True
    assert e['editMethod'] == True
    assert e['deleteMethod'] == True
    assert e['createActionAlertLevel'] == True
    assert e['editActionAlertLevel'] == True
    assert e['deleteActionAlertLevel'] == True
    assert e['createHandlingRule'] == True
    assert e['editHandlingRule'] == True
    assert e['deleteHandlingRule'] == True
    assert e['createSample'] == False
    assert e['editSample'] == False
    assert e['deleteSample'] == False
    assert e['createProduct'] == False
    assert e['editProduct'] == False
    assert e['deleteProduct'] == False
    assert e['createUser'] == False
    assert e['editUser'] == False
    assert e['deleteUser'] == False
    assert e['createUserRole'] == False
    assert e['editUserRole'] == False
    assert e['deleteUserRole'] == False
    assert e['cancelCassettes'] == True
    assert e['retrieveCassettes'] == True
    assert e['approveCassettes'] == True
    assert e['cleanupCassettes'] == True
    assert e['orderTests'] == True
    assert e['loadTests'] == True
    assert e['printProductLabels'] == True
    assert e['administerGD'] == False
    assert e['editSettings'] == False
    assert e['maintenance'] == False
    assert e['acknowledgeSystemAlarms'] == True
    assert e['acknowledgeSystemErrors'] == True
    assert e['acknowledgeSystemServiceIssues'] == True
    assert e['editAlarmNotifications'] == False
    assert e['emptyTrash'] == True
    assert e['service'] == False
    assert e['editITSettings'] == False
    assert e['editLimsSettings'] == False
    assert e['printLimsLabels'] == False
    assert e['modifyLimsRequest'] == False
    assert e['editLimsTestResultsFields'] == False
    assert e['sendSystemLogs'] == True
    print("All the options are verified and match with the request")