Ejemplo n.º 1
0
def save_test_case_code():

    if request.method == 'POST':
        projectname = request.json['project']
        test_case_name = request.json['testCaseName']
        test_data = request.json['testData']
        content = request.json['content']

        data.save_test_data(root_path, projectname, test_case_name, test_data)
        test_case.save_test_case_code(root_path, projectname, test_case_name,
                                      content)

        return json.dumps('ok')
Ejemplo n.º 2
0
    def test_get_test_data_dict_list(self, testdir_fixture, project_fixture):
        input_data = [{
            'col1': 'a',
            'col2': 'b'
        }, {
            'col1': 'c',
            'col2': 'd',
        }]
        test_case.new_test_case(testdir_fixture['path'],
                                project_fixture['name'], [], 'test_get_data')
        data.save_test_data(testdir_fixture['path'], project_fixture['name'],
                            'test_get_data', input_data)
        returned_data = utils.get_test_data_dict_list(testdir_fixture['path'],
                                                      project_fixture['name'],
                                                      'test_get_data')

        assert returned_data == input_data
Ejemplo n.º 3
0
def save_test_case():

    if request.method == 'POST':
        project = request.json['project']
        test_name = request.json['testCaseName']
        description = request.json['description']
        page_objects = request.json['pageObjects']
        test_data = request.json['testData']
        test_steps = request.json['testSteps']

        data.save_test_data(root_path, project, test_name, test_data)

        test_case.save_test_case(root_path, project, test_name, description,
                                 page_objects, test_steps)

        changelog.log_change(root_path, project, 'MODIFY', 'test', test_name,
                             g.user.username)
        return json.dumps('ok')