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 ****************")
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 ****************")
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)
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)
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)
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)
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)