Example #1
0
    def test_EWA_1920_null_authorization_token_editGroup(self, delete_after_add_group):
        logger.debug('Edit Groups : test null authorization token')
        edit_group_url = base_url + apis.edit_group_info_endpoint + str(delete_after_add_group[0])

        response = webservice.put(url=edit_group_url, token=None, data={})

        assert response.status_code == 401
 def test_1967_Edit_role_description(self, delete_after_add_role):
     logger.debug('Edit Roles : by changing the Role name')
     edit_role_url = base_url + apis.edit_role_endpoint + str(
         delete_after_add_role[0])
     edit_role_payload = roles_helper.edit_role_data()
     response = webservice.put(url=edit_role_url,
                               token=admin_token,
                               data=json.dumps(edit_role_payload))
     response_data = response.json()
     assert response.status_code == 200
     assert response_data['responseCode'] == roles_data.get(
         'edit_role_response').get('responseCode')
     assert response_data['message'] == roles_data.get(
         'edit_role_response').get('message')
     group_id = roles_helper.get_group_list()[0]
     get_roles_list_url = base_url + apis.roles_list_enpoint + "group=" + (
         str(group_id['groupId']))
     role_list_response = webservice.get(url=get_roles_list_url,
                                         token=admin_token)
     role_list_response = role_list_response.json()['rolesList']
     result = utils.get_id_in_list(id=delete_after_add_role[0],
                                   lst=role_list_response,
                                   id_name="roleId")
     assert result['roleName'] == edit_role_payload['roleName']
     assert result['roleDescription'] == edit_role_payload[
         'roleDescription']
 def test_EWA_1901_empty_authorization_token_editGrade(
         self, delete_after_add_grade):
     logger.debug('Edit Grades : test empty authorization token')
     edit_grade_url = base_url + apis.edit_grade_info_endpoint + str(
         delete_after_add_grade[0])
     response = webservice.put(url=edit_grade_url, token='', data={})
     assert response.status_code == 401
 def test_1974_pass_empty_authorization_editRole(self,
                                                 delete_after_add_role):
     logger.debug('Edit Roles : by changing the Role name')
     edit_role_url = base_url + apis.edit_role_endpoint + str(
         delete_after_add_role[0])
     edit_role_payload = roles_helper.edit_role_data()
     response = webservice.put(url=edit_role_url,
                               token='',
                               data=json.dumps(edit_role_payload))
     assert response.status_code == 401
Example #5
0
 def test_EWA_1936_pass_empty_payload_group_id_toedit(self, delete_after_add_group):
     logger.debug('Edit groups : Test with empty payload')
     edit_group_url = base_url + apis.edit_group_info_endpoint + str(delete_after_add_group[0])
     edit_group_payload = {}
     response = webservice.put(url=edit_group_url, token=admin_token,
                               data=json.dumps(edit_group_payload))
     response_data = response.json()
     assert response.status_code == 200
     assert response_data['responseCode'] == groups_data.get('edit_group_response').get('responseCode')
     assert response_data['message'] == groups_data.get('edit_group_response').get('message')
Example #6
0
 def test_EWA_1935_pass_deleted_group_id_toedit(self, delete_after_add_group):
     logger.debug('Edit groups : test null authorization token')
     #taking the last group from the group list which has to be deleted and deleting it in this test case
     edit_group_url = base_url + apis.edit_group_info_endpoint + str(len(delete_after_add_group)-1)
     #deleting the group which has to be edited, before editing it
     group_delete_url = base_url + apis.delete_group_endpoint + str(len(delete_after_add_group)-1)
     response = webservice.delete(url=group_delete_url, token=admin_token)
     assert response.status_code == 200
     edit_group_payload = groups_data.get('edit_group')
     response = webservice.put(url=edit_group_url, token=admin_token, data=json.dumps(edit_group_payload))
     response_data = response.json()
     assert response.status_code == 200
     assert response_data['responseCode'] == groups_data.get('edit_group_with_deleted_id_response').get('responseCode')
     assert response_data['message'] == groups_data.get('edit_group_with_deleted_id_response').get('message')
 def test_EWA_1894_edit_grade_info(self, delete_after_add_grade):
     logger.debug('Edit Grades : test null authorization token')
     edit_grade_url = base_url + apis.edit_grade_info_endpoint + str(
         delete_after_add_grade[0])
     edit_grade_payload = grades_data.get('edit_grade')
     response = webservice.put(url=edit_grade_url,
                               token=admin_token,
                               data=json.dumps(edit_grade_payload))
     response_data = response.json()
     assert response.status_code == 200
     assert response_data['responseCode'] == grades_data.get(
         'edit_grade_response').get('responseCode')
     assert response_data['message'] == grades_data.get(
         'edit_grade_response').get('message')
 def test_automation_pass_non_admin_authorization_editRole(
         self, delete_after_add_role):
     logger.debug('Edit Roles : by changing the Role name')
     edit_role_url = base_url + apis.edit_role_endpoint + str(
         delete_after_add_role[0])
     edit_role_payload = roles_helper.edit_role_data()
     response = webservice.put(url=edit_role_url,
                               token=non_admin_token,
                               data=json.dumps(edit_role_payload))
     response_data = response.json()
     assert response.status_code == 200
     assert response_data['responseCode'] == roles_data.get(
         'non_admin_token_response').get('responseCode')
     assert response_data['message'] == roles_data.get(
         'non_admin_token_response').get('message')
Example #9
0
    def test_EWA_1910_edit_group_info(self, delete_after_add_group):

        logger.debug('Edit groups : test null authorization token')
        edit_group_url = base_url + apis.edit_group_info_endpoint + str(delete_after_add_group[0])
        edit_group_payload = groups_data.get('edit_group')
        response = webservice.put(url=edit_group_url, token=admin_token, data=json.dumps(edit_group_payload))
        response_data = response.json()
        assert response.status_code == 200
        assert response_data['responseCode'] == groups_data.get('edit_group_response').get('responseCode')
        assert response_data['message'] == groups_data.get('edit_group_response').get('message')
        #validate that the value has been edited as expected
        group_list_response = webservice.get(url=base_url + apis.group_list_endpoint, token=admin_token)
        group_list_response = group_list_response.json()['groups']
        result = utils.get_id_in_list(id=delete_after_add_group[0], lst=group_list_response, id_name="groupId")
        assert result['groupName'] == edit_group_payload['groupName']
        assert result['groupDescription'] == edit_group_payload['groupDescription']
 def test_1984_pass_deletedID_to_editRole(self, delete_after_add_role):
     logger.debug('Edit roless : test null authorization token')
     # taking the last role from the role list which has to be deleted and deleting it in this test case
     edit_role_url = base_url + apis.edit_role_endpoint + str(
         len(delete_after_add_role) - 1)
     # deleting the roles which has to be edited, before editing it
     role_delete_url = base_url + apis.delete_role_endpoint + str(
         len(delete_after_add_role) - 1)
     response = webservice.delete(url=role_delete_url, token=admin_token)
     assert response.status_code == 200
     edit_role_payload = roles_data.get('edit_role')
     response = webservice.put(url=edit_role_url,
                               token=admin_token,
                               data=json.dumps(edit_role_payload))
     response_data = response.json()
     assert response.status_code == 200
     assert response_data['responseCode'] == roles_data.get(
         'edit_role_with_deleted_id_response').get('responseCode')
     assert response_data['message'] == roles_data.get(
         'edit_role_with_deleted_id_response').get('message')