def test_createUser_sendBooleanValues_apartFrom_true_and_false_066():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "**************** In Description: TestCase_066: Test CreateUser by sending  the  boolean values apart from True or False ****************"
    )
    print(
        "In Description :TestCase_066: Test CreateUser by sending  the  boolean values apart from True or False"
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )

    user = username_field_validations()
    userName = user.username_regex()

    file_body = readFiles()
    body = file_body.create_user_body()
    body['isADUser'] = 5
    body['userName'] = userName

    com.create_user_negative(body, userName)

    com.verify_users_from_sm_with_api(userName)
def test_createUser_password_below8Characters_062():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "****************  In Description :TestCase_062: Test CreateUser when user sends  -  password below 8 characters ****************"
    )
    print(
        "In Description :TestCase_062: Test CreateUser when user sends  -  password below 8 characters"
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )

    user = username_field_validations()
    userName = user.username_regex()

    file_body = readFiles()
    body = file_body.create_user_body()
    body['password'] = "******"
    body['userName'] = userName

    com.create_user_negative(body, userName)

    com.verify_users_from_sm_with_api(userName)
def test_createUser_missing_primatyID_070():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "****************  In Description :TestCase_070: Test  createUser by missing PrimaryID in the JSON body  ****************"
    )
    print(
        "In Description :TestCase_070: Test  createUser by missing PrimaryID in the JSON body"
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )

    # Body
    user = username_field_validations()
    userName = user.username_regex()

    file_body = readFiles()
    body = file_body.create_user_body()
    body['userName'] = userName
    body['firstName'] = ''
    body['lastName'] = ''

    com.create_user_negative(body, userName)

    com.verify_users_from_sm_with_api(userName)
def test_createUser_invalid_password_combination_065():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "**************** In Description: TestCase_065: Test CreateUser when user sends  -  invalid password combination ****************"
    )
    print(
        "In Description :TestCase_065: Test CreateUser when user sends  -  invalid password combination "
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )

    user = username_field_validations()
    userName = user.username_regex()

    file_body = readFiles()
    body = file_body.create_user_body()
    body['password'] = "******"
    body['confirmPassword'] = '******'
    body['userName'] = userName

    com.create_user_negative(body, userName)

    com.verify_users_from_sm_with_api(userName)
예제 #5
0
def test_createUser_userRole_fieldService_068():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "**************** In Description : TestCase_068: Test Default fieldService and its default User Role Settings ****************"
    )
    print(
        "In Description :TestCase_068: Test Default fieldService and its default User Role Settings"
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )

    userName = "******"

    file_body = readFiles()
    body = file_body.create_user_body()
    body['userRoleName'] = userName
    body['userName'] = userName

    com.create_user_negative(body, userName)

    com.verify_users_from_sm_with_api(userName)
예제 #6
0
파일: .py 프로젝트: vijaymandava/rmb
def test_createUser_email_without_atTheRate_041():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "****************  Test_041: Test CreateUser when user sends  -  Email without @ ****************"
    )
    print(
        "In Description : Test_041: Test CreateUser when user sends  -  Email without @"
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )

    user = username_field_validations()
    userName = user.username_regex()
    file_body = readFiles()
    body = file_body.create_user_body()
    body['userName'] = userName
    body['emailAddress'] = 'aabc.com'

    com.create_user_negative(body, userName)

    com.verify_users_from_sm_with_api(userName)
예제 #7
0
def test_createUser_telephone_endWithSpace_056():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "****************  In Description :TestCase_056: Test CreateUser when user sends  -  telephone end with space ****************"
    )
    print(
        "In Description : In Description :TestCase_056: Test CreateUser when user sends  -  telephone end with space"
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )

    user = username_field_validations()
    userName = user.username_regex()

    telephone = telephonenumber_field_validations()
    telephoneNumber = telephone.telephone_end_with_space()

    file_body = readFiles()
    body = file_body.create_user_body()
    body['telephoneNumber'] = telephoneNumber
    body['userName'] = userName

    com.create_user_negative(body, userName)

    com.verify_users_from_sm_with_api(userName)
예제 #8
0
def test_createUser_email_apartFrom_RegEx_046():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "****************  Test_046: Test CreateUser when user sends  -  Email with apart from RegEx ****************"
    )
    print(
        "In Description :Test_046: Test CreateUser when user sends  -  Email with apart from RegEx"
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )

    user = username_field_validations()
    userName = user.username_regex()

    list = {
        ".", "!", "@", "=", "$", "%", "^", "&", "*", "~", ":", ";", "/", "/",
        "?", "]", "[", "|"
    }
    for i in list:
        j = i + "@abc.com"
        file_body = readFiles()
        body = file_body.create_user_body()
        body['emailAddress'] = j
        body['userName'] = userName

        com.create_user_negative(body, userName)

        com.verify_users_from_sm_with_api(userName)
def test_createuser_userName_maxPlusOne_51_006():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "****************  Test_006: Test CreateUser when user sends  -  userName with maximum Plus one(51) ****************"
    )
    print(
        "In Description : Test_006: Test CreateUser when user sends  -  userName with maximum Plus one(51) "
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )

    # Body
    user = username_field_validations()
    userName = user.username_max_plus_one()
    file_body = readFiles()
    body = file_body.create_user_body()
    body['userName'] = userName

    com.create_user_negative(body, userName)

    com.verify_users_from_sm_with_api(userName)
def test_createUser_email_maxPlusOne_255Characters_052():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "**************** In Description: TestCase_052: Test CreateUser when user sends  -  email  maxPlusOne 255 characters ****************"
    )
    print(
        "In Description :In Description: TestCase_052: Test CreateUser when user sends  -  email  maxPlusOne 255 characters"
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )

    user = username_field_validations()
    userName = user.username_regex()

    file_body = readFiles()
    body = file_body.create_user_body()
    body[
        'emailAddress'] = "*****@*****.**"
    body['userName'] = userName

    com.create_user_negative(body, userName)

    com.verify_users_from_sm_with_api(userName)
def test_createUser_password_confirmPassword_different_059():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "**************** In Description: TestCase_059: Test CreateUser when user sends  -  password and ConfirmPassword doesn't match ****************"
    )
    print(
        "In Description :TestCase_059: Test CreateUser when user sends  -  password and ConfirmPassword doesn't match"
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )

    user = username_field_validations()
    userName = user.username_regex()

    file_body = readFiles()
    body = file_body.create_user_body()
    body['password'] = "******"
    body['confirmPassword'] = '******'
    body['userName'] = userName

    com.create_user_negative(body, userName)

    com.verify_users_from_sm_with_api(userName)
예제 #12
0
def test_createuser_userName_numbers_018():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info("****************  Test_018: Test CreateUser when user sends  -  userName with numbers ****************")
    print("In Description :Test_018: Test CreateUser when user sends  -  userName with numbers ")
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50")
    print("Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50")

    # Body
    user = username_field_validations()
    userName = user.username_numbers()
    file_body = readFiles()
    body = file_body.create_user_body()
    body['userName'] = userName

    com.create_user_positive(body, userName)

    com.verify_users_from_sm_with_api(userName)

    e = com.verify_user_options(userName)
    assert e['firstName'] == 'v'
    assert e['middleInitial'] == 'i'
    assert e['lastName'] == 'j'
    assert e['emailAddress'] == '*****@*****.**'
    assert e['telephoneNumber'] == '23'
    assert e['extension'] == '5309'
    assert e['password'] == 'Password123'
    assert e['userRoleName'] == 'Operator'
    assert e['deactivated'] == False
    assert e['hidden'] == False
    assert e['isADUser'] == False
    print("All the options are matched with the request")
def test_createUser_userName_miss_primaryID_022():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "****************  Test_022: Test CreateUser when user sends  - Miss any of the Primary ID's and send the Request(FirstName, LastName, Email ID, Telephone, password, confirmPassword) ****************"
    )
    print(
        "In Description :Test_022: Test CreateUser when user sends  - Miss any of the Primary ID's and send the Request(FirstName, LastName, Email ID, Telephone, password, confirmPassword)"
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )

    user = username_field_validations()
    userName = user.username_empty()
    file_body = readFiles()
    body = file_body.create_user_body()
    body['userName'] = userName

    com.create_user_negative(body, userName)

    com.verify_users_from_sm_with_api(userName)
예제 #14
0
def test_createUser_userName_apartFrom_RegEx_024():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "****************  Test_024: Test CreateUser when user sends 'userName' values other than ^[a-zA-Z0-9\-_()'.#\\+ ]*$   "
    )
    print(
        "In Description :Test_024: Test CreateUser when user sends 'userName' values other than ^[a-zA-Z0-9\-_()'.#\\+ ]*$"
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )

    # Body
    list = {
        ".", "!", "@", "=", "$", "%", "^", "&", "*", "~", ":", ";", "/", "/",
        "?", "]", "[", "|"
    }
    for userName in list:
        print("\n Trying to create user name ::", userName)
        file_body = readFiles()
        body = file_body.create_user_body()
        body['userName'] = userName
        com.create_user_negative(body, userName)
        com.verify_users_from_sm_with_api(userName)
예제 #15
0
def test_createUser_firstName_apartFrom_RegEx_033():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info("****************  Test_033: Test CreateUser when user sends  -  firstName apart From RegEx ****************")
    print("In Description :Test_033: Test CreateUser when user sends  -  firstName apart From RegEx")
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50")
    print("Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50")
    # URL
    url = ReadConfig.sm()

    # Additional headers.
    headers = com.headers()

    # Body
    x = Xeger(limit=15)
    name = com.userName_RegEx()
    userName = x.xeger(name)
    list = {".", "!", "@", "=", "$", "%", "^", "&", "*", "~", ":", ";", "/", "/", "?", "]", "[", "|"}
    for i in list:
        file = open("./tests_admin/testCases/create_user_api.json", 'r')
        print("Sending firstname ::"+i)
        body = json.loads(file.read())
        body['firstName'] = i
        body['userName'] = userName

        com.create_user_negative(body, userName)

        com.verify_users_from_sm_with_api(userName)
def test_createuser_existingUser_003():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "****************  Test_003: Test CreateUser when user sends  -  existing username ****************"
    )
    print(
        "In Description : Test_003: Test CreateUser when user sends  -  existing username"
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )

    # Body
    list = com.getUsersList()
    userName = random.choice(list)
    print("\n Trying to create user :::", userName)

    file_body = readFiles()
    body = file_body.create_user_body()
    body['userName'] = userName

    com.create_user_negative(body, userName)

    com.verify_users_from_sm_with_api(userName)
예제 #17
0
def test_createUser_userName_with_whiteSpaces_025():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "****************  Test_025:Test CreateUser when user sends userName values as white spaces "
    )
    print(
        "In Description :Test_025:Test CreateUser when user sends userName values as white spaces"
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )

    # Body
    user = username_field_validations()
    userName = user.username_whitespace()
    file_body = readFiles()
    body = file_body.create_user_body()
    body['userName'] = userName

    com.create_user_negative(body, userName)
    com.verify_users_from_sm_with_api(userName)
예제 #18
0
def test_createUser_lastName_empty_034():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "****************  Test_034: Test CreateUser when user sends  - Lastname empty ****************"
    )
    print(
        "In Description :Test_034: Test CreateUser when user sends  - Lastname empty"
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )

    # Body
    user = username_field_validations()
    userName = user.username_regex()
    file_body = readFiles()
    body = file_body.create_user_body()
    body['lastName'] = ""
    body['userName'] = userName

    com.create_user_negative(body, userName)

    com.verify_users_from_sm_with_api(userName)
예제 #19
0
 def verify_users_from_sm_with_api(self, roleName):
     com = common_createUser_api()
     headers = com.headers()
     url = ReadConfig.sm()
     cmurl = ReadConfig.cm_for_decryption()
     r = requests.get(url + "/getCMUsersList", headers=headers)
     data = r.json()
     # print("Data from SM::\n", r.json())
     resp1 = requests.post(cmurl + '/encryptDecrypt/decrypt',
                           headers=headers,
                           data=json.dumps(data, indent=4))
     roles = resp1.json()
     # print("Roles are ::", roles)
     # extracting data in json format
     list = []
     for item in roles:
         userroles = item.get('username')
         list.append(userroles)
     # print("Roles are :::\n", list)
     if list.__contains__(roleName):
         assert list.__contains__(roleName) == True
         print("\n Created User present in the SM(checking with API)  ::::",
               roleName)
         # logger.info("****************  Role present in the SM ****************")
     else:
         assert list.__contains__(roleName) != True
         print("\n User not present in the SM(checking with API)  ::::",
               roleName)
예제 #20
0
def test_createUser_middleInitial_RegEx_039():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "****************  Test_039: Test CreateUser when user sends  -  MiddleInitial RegEx ****************"
    )
    print(
        "In Description :Test_039: Test CreateUser when user sends  -  MiddleInitial RegEx"
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    # URL
    url = ReadConfig.sm()

    # Additional headers.
    headers = com.headers()

    # Body
    x = Xeger(limit=10)
    name = com.userName_RegEx()
    middle = com.middleInitial_RegEx()
    userName = x.xeger(name)
    y = Xeger(limit=1)
    middleInitial = y.xeger(middle)

    file = open("./tests_admin/testCases/create_user_api.json", 'r')
    body = json.loads(file.read())
    body['middleInitial'] = middleInitial
    body['userName'] = userName

    com.create_user_positive(body, userName)

    com.verify_users_from_sm_with_api(userName)

    e = com.verify_user_options(userName)
    assert e['userName'] == userName
    assert e['firstName'] == 'v'
    assert e['middleInitial'] == middleInitial
    assert e['lastName'] == 'j'
    assert e['emailAddress'] == '*****@*****.**'
    assert e['telephoneNumber'] == '23'
    assert e['extension'] == '5309'
    assert e['password'] == 'Password123'
    assert e['userRoleName'] == 'Operator'
    assert e['deactivated'] == False
    assert e['hidden'] == False
    assert e['isADUser'] == False
    print("All the options are matched with the request")
예제 #21
0
def test_createUser_email_with_64Characters_before_atTheRate_047():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "****************  Test_047: Test CreateUser when user sends  -  Email with 64 characters before @ ****************"
    )
    print(
        "In Description :Test_047: Test CreateUser when user sends  -  Email with 64 characters before @"
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )

    user = username_field_validations()
    userName = user.username_regex()

    emailAddress = '*****@*****.**'

    file_body = readFiles()
    body = file_body.create_user_body()
    body['emailAddress'] = emailAddress
    body['userName'] = userName

    com.create_user_positive(body, userName)

    com.verify_users_from_sm_with_api(userName)

    e = com.verify_user_options(userName)
    assert e['userName'] == userName
    assert e['firstName'] == 'v'
    assert e['middleInitial'] == 'i'
    assert e['lastName'] == 'j'
    assert e['emailAddress'] == emailAddress
    assert e['telephoneNumber'] == '23'
    assert e['extension'] == '5309'
    assert e['password'] == 'Password123'
    assert e['userRoleName'] == 'Operator'
    assert e['deactivated'] == False
    assert e['hidden'] == False
    assert e['isADUser'] == True
    print("All the options are matched with the request")
def test_createUser_userRole_null_078():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "**************** In Description: TestCase_078: Test CreateUser when user sends  - UserRoleName=Null ****************"
    )
    print(
        "In Description :TestCase_010: Test CreateUser when user sends  - UserRoleName=Null "
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164287?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164287?projectId=50"
    )

    # Body
    user = username_field_validations()
    userName = user.username_regex()

    print('UserRole field is sending as NULL')

    body = {
        "editedBy": "vijay",
        "userName": "******",
        "firstName": "v",
        "middleInitial": "i",
        "lastName": "j",
        "emailAddress": "*****@*****.**",
        "telephoneNumber": "123456",
        "extension": "5309",
        "password": '******',
        "confirmPassword": '******',
        "userRoleName": "",
        "deactivated": 'false',
        "hidden": 'false',
        "isADUser": '******'
    }

    com.create_user_negative(body, userName)

    com.verify_users_from_sm_with_api(userName)
예제 #23
0
def test_createUser_phoneNumber_empty_053():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info("**************** IN description : TestCase_053: Test CreateUser when user sends  -  telephone value as empty ****************")
    print("IN description : TestCase_053: Test CreateUser when user sends  -  telephone value as empty")
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50")
    print("Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50")

    user = username_field_validations()
    userName = user.username_regex()

    file_body = readFiles()
    body = file_body.create_user_body()
    body['telephoneNumber'] = ''
    body['userName'] = userName

    com.create_user_positive(body, userName)

    com.verify_users_from_sm_with_api(userName)
예제 #24
0
def test_createUser_userName_editedBy_null_026():
    logger = LogGen.loggen()
    com = common_createUser_api()
    file_body = readFiles()
    logger.info("****************  Test_026: Test CreateUser when user sends EditedBy values as empty")
    print("In Description : Test_026: Test CreateUser when user sends EditedBy values as empty")
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50")
    print("Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50")

    # Body
    user = username_field_validations()
    userName = user.username_regex()

    body = file_body.create_user_body()
    print("Sending EditedBy value as NULL")
    body['editedBy'] = ''
    body['userName'] = userName

    com.create_user_negative(body, userName)
    com.verify_users_from_sm_with_api(userName)
def test_createUser_lastName_apartFrom_RegEx_037():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info(
        "****************  Test_037: Test CreateUser when user sends  -  lastname apart from RegEx ****************"
    )
    print(
        "In Description :Test_037: Test CreateUser when user sends  -  lastname apart from RegEx"
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    # URL
    url = ReadConfig.sm()

    # Additional headers.
    headers = com.headers()

    # Body
    x = Xeger(limit=15)
    name = com.userName_RegEx()
    userName = x.xeger(name)
    list = {
        ".", "!", "@", "=", "$", "%", "^", "&", "*", "~", ":", ";", "/", "/",
        "?", "]", "[", "|"
    }
    for i in list:
        print(
            "Creating user by sending lastname value apart from RegEx - Sending value ::",
            i)
        file_body = readFiles()
        body = file_body.create_user_body()
        body['lastName'] = i
        body['userName'] = userName
        com.create_user_negative(body, userName)

        com.verify_users_from_sm_with_api(userName)
def test_createUser_without_userName_011():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info("**************** In Description: TestCase_011: Test createUser -  request with wrong JSON ****************")
    print("In Description : TestCase_011: Test createUser -  request with wrong JSON")
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164287?projectId=50")
    print("Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164287?projectId=50")

    user = username_field_validations()
    userName = user.username_regex()
    print("Sending incorrect/wrong JSON body")
    body = {
    "editedBy": "vijay", "userName": userName, "firstName": "v", "middleInitial":"i", "lastName":"j",
    "emailAddress": "*****@*****.**", "telephoneNumber": "123456", "extension": "5309", "password": '******',
    "confirmPassword": '******', "userRoleName": "Operator", "deactivated": 'false',
    "hidden": 'false',' { } '  "isADUser": '******'
    }

    com.create_user_negative(body, userName)

    com.verify_users_from_sm_with_api(userName)
예제 #27
0
def test_changeParameter_true_to_false_002():
    logger = LogGen.loggen()
    com = common_createUser_api()
    logger.info("****************  Test_002: Test CreateUser when user sends  - Change the parameter values inside body.(True to false and false to true) ****************")
    print("In Description : Test_002: Test CreateUser when user sends  - Change the parameter values inside body.(True to false and false to true) ")
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50")
    print("Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50")

    # Body
    user = username_field_validations()
    userName = user.username_regex()

    list = ['true', 'false']
    a=random.choice(list)
    print("\n Sending isADUser as ::", a)
    print("\n Trying creating username   ::", userName)

    file_body = readFiles()
    body = file_body.create_user_body()
    body['userName'] = userName
    body['isADuser'] = a

    com.create_user_positive(body, userName)
    com.verify_users_from_sm_with_api(userName)

    e = com.verify_user_options(userName)
    assert e['userName'] == userName
    assert e['firstName'] == 'v'
    assert e['middleInitial'] == 'i'
    assert e['lastName'] == 'j'
    assert e['emailAddress'] == '*****@*****.**'
    assert e['telephoneNumber'] == '23'
    assert e['extension'] == '5309'
    assert e['password'] == 'Password123'
    assert e['userRoleName'] == 'Administrator'
    assert e['deactivated'] == False
    assert e['hidden'] == False
    print("All the options are matched with the request")
예제 #28
0
def test_createUser_editedBy_ApartFrom_RegEx_029():
    logger = LogGen.loggen()
    com = common_createUser_api()
    file_body = readFiles()
    logger.info(
        "****************  Test_029: Test CreateUser when user sends  -  EditedBy value apart from  RegEx ****************"
    )
    print(
        "In Description : Test_029: Test CreateUser when user sends  -  EditedBy value apart from  RegEx"
    )
    logger.info(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )
    print(
        "Jama Link :: https://rapidmicrobiosystems.jamacloud.com/perspective.req#/testCases/164308?projectId=50"
    )

    # Body
    user = username_field_validations()
    userName = user.username_regex()

    list = {
        ".", "!", "@", "=", "$", "%", "^", "&", "*", "~", ":", ";", "/", "/",
        "?", "]", "[", "|"
    }
    for i in list:
        print(
            "\n Creating user by sending Edited by value apart from RegEx - Sending -  :",
            i)

        body = file_body.create_user_body()
        body['editedBy'] = i
        body['userName'] = userName

        com.create_user_negative(body, userName)

        com.verify_users_from_sm_with_api(userName)