Beispiel #1
0
 def verify_update_roleName_options(self, roleName):
     url = ReadConfig.sm()
     cmurl = ReadConfig.cm_for_decryption()
     com = common()
     headers = com.headers()
     print("\n Verifying options in role ::  ", roleName)
     # Generating Token
     body = {
         "userRoleName": roleName
     }
     encryption = requests.post(cmurl + '/encryptDecrypt/encrypt', headers=headers, data=json.dumps(body, indent=4))
     encrypted_body = encryption.text
     b = json.loads(encrypted_body)
     resp = requests.post(url + '/getRole', headers=headers, data=json.dumps(b, indent=4))
     resp_text = resp.text
     d = json.loads(resp_text)
     message = d["status_message"]
     msg = json.loads(message)
     decrypt = requests.post(cmurl + '/encryptDecrypt/decrypt', headers=headers, data=json.dumps(msg, indent=4))
     decrypted_text = decrypt.text
     e = json.loads(decrypted_text)
     # print("\n Decrypted text is ::\n", e)
     # return e
     # for key, value in e.items():
     #     print("assert e['", key,"'] == ",value)
     return e
def test_delete_role_API_001():
    logger=LogGen.loggen()
    url = ReadConfig.sm()
    com = common()
    logger.info("****************  Test_001: Test delete Role when user sends  -  Valid Request ****************")
    logger.info("https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164305?projectId=50")
    print("****************  Test_001: Test delete Role when user sends  -  Valid Request ****************")
    print("Jama link is ::https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164305?projectId=50")
    headers = com.headers()
    role = com.getRolesList()
    delete_role = random.choice(role)
    print("\n Deleting role  ::  ", delete_role)
    # Generating Token
    body = {
    "userRoleName": delete_role,
    "deletedBy": "vijay"
    }
    b = com.encrypt(body)
    resp = requests.post(url + '/deleteRole', headers=headers, data=json.dumps(b, indent=4))
    resp_text = resp.text
    print("Response is :", resp_text)
    d = json.loads(resp_text)
    status = d.get('status')
    print("Status is ::", status)
    assert status == 'Success'
def test_delete_role_API_003():
    logger = LogGen.loggen()
    url = ReadConfig.sm()
    com = common()
    headers = com.headers()
    logger.info(
        "****************  Test_003: Test delete Role when user sends  -  without userRolename Request ****************"
    )
    logger.info(
        "https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164305?projectId=50"
    )
    print(
        "****************  Test_003: Test delete Role when user sends  -  without userRolename Request ****************"
    )
    print(
        "Jama link is ::https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164305?projectId=50"
    )
    # Generating Token
    body = {"deletedBy": "vijay"}
    b = com.encrypt(body)
    resp = requests.post(url + '/deleteRole',
                         headers=headers,
                         data=json.dumps(b, indent=4))
    resp_text = resp.text
    d = json.loads(resp_text)
    status = d.get('status')
    print("Status is ::", status)
    assert status == 'Failure'
Beispiel #4
0
def test_getRole_API_003():
    logger = LogGen.loggen()
    url = ReadConfig.sm()
    com = common()
    headers = com.headers()
    logger.info(
        "****************  Test_003: Test getRoles when user sends  - Valid Body ****************"
    )
    logger.info(
        "https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164278?projectId=50"
    )
    print(
        "****************  Test_003: Test getRoles when user sends  - Valid Body ****************"
    )
    print(
        "Jama link is ::https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164278?projectId=50"
    )

    body = {"userRoleName": "Administrator"}
    b = com.encrypt(body)
    resp = requests.post(url + '/getRoles',
                         headers=headers,
                         data=json.dumps(b, indent=4))
    resp_text = resp.text
    d = json.loads(resp_text)
    message = d["status_message"]
    msg = json.loads(message)
    com.decrypt(msg)
Beispiel #5
0
def test_delete_role_API_008():
    logger = LogGen.loggen()
    url = ReadConfig.sm()
    com = common()
    headers = com.headers()
    logger.info(
        "****************  Test_008: Test delete Role when user sends  -  Default Role Request ****************"
    )
    logger.info(
        "https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164305?projectId=50"
    )
    print(
        "****************  Test_008: Test delete Role when user sends  -  Default Role Request ****************"
    )
    print(
        "Jama link is ::https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164305?projectId=50"
    )
    list = ['Administrator', 'Fieldservice', 'Operator']
    # Generating Token
    for i in list:
        print("\n Deleting Role ::", i)
        body = {"userRoleName": i, "deletedBy": "vijay"}
        b = com.encrypt(body)
        resp = requests.post(url + '/deleteRole',
                             headers=headers,
                             data=json.dumps(b, indent=4))
        resp_text = resp.text
        d = json.loads(resp_text)
        message = d["status_message"]
        msg = json.loads(message)
        status = d.get('status')
        assert status == 'Failure'
        print("\n msg::", resp_text)
def test_getUser_API_004():
    logger = LogGen.loggen()
    com = common()
    logger.info(
        "****************  Test_004: GetUsers  -  Valid Request ****************"
    )
    logger.info(
        "https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164290?projectId=50"
    )
    print(
        "****************  Test_004: GetUsers  -  Valid Request ****************"
    )
    print(
        "Jama link is ::https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164290?projectId=50"
    )
    com.getUsersList()
Beispiel #7
0
def test_getRole_API_002():
    logger = LogGen.loggen()
    cmurl = ReadConfig.cm_for_decryption()
    smurl = ReadConfig.sm()
    com = common()
    headers = com.headers()
    logger.info(
        "****************  Test_002: Test getRole when user sends  -  Invalid Body ****************"
    )
    logger.info(
        "https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164278?projectId=50"
    )
    print(
        "****************  Test_002: Test getRole when user sends  -  Invalid Body ****************"
    )
    print(
        "Jama link is ::https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164278?projectId=50"
    )

    body = {"userRoleName": ""}
    b = com.encrypt(body)
    resp = requests.post(smurl + '/getRole',
                         headers=headers,
                         data=json.dumps(b, indent=4))
    resp_text = resp.text
    d = json.loads(resp_text)
    message = d["status_message"]
    msg = json.loads(message)
    decrypt = requests.post(cmurl + '/encryptDecrypt/decrypt',
                            headers=headers,
                            data=json.dumps(msg, indent=4))
    decrypted_text = decrypt.text
    e = json.loads(decrypted_text)
    status = e.get('status')
    assert status == 'failed'
    print("\n Decrypted text is ::\n", e)
Beispiel #8
0
def test_getRole_API_001():
    logger = LogGen.loggen()
    url = ReadConfig.sm()
    com = common()
    logger.info(
        "****************  Test_001: Test getRole when user sends  -  Valid Request ****************"
    )
    logger.info(
        "https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164278?projectId=50"
    )
    print(
        "****************  Test_001: Test getRole when user sends  -  Valid Request ****************"
    )
    print(
        "Jama link is ::https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164278?projectId=50"
    )
    headers = com.headers()
    role = com.getRolesList()
    get_role = random.choice(role)
    print("\n Getting role  ::  ", get_role)

    body = {"userRoleName": get_role}
    b = com.encrypt(body)
    resp = requests.post(url + '/getRole',
                         headers=headers,
                         data=json.dumps(b, indent=4))
    resp_text = resp.text
    d = json.loads(resp_text)
    message = d["status_message"]
    msg = json.loads(message)
    e = com.decrypt(msg)
    # print("value is ::", e )

    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